tools: update eslint to 8.5.0
PR-URL: https://github.com/nodejs/node/pull/41228 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
parent
7a18a78c6e
commit
94d493896e
14
tools/node_modules/eslint/lib/rule-tester/rule-tester.js
generated
vendored
14
tools/node_modules/eslint/lib/rule-tester/rule-tester.js
generated
vendored
@ -216,6 +216,9 @@ function freezeDeeply(x) {
|
||||
* @returns {string} The sanitized text.
|
||||
*/
|
||||
function sanitize(text) {
|
||||
if (typeof text !== "string") {
|
||||
return "";
|
||||
}
|
||||
return text.replace(
|
||||
/[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex -- Escaping controls
|
||||
c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}`
|
||||
@ -691,6 +694,13 @@ class RuleTester {
|
||||
* @private
|
||||
*/
|
||||
function testValidTemplate(item) {
|
||||
const code = typeof item === "object" ? item.code : item;
|
||||
|
||||
assert.ok(typeof code === "string", "Test case must specify a string value for 'code'");
|
||||
if (item.name) {
|
||||
assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string");
|
||||
}
|
||||
|
||||
const result = runRuleForItem(item);
|
||||
const messages = result.messages;
|
||||
|
||||
@ -731,6 +741,10 @@ class RuleTester {
|
||||
* @private
|
||||
*/
|
||||
function testInvalidTemplate(item) {
|
||||
assert.ok(typeof item.code === "string", "Test case must specify a string value for 'code'");
|
||||
if (item.name) {
|
||||
assert.ok(typeof item.name === "string", "Optional test case property 'name' must be a string");
|
||||
}
|
||||
assert.ok(item.errors || item.errors === 0,
|
||||
`Did not specify errors for an invalid test of ${ruleName}`);
|
||||
|
||||
|
23
tools/node_modules/eslint/lib/rules/id-match.js
generated
vendored
23
tools/node_modules/eslint/lib/rules/id-match.js
generated
vendored
@ -67,6 +67,8 @@ module.exports = {
|
||||
onlyDeclarations = !!options.onlyDeclarations,
|
||||
ignoreDestructuring = !!options.ignoreDestructuring;
|
||||
|
||||
let globalScope;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//--------------------------------------------------------------------------
|
||||
@ -77,6 +79,19 @@ module.exports = {
|
||||
const DECLARATION_TYPES = new Set(["FunctionDeclaration", "VariableDeclarator"]);
|
||||
const IMPORT_TYPES = new Set(["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"]);
|
||||
|
||||
/**
|
||||
* Checks whether the given node represents a reference to a global variable that is not declared in the source code.
|
||||
* These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
|
||||
* @param {ASTNode} node `Identifier` node to check.
|
||||
* @returns {boolean} `true` if the node is a reference to a global variable.
|
||||
*/
|
||||
function isReferenceToGlobalVariable(node) {
|
||||
const variable = globalScope.set.get(node.name);
|
||||
|
||||
return variable && variable.defs.length === 0 &&
|
||||
variable.references.some(ref => ref.identifier === node);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a string matches the provided pattern
|
||||
* @param {string} name The string to check.
|
||||
@ -155,11 +170,19 @@ module.exports = {
|
||||
|
||||
return {
|
||||
|
||||
Program() {
|
||||
globalScope = context.getScope();
|
||||
},
|
||||
|
||||
Identifier(node) {
|
||||
const name = node.name,
|
||||
parent = node.parent,
|
||||
effectiveParent = (parent.type === "MemberExpression") ? parent.parent : parent;
|
||||
|
||||
if (isReferenceToGlobalVariable(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (parent.type === "MemberExpression") {
|
||||
|
||||
if (!checkProperties) {
|
||||
|
1
tools/node_modules/eslint/lib/rules/index.js
generated
vendored
1
tools/node_modules/eslint/lib/rules/index.js
generated
vendored
@ -255,6 +255,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({
|
||||
"prefer-exponentiation-operator": () => require("./prefer-exponentiation-operator"),
|
||||
"prefer-named-capture-group": () => require("./prefer-named-capture-group"),
|
||||
"prefer-numeric-literals": () => require("./prefer-numeric-literals"),
|
||||
"prefer-object-has-own": () => require("./prefer-object-has-own"),
|
||||
"prefer-object-spread": () => require("./prefer-object-spread"),
|
||||
"prefer-promise-reject-errors": () => require("./prefer-promise-reject-errors"),
|
||||
"prefer-reflect": () => require("./prefer-reflect"),
|
||||
|
112
tools/node_modules/eslint/lib/rules/prefer-object-has-own.js
generated
vendored
Normal file
112
tools/node_modules/eslint/lib/rules/prefer-object-has-own.js
generated
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
/**
|
||||
* @fileoverview Prefers Object.hasOwn() instead of Object.prototype.hasOwnProperty.call()
|
||||
* @author Nitin Kumar
|
||||
* @author Gautam Arora
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const astUtils = require("./utils/ast-utils");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Checks if the given node is considered to be an access to a property of `Object.prototype`.
|
||||
* @param {ASTNode} node `MemberExpression` node to evaluate.
|
||||
* @returns {boolean} `true` if `node.object` is `Object`, `Object.prototype`, or `{}` (empty 'ObjectExpression' node).
|
||||
*/
|
||||
function hasLeftHandObject(node) {
|
||||
|
||||
/*
|
||||
* ({}).hasOwnProperty.call(obj, prop) - `true`
|
||||
* ({ foo }.hasOwnProperty.call(obj, prop)) - `false`, object literal should be empty
|
||||
*/
|
||||
if (node.object.type === "ObjectExpression" && node.object.properties.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const objectNodeToCheck = node.object.type === "MemberExpression" && astUtils.getStaticPropertyName(node.object) === "prototype" ? node.object.object : node.object;
|
||||
|
||||
if (objectNodeToCheck.type === "Identifier" && objectNodeToCheck.name === "Object") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
docs: {
|
||||
description:
|
||||
"disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/rules/prefer-object-has-own"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
useHasOwn: "Use 'Object.hasOwn()' instead of 'Object.prototype.hasOwnProperty.call()'."
|
||||
},
|
||||
fixable: "code"
|
||||
},
|
||||
create(context) {
|
||||
return {
|
||||
CallExpression(node) {
|
||||
if (!(node.callee.type === "MemberExpression" && node.callee.object.type === "MemberExpression")) {
|
||||
return;
|
||||
}
|
||||
|
||||
const calleePropertyName = astUtils.getStaticPropertyName(node.callee);
|
||||
const objectPropertyName = astUtils.getStaticPropertyName(node.callee.object);
|
||||
const isObject = hasLeftHandObject(node.callee.object);
|
||||
|
||||
// check `Object` scope
|
||||
const scope = context.getScope();
|
||||
const variable = astUtils.getVariableByName(scope, "Object");
|
||||
|
||||
if (
|
||||
calleePropertyName === "call" &&
|
||||
objectPropertyName === "hasOwnProperty" &&
|
||||
isObject &&
|
||||
variable && variable.scope.type === "global"
|
||||
) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "useHasOwn",
|
||||
fix(fixer) {
|
||||
const sourceCode = context.getSourceCode();
|
||||
|
||||
if (sourceCode.getCommentsInside(node.callee).length > 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const tokenJustBeforeNode = sourceCode.getTokenBefore(node.callee, { includeComments: true });
|
||||
|
||||
// for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335
|
||||
if (
|
||||
tokenJustBeforeNode &&
|
||||
tokenJustBeforeNode.range[1] === node.callee.range[0] &&
|
||||
!astUtils.canTokensBeAdjacent(tokenJustBeforeNode, "Object.hasOwn")
|
||||
) {
|
||||
return fixer.replaceText(node.callee, " Object.hasOwn");
|
||||
}
|
||||
|
||||
return fixer.replaceText(node.callee, "Object.hasOwn");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
218
tools/node_modules/eslint/lib/rules/prefer-regex-literals.js
generated
vendored
218
tools/node_modules/eslint/lib/rules/prefer-regex-literals.js
generated
vendored
@ -11,11 +11,15 @@
|
||||
|
||||
const astUtils = require("./utils/ast-utils");
|
||||
const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("eslint-utils");
|
||||
const { RegExpValidator, visitRegExpAST, RegExpParser } = require("regexpp");
|
||||
const { canTokensBeAdjacent } = require("./utils/ast-utils");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const REGEXPP_LATEST_ECMA_VERSION = 2022;
|
||||
|
||||
/**
|
||||
* Determines whether the given node is a string literal.
|
||||
* @param {ASTNode} node Node to check.
|
||||
@ -43,6 +47,71 @@ function isStaticTemplateLiteral(node) {
|
||||
return node.type === "TemplateLiteral" && node.expressions.length === 0;
|
||||
}
|
||||
|
||||
const validPrecedingTokens = [
|
||||
"(",
|
||||
";",
|
||||
"[",
|
||||
",",
|
||||
"=",
|
||||
"+",
|
||||
"*",
|
||||
"-",
|
||||
"?",
|
||||
"~",
|
||||
"%",
|
||||
"**",
|
||||
"!",
|
||||
"typeof",
|
||||
"instanceof",
|
||||
"&&",
|
||||
"||",
|
||||
"??",
|
||||
"return",
|
||||
"...",
|
||||
"delete",
|
||||
"void",
|
||||
"in",
|
||||
"<",
|
||||
">",
|
||||
"<=",
|
||||
">=",
|
||||
"==",
|
||||
"===",
|
||||
"!=",
|
||||
"!==",
|
||||
"<<",
|
||||
">>",
|
||||
">>>",
|
||||
"&",
|
||||
"|",
|
||||
"^",
|
||||
":",
|
||||
"{",
|
||||
"=>",
|
||||
"*=",
|
||||
"<<=",
|
||||
">>=",
|
||||
">>>=",
|
||||
"^=",
|
||||
"|=",
|
||||
"&=",
|
||||
"??=",
|
||||
"||=",
|
||||
"&&=",
|
||||
"**=",
|
||||
"+=",
|
||||
"-=",
|
||||
"/=",
|
||||
"%=",
|
||||
"/",
|
||||
"do",
|
||||
"break",
|
||||
"continue",
|
||||
"debugger",
|
||||
"case",
|
||||
"throw"
|
||||
];
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
@ -59,6 +128,8 @@ module.exports = {
|
||||
url: "https://eslint.org/docs/rules/prefer-regex-literals"
|
||||
},
|
||||
|
||||
hasSuggestions: true,
|
||||
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
@ -74,6 +145,7 @@ module.exports = {
|
||||
|
||||
messages: {
|
||||
unexpectedRegExp: "Use a regular expression literal instead of the 'RegExp' constructor.",
|
||||
replaceWithLiteral: "Replace with an equivalent regular expression literal.",
|
||||
unexpectedRedundantRegExp: "Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.",
|
||||
unexpectedRedundantRegExpWithFlags: "Use regular expression literal with flags instead of the 'RegExp' constructor."
|
||||
}
|
||||
@ -81,6 +153,7 @@ module.exports = {
|
||||
|
||||
create(context) {
|
||||
const [{ disallowRedundantWrapping = false } = {}] = context.options;
|
||||
const sourceCode = context.getSourceCode();
|
||||
|
||||
/**
|
||||
* Determines whether the given identifier node is a reference to a global variable.
|
||||
@ -107,6 +180,27 @@ module.exports = {
|
||||
isStaticTemplateLiteral(node.quasi);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of a string
|
||||
* @param {ASTNode} node The node to get the string of.
|
||||
* @returns {string|null} The value of the node.
|
||||
*/
|
||||
function getStringValue(node) {
|
||||
if (isStringLiteral(node)) {
|
||||
return node.value;
|
||||
}
|
||||
|
||||
if (isStaticTemplateLiteral(node)) {
|
||||
return node.quasis[0].value.cooked;
|
||||
}
|
||||
|
||||
if (isStringRawTaggedStaticTemplateLiteral(node)) {
|
||||
return node.quasi.quasis[0].value.raw;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the given node is considered to be a static string by the logic of this rule.
|
||||
* @param {ASTNode} node Node to check.
|
||||
@ -152,6 +246,53 @@ module.exports = {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a ecmaVersion compatible for regexpp.
|
||||
* @param {any} ecmaVersion The ecmaVersion to convert.
|
||||
* @returns {import("regexpp/ecma-versions").EcmaVersion} The resulting ecmaVersion compatible for regexpp.
|
||||
*/
|
||||
function getRegexppEcmaVersion(ecmaVersion) {
|
||||
if (typeof ecmaVersion !== "number" || ecmaVersion <= 5) {
|
||||
return 5;
|
||||
}
|
||||
return Math.min(ecmaVersion + 2009, REGEXPP_LATEST_ECMA_VERSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a character escaped or else returns null.
|
||||
* @param {string} character The character to escape.
|
||||
* @returns {string} The resulting escaped character.
|
||||
*/
|
||||
function resolveEscapes(character) {
|
||||
switch (character) {
|
||||
case "\n":
|
||||
case "\\\n":
|
||||
return "\\n";
|
||||
|
||||
case "\r":
|
||||
case "\\\r":
|
||||
return "\\r";
|
||||
|
||||
case "\t":
|
||||
case "\\\t":
|
||||
return "\\t";
|
||||
|
||||
case "\v":
|
||||
case "\\\v":
|
||||
return "\\v";
|
||||
|
||||
case "\f":
|
||||
case "\\\f":
|
||||
return "\\f";
|
||||
|
||||
case "/":
|
||||
return "\\/";
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
Program() {
|
||||
const scope = context.getScope();
|
||||
@ -171,7 +312,82 @@ module.exports = {
|
||||
context.report({ node, messageId: "unexpectedRedundantRegExp" });
|
||||
}
|
||||
} else if (hasOnlyStaticStringArguments(node)) {
|
||||
context.report({ node, messageId: "unexpectedRegExp" });
|
||||
let regexContent = getStringValue(node.arguments[0]);
|
||||
let noFix = false;
|
||||
let flags;
|
||||
|
||||
if (node.arguments[1]) {
|
||||
flags = getStringValue(node.arguments[1]);
|
||||
}
|
||||
|
||||
const regexppEcmaVersion = getRegexppEcmaVersion(context.parserOptions.ecmaVersion);
|
||||
const RegExpValidatorInstance = new RegExpValidator({ ecmaVersion: regexppEcmaVersion });
|
||||
|
||||
try {
|
||||
RegExpValidatorInstance.validatePattern(regexContent, 0, regexContent.length, flags ? flags.includes("u") : false);
|
||||
if (flags) {
|
||||
RegExpValidatorInstance.validateFlags(flags);
|
||||
}
|
||||
} catch {
|
||||
noFix = true;
|
||||
}
|
||||
|
||||
const tokenBefore = sourceCode.getTokenBefore(node);
|
||||
|
||||
if (tokenBefore && !validPrecedingTokens.includes(tokenBefore.value)) {
|
||||
noFix = true;
|
||||
}
|
||||
|
||||
if (!/^[-a-zA-Z0-9\\[\](){} \t\r\n\v\f!@#$%^&*+^_=/~`.><?,'"|:;]*$/u.test(regexContent)) {
|
||||
noFix = true;
|
||||
}
|
||||
|
||||
if (sourceCode.getCommentsInside(node).length > 0) {
|
||||
noFix = true;
|
||||
}
|
||||
|
||||
if (regexContent && !noFix) {
|
||||
let charIncrease = 0;
|
||||
|
||||
const ast = new RegExpParser({ ecmaVersion: regexppEcmaVersion }).parsePattern(regexContent, 0, regexContent.length, flags ? flags.includes("u") : false);
|
||||
|
||||
visitRegExpAST(ast, {
|
||||
onCharacterEnter(characterNode) {
|
||||
const escaped = resolveEscapes(characterNode.raw);
|
||||
|
||||
if (escaped) {
|
||||
regexContent =
|
||||
regexContent.slice(0, characterNode.start + charIncrease) +
|
||||
escaped +
|
||||
regexContent.slice(characterNode.end + charIncrease);
|
||||
|
||||
if (characterNode.raw.length === 1) {
|
||||
charIncrease += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const newRegExpValue = `/${regexContent || "(?:)"}/${flags || ""}`;
|
||||
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unexpectedRegExp",
|
||||
suggest: noFix ? [] : [{
|
||||
messageId: "replaceWithLiteral",
|
||||
fix(fixer) {
|
||||
const tokenAfter = sourceCode.getTokenAfter(node);
|
||||
|
||||
return fixer.replaceText(
|
||||
node,
|
||||
(tokenBefore && !canTokensBeAdjacent(tokenBefore, newRegExpValue) && tokenBefore.range[1] === node.range[0] ? " " : "") +
|
||||
newRegExpValue +
|
||||
(tokenAfter && !canTokensBeAdjacent(newRegExpValue, tokenAfter) && node.range[1] === tokenAfter.range[0] ? " " : "")
|
||||
);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
tools/node_modules/eslint/lib/rules/prefer-template.js
generated
vendored
2
tools/node_modules/eslint/lib/rules/prefer-template.js
generated
vendored
@ -188,7 +188,7 @@ module.exports = {
|
||||
return sourceCode.getText(currentNode);
|
||||
}
|
||||
|
||||
if (isConcatenation(currentNode) && hasStringLiteral(currentNode) && hasNonStringLiteral(currentNode)) {
|
||||
if (isConcatenation(currentNode) && hasStringLiteral(currentNode)) {
|
||||
const plusSign = sourceCode.getFirstTokenBetween(currentNode.left, currentNode.right, token => token.value === "+");
|
||||
const textBeforePlus = getTextBetween(currentNode.left, plusSign);
|
||||
const textAfterPlus = getTextBetween(plusSign, currentNode.right);
|
||||
|
2
tools/node_modules/eslint/node_modules/@babel/core/lib/index.js
generated
vendored
2
tools/node_modules/eslint/node_modules/@babel/core/lib/index.js
generated
vendored
@ -247,7 +247,7 @@ var _transformAst = require("./transform-ast");
|
||||
|
||||
var _parse = require("./parse");
|
||||
|
||||
const version = "7.16.0";
|
||||
const version = "7.16.5";
|
||||
exports.version = version;
|
||||
const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);
|
||||
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
|
||||
|
16
tools/node_modules/eslint/node_modules/@babel/core/package.json
generated
vendored
16
tools/node_modules/eslint/node_modules/@babel/core/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.16.0",
|
||||
"version": "7.16.5",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "./lib/index.js",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
@ -49,13 +49,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.16.0",
|
||||
"@babel/generator": "^7.16.0",
|
||||
"@babel/helper-compilation-targets": "^7.16.0",
|
||||
"@babel/helper-module-transforms": "^7.16.0",
|
||||
"@babel/helpers": "^7.16.0",
|
||||
"@babel/parser": "^7.16.0",
|
||||
"@babel/generator": "^7.16.5",
|
||||
"@babel/helper-compilation-targets": "^7.16.3",
|
||||
"@babel/helper-module-transforms": "^7.16.5",
|
||||
"@babel/helpers": "^7.16.5",
|
||||
"@babel/parser": "^7.16.5",
|
||||
"@babel/template": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.5",
|
||||
"@babel/types": "^7.16.0",
|
||||
"convert-source-map": "^1.7.0",
|
||||
"debug": "^4.1.0",
|
||||
@ -66,7 +66,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-transform-fixture-test-runner": "^7.16.0",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.16.0",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.16.5",
|
||||
"@types/convert-source-map": "^1.5.1",
|
||||
"@types/debug": "^4.1.0",
|
||||
"@types/resolve": "^1.3.2",
|
||||
|
6
tools/node_modules/eslint/node_modules/@babel/eslint-parser/lib/analyze-scope.cjs
generated
vendored
6
tools/node_modules/eslint/node_modules/@babel/eslint-parser/lib/analyze-scope.cjs
generated
vendored
@ -1,3 +1,7 @@
|
||||
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
||||
|
||||
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
||||
|
||||
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
||||
|
||||
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
||||
@ -103,7 +107,7 @@ class Referencer extends OriginalReferencer {
|
||||
constructor(options, scopeManager, client) {
|
||||
super(options, scopeManager);
|
||||
|
||||
_client.set(this, {
|
||||
_classPrivateFieldInitSpec(this, _client, {
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
|
18
tools/node_modules/eslint/node_modules/@babel/eslint-parser/lib/client.cjs
generated
vendored
18
tools/node_modules/eslint/node_modules/@babel/eslint-parser/lib/client.cjs
generated
vendored
@ -8,6 +8,10 @@ function _classCheckPrivateStaticFieldDescriptor(descriptor, action) { if (descr
|
||||
|
||||
function _classCheckPrivateStaticAccess(receiver, classConstructor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } }
|
||||
|
||||
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
||||
|
||||
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
||||
|
||||
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
||||
|
||||
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
||||
@ -41,27 +45,27 @@ var _tlCache = new WeakMap();
|
||||
|
||||
class Client {
|
||||
constructor(send) {
|
||||
_send.set(this, {
|
||||
_classPrivateFieldInitSpec(this, _send, {
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
|
||||
_vCache.set(this, {
|
||||
_classPrivateFieldInitSpec(this, _vCache, {
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
|
||||
_tiCache.set(this, {
|
||||
_classPrivateFieldInitSpec(this, _tiCache, {
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
|
||||
_vkCache.set(this, {
|
||||
_classPrivateFieldInitSpec(this, _vkCache, {
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
|
||||
_tlCache.set(this, {
|
||||
_classPrivateFieldInitSpec(this, _tlCache, {
|
||||
writable: true,
|
||||
value: void 0
|
||||
});
|
||||
@ -124,14 +128,14 @@ exports.WorkerClient = (_temp = (_worker = new WeakMap(), _signal = new WeakMap(
|
||||
if (message.error) throw Object.assign(message.error, message.errorData);else return message.result;
|
||||
});
|
||||
|
||||
_worker.set(this, {
|
||||
_classPrivateFieldInitSpec(this, _worker, {
|
||||
writable: true,
|
||||
value: new (_classStaticPrivateFieldSpecGet(WorkerClient, _class, _worker_threads).Worker)(path.resolve(__dirname, "../lib/worker/index.cjs"), {
|
||||
env: _classStaticPrivateFieldSpecGet(WorkerClient, _class, _worker_threads).SHARE_ENV
|
||||
})
|
||||
});
|
||||
|
||||
_signal.set(this, {
|
||||
_classPrivateFieldInitSpec(this, _signal, {
|
||||
writable: true,
|
||||
value: new Int32Array(new SharedArrayBuffer(4))
|
||||
});
|
||||
|
@ -68,13 +68,6 @@ function convertTemplateType(tokens, tl) {
|
||||
templateTokens.push(token);
|
||||
break;
|
||||
|
||||
case tl.eof:
|
||||
if (curlyBrace) {
|
||||
result.push(curlyBrace);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
if (curlyBrace) {
|
||||
result.push(curlyBrace);
|
||||
@ -142,6 +135,8 @@ function convertToken(token, source, tl) {
|
||||
token.value = `${token.value}n`;
|
||||
} else if (label === tl.privateName) {
|
||||
token.type = "PrivateIdentifier";
|
||||
} else if (label === tl.templateNonTail || label === tl.templateTail) {
|
||||
token.type = "Template";
|
||||
}
|
||||
|
||||
if (typeof token.type !== "string") {
|
||||
@ -151,15 +146,21 @@ function convertToken(token, source, tl) {
|
||||
|
||||
module.exports = function convertTokens(tokens, code, tl) {
|
||||
const result = [];
|
||||
const withoutComments = convertTemplateType(tokens, tl).filter(t => t.type !== "CommentLine" && t.type !== "CommentBlock");
|
||||
const templateTypeMergedTokens = convertTemplateType(tokens, tl);
|
||||
|
||||
for (let i = 0, {
|
||||
length
|
||||
} = withoutComments; i < length; i++) {
|
||||
const token = withoutComments[i];
|
||||
} = templateTypeMergedTokens; i < length - 1; i++) {
|
||||
const token = templateTypeMergedTokens[i];
|
||||
const tokenType = token.type;
|
||||
|
||||
if (tokenType === "CommentLine" || tokenType === "CommentBlock") {
|
||||
continue;
|
||||
}
|
||||
|
||||
{
|
||||
if (ESLINT_VERSION >= 8 && i + 1 < length && token.type.label === tl.hash) {
|
||||
const nextToken = withoutComments[i + 1];
|
||||
if (ESLINT_VERSION >= 8 && i + 1 < length && tokenType.label === tl.hash) {
|
||||
const nextToken = templateTypeMergedTokens[i + 1];
|
||||
|
||||
if (nextToken.type.label === tl.name && token.end === nextToken.start) {
|
||||
i++;
|
||||
|
2
tools/node_modules/eslint/node_modules/@babel/eslint-parser/lib/parse.cjs
generated
vendored
2
tools/node_modules/eslint/node_modules/@babel/eslint-parser/lib/parse.cjs
generated
vendored
@ -27,7 +27,7 @@ module.exports = function parse(code, options, client) {
|
||||
}
|
||||
|
||||
if (!isRunningMinSupportedCoreVersion) {
|
||||
throw new Error(`@babel/eslint-parser@${"7.16.3"} does not support @babel/core@${client.getVersion()}. Please upgrade to @babel/core@${minSupportedCoreVersion}.`);
|
||||
throw new Error(`@babel/eslint-parser@${"7.16.5"} does not support @babel/core@${client.getVersion()}. Please upgrade to @babel/core@${minSupportedCoreVersion}.`);
|
||||
}
|
||||
|
||||
const {
|
||||
|
4
tools/node_modules/eslint/node_modules/@babel/eslint-parser/package.json
generated
vendored
4
tools/node_modules/eslint/node_modules/@babel/eslint-parser/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/eslint-parser",
|
||||
"version": "7.16.3",
|
||||
"version": "7.16.5",
|
||||
"description": "ESLint parser that allows for linting of experimental syntax transformed by Babel",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
@ -36,7 +36,7 @@
|
||||
"semver": "^6.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.0",
|
||||
"@babel/core": "^7.16.5",
|
||||
"dedent": "^0.7.0",
|
||||
"eslint": "^7.27.0",
|
||||
"eslint-8": "npm:eslint@^8.0.0"
|
||||
|
2
tools/node_modules/eslint/node_modules/@babel/generator/lib/generators/flow.js
generated
vendored
2
tools/node_modules/eslint/node_modules/@babel/generator/lib/generators/flow.js
generated
vendored
@ -396,7 +396,7 @@ function FunctionTypeAnnotation(node, parent) {
|
||||
|
||||
this.token(")");
|
||||
|
||||
if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method) {
|
||||
if (parent && (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method)) {
|
||||
this.token(":");
|
||||
} else {
|
||||
this.space();
|
||||
|
6
tools/node_modules/eslint/node_modules/@babel/generator/package.json
generated
vendored
6
tools/node_modules/eslint/node_modules/@babel/generator/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/generator",
|
||||
"version": "7.16.0",
|
||||
"version": "7.16.5",
|
||||
"description": "Turns an AST into code.",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
@ -24,8 +24,8 @@
|
||||
"source-map": "^0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "^7.16.0",
|
||||
"@babel/parser": "^7.16.0",
|
||||
"@babel/helper-fixtures": "^7.16.5",
|
||||
"@babel/parser": "^7.16.5",
|
||||
"@types/jsesc": "^2.5.0",
|
||||
"@types/source-map": "^0.5.0",
|
||||
"charcodes": "^0.2.0"
|
||||
|
38
tools/node_modules/eslint/node_modules/@babel/helper-environment-visitor/lib/index.js
generated
vendored
Normal file
38
tools/node_modules/eslint/node_modules/@babel/helper-environment-visitor/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
exports.skipAllButComputedKey = skipAllButComputedKey;
|
||||
|
||||
var _t = require("@babel/types");
|
||||
|
||||
const {
|
||||
VISITOR_KEYS,
|
||||
staticBlock
|
||||
} = _t;
|
||||
|
||||
function skipAllButComputedKey(path) {
|
||||
if (!path.node.computed) {
|
||||
path.skip();
|
||||
return;
|
||||
}
|
||||
|
||||
const keys = VISITOR_KEYS[path.type];
|
||||
|
||||
for (const key of keys) {
|
||||
if (key !== "key") path.skipKey(key);
|
||||
}
|
||||
}
|
||||
|
||||
const skipKey = (staticBlock ? "StaticBlock|" : "") + "ClassPrivateProperty|TypeAnnotation|FunctionDeclaration|FunctionExpression";
|
||||
var _default = {
|
||||
[skipKey]: path => path.skip(),
|
||||
|
||||
"Method|ClassProperty"(path) {
|
||||
skipAllButComputedKey(path);
|
||||
}
|
||||
|
||||
};
|
||||
exports.default = _default;
|
29
tools/node_modules/eslint/node_modules/@babel/helper-environment-visitor/package.json
generated
vendored
Normal file
29
tools/node_modules/eslint/node_modules/@babel/helper-environment-visitor/package.json
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "@babel/helper-environment-visitor",
|
||||
"version": "7.16.5",
|
||||
"description": "Helper visitor to only visit nodes in the current 'this' context",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-environment-visitor"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helper-environment-visitor",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"exports": {
|
||||
".": "./lib/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/traverse": "^7.16.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)"
|
||||
}
|
@ -1,453 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var _t = require('@babel/types');
|
||||
|
||||
function _interopNamespace(e) {
|
||||
if (e && e.__esModule) return e;
|
||||
var n = Object.create(null);
|
||||
if (e) {
|
||||
Object.keys(e).forEach(function (k) {
|
||||
if (k !== 'default') {
|
||||
var d = Object.getOwnPropertyDescriptor(e, k);
|
||||
Object.defineProperty(n, k, d.get ? d : {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return e[k];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
n['default'] = e;
|
||||
return Object.freeze(n);
|
||||
}
|
||||
|
||||
var _t__namespace = /*#__PURE__*/_interopNamespace(_t);
|
||||
|
||||
function willPathCastToBoolean(path) {
|
||||
const maybeWrapped = path;
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = maybeWrapped;
|
||||
|
||||
if (parentPath.isLogicalExpression()) {
|
||||
const {
|
||||
operator,
|
||||
right
|
||||
} = parentPath.node;
|
||||
|
||||
if (operator === "&&" || operator === "||" || operator === "??" && node === right) {
|
||||
return willPathCastToBoolean(parentPath);
|
||||
}
|
||||
}
|
||||
|
||||
if (parentPath.isSequenceExpression()) {
|
||||
const {
|
||||
expressions
|
||||
} = parentPath.node;
|
||||
|
||||
if (expressions[expressions.length - 1] === node) {
|
||||
return willPathCastToBoolean(parentPath);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return parentPath.isConditional({
|
||||
test: node
|
||||
}) || parentPath.isUnaryExpression({
|
||||
operator: "!"
|
||||
}) || parentPath.isLoop({
|
||||
test: node
|
||||
});
|
||||
}
|
||||
|
||||
const {
|
||||
LOGICAL_OPERATORS,
|
||||
arrowFunctionExpression,
|
||||
assignmentExpression,
|
||||
binaryExpression,
|
||||
booleanLiteral,
|
||||
callExpression,
|
||||
cloneNode,
|
||||
conditionalExpression,
|
||||
identifier,
|
||||
isMemberExpression,
|
||||
isOptionalCallExpression,
|
||||
isOptionalMemberExpression,
|
||||
isUpdateExpression,
|
||||
logicalExpression,
|
||||
memberExpression,
|
||||
nullLiteral,
|
||||
numericLiteral,
|
||||
optionalCallExpression,
|
||||
optionalMemberExpression,
|
||||
sequenceExpression,
|
||||
unaryExpression
|
||||
} = _t__namespace;
|
||||
|
||||
class AssignmentMemoiser {
|
||||
constructor() {
|
||||
this._map = void 0;
|
||||
this._map = new WeakMap();
|
||||
}
|
||||
|
||||
has(key) {
|
||||
return this._map.has(key);
|
||||
}
|
||||
|
||||
get(key) {
|
||||
if (!this.has(key)) return;
|
||||
|
||||
const record = this._map.get(key);
|
||||
|
||||
const {
|
||||
value
|
||||
} = record;
|
||||
record.count--;
|
||||
|
||||
if (record.count === 0) {
|
||||
return assignmentExpression("=", value, key);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
set(key, value, count) {
|
||||
return this._map.set(key, {
|
||||
count,
|
||||
value
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function toNonOptional(path, base) {
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
|
||||
if (isOptionalMemberExpression(node)) {
|
||||
return memberExpression(base, node.property, node.computed);
|
||||
}
|
||||
|
||||
if (path.isOptionalCallExpression()) {
|
||||
const callee = path.get("callee");
|
||||
|
||||
if (path.node.optional && callee.isOptionalMemberExpression()) {
|
||||
const {
|
||||
object
|
||||
} = callee.node;
|
||||
const context = path.scope.maybeGenerateMemoised(object) || object;
|
||||
callee.get("object").replaceWith(assignmentExpression("=", context, object));
|
||||
return callExpression(memberExpression(base, identifier("call")), [context, ...path.node.arguments]);
|
||||
}
|
||||
|
||||
return callExpression(base, path.node.arguments);
|
||||
}
|
||||
|
||||
return path.node;
|
||||
}
|
||||
|
||||
function isInDetachedTree(path) {
|
||||
while (path) {
|
||||
if (path.isProgram()) break;
|
||||
const {
|
||||
parentPath,
|
||||
container,
|
||||
listKey
|
||||
} = path;
|
||||
const parentNode = parentPath.node;
|
||||
|
||||
if (listKey) {
|
||||
if (container !== parentNode[listKey]) return true;
|
||||
} else {
|
||||
if (container !== parentNode) return true;
|
||||
}
|
||||
|
||||
path = parentPath;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const handle = {
|
||||
memoise() {},
|
||||
|
||||
handle(member, noDocumentAll) {
|
||||
const {
|
||||
node,
|
||||
parent,
|
||||
parentPath,
|
||||
scope
|
||||
} = member;
|
||||
|
||||
if (member.isOptionalMemberExpression()) {
|
||||
if (isInDetachedTree(member)) return;
|
||||
const endPath = member.find(({
|
||||
node,
|
||||
parent
|
||||
}) => {
|
||||
if (isOptionalMemberExpression(parent)) {
|
||||
return parent.optional || parent.object !== node;
|
||||
}
|
||||
|
||||
if (isOptionalCallExpression(parent)) {
|
||||
return node !== member.node && parent.optional || parent.callee !== node;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (scope.path.isPattern()) {
|
||||
endPath.replaceWith(callExpression(arrowFunctionExpression([], endPath.node), []));
|
||||
return;
|
||||
}
|
||||
|
||||
const willEndPathCastToBoolean = willPathCastToBoolean(endPath);
|
||||
const rootParentPath = endPath.parentPath;
|
||||
|
||||
if (rootParentPath.isUpdateExpression({
|
||||
argument: node
|
||||
}) || rootParentPath.isAssignmentExpression({
|
||||
left: node
|
||||
})) {
|
||||
throw member.buildCodeFrameError(`can't handle assignment`);
|
||||
}
|
||||
|
||||
const isDeleteOperation = rootParentPath.isUnaryExpression({
|
||||
operator: "delete"
|
||||
});
|
||||
|
||||
if (isDeleteOperation && endPath.isOptionalMemberExpression() && endPath.get("property").isPrivateName()) {
|
||||
throw member.buildCodeFrameError(`can't delete a private class element`);
|
||||
}
|
||||
|
||||
let startingOptional = member;
|
||||
|
||||
for (;;) {
|
||||
if (startingOptional.isOptionalMemberExpression()) {
|
||||
if (startingOptional.node.optional) break;
|
||||
startingOptional = startingOptional.get("object");
|
||||
continue;
|
||||
} else if (startingOptional.isOptionalCallExpression()) {
|
||||
if (startingOptional.node.optional) break;
|
||||
startingOptional = startingOptional.get("callee");
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new Error(`Internal error: unexpected ${startingOptional.node.type}`);
|
||||
}
|
||||
|
||||
const startingProp = startingOptional.isOptionalMemberExpression() ? "object" : "callee";
|
||||
const startingNode = startingOptional.node[startingProp];
|
||||
const baseNeedsMemoised = scope.maybeGenerateMemoised(startingNode);
|
||||
const baseRef = baseNeedsMemoised != null ? baseNeedsMemoised : startingNode;
|
||||
const parentIsOptionalCall = parentPath.isOptionalCallExpression({
|
||||
callee: node
|
||||
});
|
||||
|
||||
const isOptionalCall = parent => parentIsOptionalCall;
|
||||
|
||||
const parentIsCall = parentPath.isCallExpression({
|
||||
callee: node
|
||||
});
|
||||
startingOptional.replaceWith(toNonOptional(startingOptional, baseRef));
|
||||
|
||||
if (isOptionalCall()) {
|
||||
if (parent.optional) {
|
||||
parentPath.replaceWith(this.optionalCall(member, parent.arguments));
|
||||
} else {
|
||||
parentPath.replaceWith(this.call(member, parent.arguments));
|
||||
}
|
||||
} else if (parentIsCall) {
|
||||
member.replaceWith(this.boundGet(member));
|
||||
} else {
|
||||
member.replaceWith(this.get(member));
|
||||
}
|
||||
|
||||
let regular = member.node;
|
||||
|
||||
for (let current = member; current !== endPath;) {
|
||||
const parentPath = current.parentPath;
|
||||
|
||||
if (parentPath === endPath && isOptionalCall() && parent.optional) {
|
||||
regular = parentPath.node;
|
||||
break;
|
||||
}
|
||||
|
||||
regular = toNonOptional(parentPath, regular);
|
||||
current = parentPath;
|
||||
}
|
||||
|
||||
let context;
|
||||
const endParentPath = endPath.parentPath;
|
||||
|
||||
if (isMemberExpression(regular) && endParentPath.isOptionalCallExpression({
|
||||
callee: endPath.node,
|
||||
optional: true
|
||||
})) {
|
||||
const {
|
||||
object
|
||||
} = regular;
|
||||
context = member.scope.maybeGenerateMemoised(object);
|
||||
|
||||
if (context) {
|
||||
regular.object = assignmentExpression("=", context, object);
|
||||
}
|
||||
}
|
||||
|
||||
let replacementPath = endPath;
|
||||
|
||||
if (isDeleteOperation) {
|
||||
replacementPath = endParentPath;
|
||||
regular = endParentPath.node;
|
||||
}
|
||||
|
||||
const baseMemoised = baseNeedsMemoised ? assignmentExpression("=", cloneNode(baseRef), cloneNode(startingNode)) : cloneNode(baseRef);
|
||||
|
||||
if (willEndPathCastToBoolean) {
|
||||
let nonNullishCheck;
|
||||
|
||||
if (noDocumentAll) {
|
||||
nonNullishCheck = binaryExpression("!=", baseMemoised, nullLiteral());
|
||||
} else {
|
||||
nonNullishCheck = logicalExpression("&&", binaryExpression("!==", baseMemoised, nullLiteral()), binaryExpression("!==", cloneNode(baseRef), scope.buildUndefinedNode()));
|
||||
}
|
||||
|
||||
replacementPath.replaceWith(logicalExpression("&&", nonNullishCheck, regular));
|
||||
} else {
|
||||
let nullishCheck;
|
||||
|
||||
if (noDocumentAll) {
|
||||
nullishCheck = binaryExpression("==", baseMemoised, nullLiteral());
|
||||
} else {
|
||||
nullishCheck = logicalExpression("||", binaryExpression("===", baseMemoised, nullLiteral()), binaryExpression("===", cloneNode(baseRef), scope.buildUndefinedNode()));
|
||||
}
|
||||
|
||||
replacementPath.replaceWith(conditionalExpression(nullishCheck, isDeleteOperation ? booleanLiteral(true) : scope.buildUndefinedNode(), regular));
|
||||
}
|
||||
|
||||
if (context) {
|
||||
const endParent = endParentPath.node;
|
||||
endParentPath.replaceWith(optionalCallExpression(optionalMemberExpression(endParent.callee, identifier("call"), false, true), [cloneNode(context), ...endParent.arguments], false));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (isUpdateExpression(parent, {
|
||||
argument: node
|
||||
})) {
|
||||
if (this.simpleSet) {
|
||||
member.replaceWith(this.simpleSet(member));
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
operator,
|
||||
prefix
|
||||
} = parent;
|
||||
this.memoise(member, 2);
|
||||
const value = binaryExpression(operator[0], unaryExpression("+", this.get(member)), numericLiteral(1));
|
||||
|
||||
if (prefix) {
|
||||
parentPath.replaceWith(this.set(member, value));
|
||||
} else {
|
||||
const {
|
||||
scope
|
||||
} = member;
|
||||
const ref = scope.generateUidIdentifierBasedOnNode(node);
|
||||
scope.push({
|
||||
id: ref
|
||||
});
|
||||
value.left = assignmentExpression("=", cloneNode(ref), value.left);
|
||||
parentPath.replaceWith(sequenceExpression([this.set(member, value), cloneNode(ref)]));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isAssignmentExpression({
|
||||
left: node
|
||||
})) {
|
||||
if (this.simpleSet) {
|
||||
member.replaceWith(this.simpleSet(member));
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
operator,
|
||||
right: value
|
||||
} = parentPath.node;
|
||||
|
||||
if (operator === "=") {
|
||||
parentPath.replaceWith(this.set(member, value));
|
||||
} else {
|
||||
const operatorTrunc = operator.slice(0, -1);
|
||||
|
||||
if (LOGICAL_OPERATORS.includes(operatorTrunc)) {
|
||||
this.memoise(member, 1);
|
||||
parentPath.replaceWith(logicalExpression(operatorTrunc, this.get(member), this.set(member, value)));
|
||||
} else {
|
||||
this.memoise(member, 2);
|
||||
parentPath.replaceWith(this.set(member, binaryExpression(operatorTrunc, this.get(member), value)));
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
parentPath.replaceWith(this.call(member, parentPath.node.arguments));
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isOptionalCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
if (scope.path.isPattern()) {
|
||||
parentPath.replaceWith(callExpression(arrowFunctionExpression([], parentPath.node), []));
|
||||
return;
|
||||
}
|
||||
|
||||
parentPath.replaceWith(this.optionalCall(member, parentPath.node.arguments));
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isForXStatement({
|
||||
left: node
|
||||
}) || parentPath.isObjectProperty({
|
||||
value: node
|
||||
}) && parentPath.parentPath.isObjectPattern() || parentPath.isAssignmentPattern({
|
||||
left: node
|
||||
}) && parentPath.parentPath.isObjectProperty({
|
||||
value: parent
|
||||
}) && parentPath.parentPath.parentPath.isObjectPattern() || parentPath.isArrayPattern() || parentPath.isAssignmentPattern({
|
||||
left: node
|
||||
}) && parentPath.parentPath.isArrayPattern() || parentPath.isRestElement()) {
|
||||
member.replaceWith(this.destructureSet(member));
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isTaggedTemplateExpression()) {
|
||||
member.replaceWith(this.boundGet(member));
|
||||
} else {
|
||||
member.replaceWith(this.get(member));
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
function memberExpressionToFunctions(path, visitor, state) {
|
||||
path.traverse(visitor, Object.assign({}, handle, state, {
|
||||
memoiser: new AssignmentMemoiser()
|
||||
}));
|
||||
}
|
||||
|
||||
exports.default = memberExpressionToFunctions;
|
||||
//# sourceMappingURL=index.js.map
|
@ -1,26 +0,0 @@
|
||||
{
|
||||
"name": "@babel/helper-member-expression-to-functions",
|
||||
"version": "7.16.0",
|
||||
"description": "Helper function to replace certain member expressions with function calls",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-member-expression-to-functions"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helper-member-expression-to-functions",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/traverse": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.default = rewriteThis;
|
||||
|
||||
var _helperReplaceSupers = require("@babel/helper-replace-supers");
|
||||
var _helperEnvironmentVisitor = require("@babel/helper-environment-visitor");
|
||||
|
||||
var _traverse = require("@babel/traverse");
|
||||
|
||||
@ -22,7 +22,7 @@ function rewriteThis(programPath) {
|
||||
}));
|
||||
}
|
||||
|
||||
const rewriteThisVisitor = _traverse.default.visitors.merge([_helperReplaceSupers.environmentVisitor, {
|
||||
const rewriteThisVisitor = _traverse.default.visitors.merge([_helperEnvironmentVisitor.default, {
|
||||
ThisExpression(path) {
|
||||
path.replaceWith(unaryExpression("void", numericLiteral(0), true));
|
||||
}
|
||||
|
6
tools/node_modules/eslint/node_modules/@babel/helper-module-transforms/package.json
generated
vendored
6
tools/node_modules/eslint/node_modules/@babel/helper-module-transforms/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-module-transforms",
|
||||
"version": "7.16.0",
|
||||
"version": "7.16.5",
|
||||
"description": "Babel helper functions for implementing ES6 module transformations",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helper-module-transforms",
|
||||
@ -15,13 +15,13 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-environment-visitor": "^7.16.5",
|
||||
"@babel/helper-module-imports": "^7.16.0",
|
||||
"@babel/helper-replace-supers": "^7.16.0",
|
||||
"@babel/helper-simple-access": "^7.16.0",
|
||||
"@babel/helper-split-export-declaration": "^7.16.0",
|
||||
"@babel/helper-validator-identifier": "^7.15.7",
|
||||
"@babel/template": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.5",
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
|
22
tools/node_modules/eslint/node_modules/@babel/helper-optimise-call-expression/LICENSE
generated
vendored
22
tools/node_modules/eslint/node_modules/@babel/helper-optimise-call-expression/LICENSE
generated
vendored
@ -1,22 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = optimiseCallExpression;
|
||||
|
||||
var _t = require("@babel/types");
|
||||
|
||||
const {
|
||||
callExpression,
|
||||
identifier,
|
||||
isIdentifier,
|
||||
isSpreadElement,
|
||||
memberExpression,
|
||||
optionalCallExpression,
|
||||
optionalMemberExpression
|
||||
} = _t;
|
||||
|
||||
function optimiseCallExpression(callee, thisNode, args, optional) {
|
||||
if (args.length === 1 && isSpreadElement(args[0]) && isIdentifier(args[0].argument, {
|
||||
name: "arguments"
|
||||
})) {
|
||||
if (optional) {
|
||||
return optionalCallExpression(optionalMemberExpression(callee, identifier("apply"), false, true), [thisNode, args[0].argument], false);
|
||||
}
|
||||
|
||||
return callExpression(memberExpression(callee, identifier("apply")), [thisNode, args[0].argument]);
|
||||
} else {
|
||||
if (optional) {
|
||||
return optionalCallExpression(optionalMemberExpression(callee, identifier("call"), false, true), [thisNode, ...args], false);
|
||||
}
|
||||
|
||||
return callExpression(memberExpression(callee, identifier("call")), [thisNode, ...args]);
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"name": "@babel/helper-optimise-call-expression",
|
||||
"version": "7.16.0",
|
||||
"description": "Helper function to optimise call expression",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-optimise-call-expression"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helper-optimise-call-expression",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/generator": "^7.16.0",
|
||||
"@babel/parser": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)"
|
||||
}
|
2
tools/node_modules/eslint/node_modules/@babel/helper-plugin-utils/package.json
generated
vendored
2
tools/node_modules/eslint/node_modules/@babel/helper-plugin-utils/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-plugin-utils",
|
||||
"version": "7.14.5",
|
||||
"version": "7.16.5",
|
||||
"description": "General utilities for plugins to use",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helper-plugin-utils",
|
||||
|
22
tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/LICENSE
generated
vendored
22
tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/LICENSE
generated
vendored
@ -1,22 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
293
tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/lib/index.js
generated
vendored
293
tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/lib/index.js
generated
vendored
@ -1,293 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.environmentVisitor = exports.default = void 0;
|
||||
exports.skipAllButComputedKey = skipAllButComputedKey;
|
||||
|
||||
var _traverse = require("@babel/traverse");
|
||||
|
||||
var _helperMemberExpressionToFunctions = require("@babel/helper-member-expression-to-functions");
|
||||
|
||||
var _helperOptimiseCallExpression = require("@babel/helper-optimise-call-expression");
|
||||
|
||||
var _t = require("@babel/types");
|
||||
|
||||
const {
|
||||
VISITOR_KEYS,
|
||||
assignmentExpression,
|
||||
booleanLiteral,
|
||||
callExpression,
|
||||
cloneNode,
|
||||
identifier,
|
||||
memberExpression,
|
||||
sequenceExpression,
|
||||
staticBlock,
|
||||
stringLiteral,
|
||||
thisExpression
|
||||
} = _t;
|
||||
|
||||
function getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) {
|
||||
objectRef = cloneNode(objectRef);
|
||||
const targetRef = isStatic || isPrivateMethod ? objectRef : memberExpression(objectRef, identifier("prototype"));
|
||||
return callExpression(file.addHelper("getPrototypeOf"), [targetRef]);
|
||||
}
|
||||
|
||||
function skipAllButComputedKey(path) {
|
||||
if (!path.node.computed) {
|
||||
path.skip();
|
||||
return;
|
||||
}
|
||||
|
||||
const keys = VISITOR_KEYS[path.type];
|
||||
|
||||
for (const key of keys) {
|
||||
if (key !== "key") path.skipKey(key);
|
||||
}
|
||||
}
|
||||
|
||||
const environmentVisitor = {
|
||||
[`${staticBlock ? "StaticBlock|" : ""}ClassPrivateProperty|TypeAnnotation`](path) {
|
||||
path.skip();
|
||||
},
|
||||
|
||||
Function(path) {
|
||||
if (path.isMethod()) return;
|
||||
if (path.isArrowFunctionExpression()) return;
|
||||
path.skip();
|
||||
},
|
||||
|
||||
"Method|ClassProperty"(path) {
|
||||
skipAllButComputedKey(path);
|
||||
}
|
||||
|
||||
};
|
||||
exports.environmentVisitor = environmentVisitor;
|
||||
|
||||
const visitor = _traverse.default.visitors.merge([environmentVisitor, {
|
||||
Super(path, state) {
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
if (!parentPath.isMemberExpression({
|
||||
object: node
|
||||
})) return;
|
||||
state.handle(parentPath);
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
const unshadowSuperBindingVisitor = _traverse.default.visitors.merge([environmentVisitor, {
|
||||
Scopable(path, {
|
||||
refName
|
||||
}) {
|
||||
const binding = path.scope.getOwnBinding(refName);
|
||||
|
||||
if (binding && binding.identifier.name === refName) {
|
||||
path.scope.rename(refName);
|
||||
}
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
const specHandlers = {
|
||||
memoise(superMember, count) {
|
||||
const {
|
||||
scope,
|
||||
node
|
||||
} = superMember;
|
||||
const {
|
||||
computed,
|
||||
property
|
||||
} = node;
|
||||
|
||||
if (!computed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const memo = scope.maybeGenerateMemoised(property);
|
||||
|
||||
if (!memo) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.memoiser.set(property, memo, count);
|
||||
},
|
||||
|
||||
prop(superMember) {
|
||||
const {
|
||||
computed,
|
||||
property
|
||||
} = superMember.node;
|
||||
|
||||
if (this.memoiser.has(property)) {
|
||||
return cloneNode(this.memoiser.get(property));
|
||||
}
|
||||
|
||||
if (computed) {
|
||||
return cloneNode(property);
|
||||
}
|
||||
|
||||
return stringLiteral(property.name);
|
||||
},
|
||||
|
||||
get(superMember) {
|
||||
return this._get(superMember, this._getThisRefs());
|
||||
},
|
||||
|
||||
_get(superMember, thisRefs) {
|
||||
const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod);
|
||||
return callExpression(this.file.addHelper("get"), [thisRefs.memo ? sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), thisRefs.this]);
|
||||
},
|
||||
|
||||
_getThisRefs() {
|
||||
if (!this.isDerivedConstructor) {
|
||||
return {
|
||||
this: thisExpression()
|
||||
};
|
||||
}
|
||||
|
||||
const thisRef = this.scope.generateDeclaredUidIdentifier("thisSuper");
|
||||
return {
|
||||
memo: assignmentExpression("=", thisRef, thisExpression()),
|
||||
this: cloneNode(thisRef)
|
||||
};
|
||||
},
|
||||
|
||||
set(superMember, value) {
|
||||
const thisRefs = this._getThisRefs();
|
||||
|
||||
const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod);
|
||||
return callExpression(this.file.addHelper("set"), [thisRefs.memo ? sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), value, thisRefs.this, booleanLiteral(superMember.isInStrictMode())]);
|
||||
},
|
||||
|
||||
destructureSet(superMember) {
|
||||
throw superMember.buildCodeFrameError(`Destructuring to a super field is not supported yet.`);
|
||||
},
|
||||
|
||||
call(superMember, args) {
|
||||
const thisRefs = this._getThisRefs();
|
||||
|
||||
return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), cloneNode(thisRefs.this), args, false);
|
||||
},
|
||||
|
||||
optionalCall(superMember, args) {
|
||||
const thisRefs = this._getThisRefs();
|
||||
|
||||
return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), cloneNode(thisRefs.this), args, true);
|
||||
}
|
||||
|
||||
};
|
||||
const looseHandlers = Object.assign({}, specHandlers, {
|
||||
prop(superMember) {
|
||||
const {
|
||||
property
|
||||
} = superMember.node;
|
||||
|
||||
if (this.memoiser.has(property)) {
|
||||
return cloneNode(this.memoiser.get(property));
|
||||
}
|
||||
|
||||
return cloneNode(property);
|
||||
},
|
||||
|
||||
get(superMember) {
|
||||
const {
|
||||
isStatic,
|
||||
getSuperRef
|
||||
} = this;
|
||||
const {
|
||||
computed
|
||||
} = superMember.node;
|
||||
const prop = this.prop(superMember);
|
||||
let object;
|
||||
|
||||
if (isStatic) {
|
||||
var _getSuperRef;
|
||||
|
||||
object = (_getSuperRef = getSuperRef()) != null ? _getSuperRef : memberExpression(identifier("Function"), identifier("prototype"));
|
||||
} else {
|
||||
var _getSuperRef2;
|
||||
|
||||
object = memberExpression((_getSuperRef2 = getSuperRef()) != null ? _getSuperRef2 : identifier("Object"), identifier("prototype"));
|
||||
}
|
||||
|
||||
return memberExpression(object, prop, computed);
|
||||
},
|
||||
|
||||
set(superMember, value) {
|
||||
const {
|
||||
computed
|
||||
} = superMember.node;
|
||||
const prop = this.prop(superMember);
|
||||
return assignmentExpression("=", memberExpression(thisExpression(), prop, computed), value);
|
||||
},
|
||||
|
||||
destructureSet(superMember) {
|
||||
const {
|
||||
computed
|
||||
} = superMember.node;
|
||||
const prop = this.prop(superMember);
|
||||
return memberExpression(thisExpression(), prop, computed);
|
||||
},
|
||||
|
||||
call(superMember, args) {
|
||||
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), thisExpression(), args, false);
|
||||
},
|
||||
|
||||
optionalCall(superMember, args) {
|
||||
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), thisExpression(), args, true);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
class ReplaceSupers {
|
||||
constructor(opts) {
|
||||
var _opts$constantSuper;
|
||||
|
||||
const path = opts.methodPath;
|
||||
this.methodPath = path;
|
||||
this.isDerivedConstructor = path.isClassMethod({
|
||||
kind: "constructor"
|
||||
}) && !!opts.superRef;
|
||||
this.isStatic = path.isObjectMethod() || path.node.static || (path.isStaticBlock == null ? void 0 : path.isStaticBlock());
|
||||
this.isPrivateMethod = path.isPrivate() && path.isMethod();
|
||||
this.file = opts.file;
|
||||
this.constantSuper = (_opts$constantSuper = opts.constantSuper) != null ? _opts$constantSuper : opts.isLoose;
|
||||
this.opts = opts;
|
||||
}
|
||||
|
||||
getObjectRef() {
|
||||
return cloneNode(this.opts.objectRef || this.opts.getObjectRef());
|
||||
}
|
||||
|
||||
getSuperRef() {
|
||||
if (this.opts.superRef) return cloneNode(this.opts.superRef);
|
||||
if (this.opts.getSuperRef) return cloneNode(this.opts.getSuperRef());
|
||||
}
|
||||
|
||||
replace() {
|
||||
if (this.opts.refToPreserve) {
|
||||
this.methodPath.traverse(unshadowSuperBindingVisitor, {
|
||||
refName: this.opts.refToPreserve.name
|
||||
});
|
||||
}
|
||||
|
||||
const handler = this.constantSuper ? looseHandlers : specHandlers;
|
||||
(0, _helperMemberExpressionToFunctions.default)(this.methodPath, visitor, Object.assign({
|
||||
file: this.file,
|
||||
scope: this.methodPath.scope,
|
||||
isDerivedConstructor: this.isDerivedConstructor,
|
||||
isStatic: this.isStatic,
|
||||
isPrivateMethod: this.isPrivateMethod,
|
||||
getObjectRef: this.getObjectRef.bind(this),
|
||||
getSuperRef: this.getSuperRef.bind(this),
|
||||
boundGet: handler.get
|
||||
}, handler));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = ReplaceSupers;
|
26
tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/package.json
generated
vendored
26
tools/node_modules/eslint/node_modules/@babel/helper-replace-supers/package.json
generated
vendored
@ -1,26 +0,0 @@
|
||||
{
|
||||
"name": "@babel/helper-replace-supers",
|
||||
"version": "7.16.0",
|
||||
"description": "Helper function to replace supers",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-replace-supers"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helper-replace-supers",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-member-expression-to-functions": "^7.16.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.0",
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)"
|
||||
}
|
43
tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers-generated.js
generated
vendored
43
tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers-generated.js
generated
vendored
@ -3,32 +3,23 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.wrapRegExp = exports.typeof = exports.objectSpread2 = exports.jsx = exports.asyncIterator = void 0;
|
||||
exports.default = void 0;
|
||||
|
||||
var _template = require("@babel/template");
|
||||
|
||||
const asyncIterator = {
|
||||
minVersion: "7.15.9",
|
||||
ast: () => _template.default.program.ast('\nexport default function _asyncIterator(iterable) {\n var method,\n async,\n sync,\n retry = 2;\n if (typeof Symbol !== "undefined") {\n async = Symbol.asyncIterator;\n sync = Symbol.iterator;\n }\n while (retry--) {\n if (async && (method = iterable[async]) != null) {\n return method.call(iterable);\n }\n if (sync && (method = iterable[sync]) != null) {\n return new AsyncFromSyncIterator(method.call(iterable));\n }\n async = "@@asyncIterator";\n sync = "@@iterator";\n }\n throw new TypeError("Object is not async iterable");\n}\nfunction AsyncFromSyncIterator(s) {\n AsyncFromSyncIterator = function (s) {\n this.s = s;\n this.n = s.next;\n };\n AsyncFromSyncIterator.prototype = {\n s: null,\n n: null,\n next: function () {\n return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));\n },\n return: function (value) {\n var ret = this.s.return;\n if (ret === undefined) {\n return Promise.resolve({ value: value, done: true });\n }\n return AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));\n },\n throw: function (value) {\n var thr = this.s.return;\n if (thr === undefined) return Promise.reject(value);\n return AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));\n },\n };\n function AsyncFromSyncIteratorContinuation(r) {\n \n if (Object(r) !== r) {\n return Promise.reject(new TypeError(r + " is not an object."));\n }\n var done = r.done;\n return Promise.resolve(r.value).then(function (value) {\n return { value: value, done: done };\n });\n }\n return new AsyncFromSyncIterator(s);\n}\n')
|
||||
};
|
||||
exports.asyncIterator = asyncIterator;
|
||||
const jsx = {
|
||||
minVersion: "7.0.0-beta.0",
|
||||
ast: () => _template.default.program.ast('\nvar REACT_ELEMENT_TYPE;\nexport default function _createRawReactElement(type, props, key, children) {\n if (!REACT_ELEMENT_TYPE) {\n REACT_ELEMENT_TYPE =\n (typeof Symbol === "function" &&\n \n Symbol["for"] &&\n Symbol["for"]("react.element")) ||\n 0xeac7;\n }\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n if (!props && childrenLength !== 0) {\n \n \n props = { children: void 0 };\n }\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = new Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : "" + key,\n ref: null,\n props: props,\n _owner: null,\n };\n}\n')
|
||||
};
|
||||
exports.jsx = jsx;
|
||||
const objectSpread2 = {
|
||||
minVersion: "7.5.0",
|
||||
ast: () => _template.default.program.ast('\nimport defineProperty from "defineProperty";\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(\n target,\n key,\n Object.getOwnPropertyDescriptor(source, key)\n );\n });\n }\n }\n return target;\n}\n')
|
||||
};
|
||||
exports.objectSpread2 = objectSpread2;
|
||||
const _typeof = {
|
||||
minVersion: "7.0.0-beta.0",
|
||||
ast: () => _template.default.program.ast('\nexport default function _typeof(obj) {\n "@babel/helpers - typeof";\n if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj &&\n typeof Symbol === "function" &&\n obj.constructor === Symbol &&\n obj !== Symbol.prototype\n ? "symbol"\n : typeof obj;\n };\n }\n return _typeof(obj);\n}\n')
|
||||
};
|
||||
exports.typeof = _typeof;
|
||||
const wrapRegExp = {
|
||||
minVersion: "7.2.6",
|
||||
ast: () => _template.default.program.ast('\nimport setPrototypeOf from "setPrototypeOf";\nimport inherits from "inherits";\nexport default function _wrapRegExp() {\n _wrapRegExp = function (re, groups) {\n return new BabelRegExp(re, undefined, groups);\n };\n var _super = RegExp.prototype;\n var _groups = new WeakMap();\n function BabelRegExp(re, flags, groups) {\n var _this = new RegExp(re, flags);\n \n _groups.set(_this, groups || _groups.get(re));\n return setPrototypeOf(_this, BabelRegExp.prototype);\n }\n inherits(BabelRegExp, RegExp);\n BabelRegExp.prototype.exec = function (str) {\n var result = _super.exec.call(this, str);\n if (result) result.groups = buildGroups(result, this);\n return result;\n };\n BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {\n if (typeof substitution === "string") {\n var groups = _groups.get(this);\n return _super[Symbol.replace].call(\n this,\n str,\n substitution.replace(/\\$<([^>]+)>/g, function (_, name) {\n return "$" + groups[name];\n })\n );\n } else if (typeof substitution === "function") {\n var _this = this;\n return _super[Symbol.replace].call(this, str, function () {\n var args = arguments;\n \n if (typeof args[args.length - 1] !== "object") {\n args = [].slice.call(args);\n args.push(buildGroups(args, _this));\n }\n return substitution.apply(this, args);\n });\n } else {\n return _super[Symbol.replace].call(this, str, substitution);\n }\n };\n function buildGroups(result, re) {\n \n \n var g = _groups.get(re);\n return Object.keys(g).reduce(function (groups, name) {\n groups[name] = result[g[name]];\n return groups;\n }, Object.create(null));\n }\n return _wrapRegExp.apply(this, arguments);\n}\n')
|
||||
};
|
||||
exports.wrapRegExp = wrapRegExp;
|
||||
function helper(minVersion, source) {
|
||||
return Object.freeze({
|
||||
minVersion,
|
||||
ast: () => _template.default.program.ast(source)
|
||||
});
|
||||
}
|
||||
|
||||
var _default = Object.freeze({
|
||||
asyncIterator: helper("7.15.9", 'export default function _asyncIterator(iterable){var method,async,sync,retry=2;for("undefined"!=typeof Symbol&&(async=Symbol.asyncIterator,sync=Symbol.iterator);retry--;){if(async&&null!=(method=iterable[async]))return method.call(iterable);if(sync&&null!=(method=iterable[sync]))return new AsyncFromSyncIterator(method.call(iterable));async="@@asyncIterator",sync="@@iterator"}throw new TypeError("Object is not async iterable")}function AsyncFromSyncIterator(s){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var done=r.done;return Promise.resolve(r.value).then((function(value){return{value:value,done:done}}))}return AsyncFromSyncIterator=function(s){this.s=s,this.n=s.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},return:function(value){var ret=this.s.return;return void 0===ret?Promise.resolve({value:value,done:!0}):AsyncFromSyncIteratorContinuation(ret.apply(this.s,arguments))},throw:function(value){var thr=this.s.return;return void 0===thr?Promise.reject(value):AsyncFromSyncIteratorContinuation(thr.apply(this.s,arguments))}},new AsyncFromSyncIterator(s)}'),
|
||||
jsx: helper("7.0.0-beta.0", 'var REACT_ELEMENT_TYPE;export default function _createRawReactElement(type,props,key,children){REACT_ELEMENT_TYPE||(REACT_ELEMENT_TYPE="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var defaultProps=type&&type.defaultProps,childrenLength=arguments.length-3;if(props||0===childrenLength||(props={children:void 0}),1===childrenLength)props.children=children;else if(childrenLength>1){for(var childArray=new Array(childrenLength),i=0;i<childrenLength;i++)childArray[i]=arguments[i+3];props.children=childArray}if(props&&defaultProps)for(var propName in defaultProps)void 0===props[propName]&&(props[propName]=defaultProps[propName]);else props||(props=defaultProps||{});return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:void 0===key?null:""+key,ref:null,props:props,_owner:null}}'),
|
||||
objectSpread2: helper("7.5.0", 'import defineProperty from"defineProperty";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}export default function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach((function(key){defineProperty(target,key,source[key])})):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}return target}'),
|
||||
typeof: helper("7.0.0-beta.0", 'export default function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}'),
|
||||
wrapRegExp: helper("7.2.6", 'import setPrototypeOf from"setPrototypeOf";import inherits from"inherits";export default function _wrapRegExp(){_wrapRegExp=function(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!=typeof args[args.length-1]&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},_wrapRegExp.apply(this,arguments)}')
|
||||
});
|
||||
|
||||
exports.default = _default;
|
20
tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers.js
generated
vendored
20
tools/node_modules/eslint/node_modules/@babel/helpers/lib/helpers.js
generated
vendored
@ -7,11 +7,11 @@ exports.default = void 0;
|
||||
|
||||
var _template = require("@babel/template");
|
||||
|
||||
var generated = require("./helpers-generated");
|
||||
var _helpersGenerated = require("./helpers-generated");
|
||||
|
||||
const helpers = Object.assign({
|
||||
__proto__: null
|
||||
}, generated);
|
||||
}, _helpersGenerated.default);
|
||||
var _default = helpers;
|
||||
exports.default = _default;
|
||||
|
||||
@ -220,6 +220,7 @@ helpers.createClass = helper("7.0.0-beta.0")`
|
||||
export default function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", { writable: false });
|
||||
return Constructor;
|
||||
}
|
||||
`;
|
||||
@ -324,12 +325,15 @@ helpers.inherits = helper("7.0.0-beta.0")`
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
}
|
||||
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
||||
constructor: {
|
||||
value: subClass,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
Object.defineProperty(subClass, "prototype", {
|
||||
value: Object.create(superClass && superClass.prototype, {
|
||||
constructor: {
|
||||
value: subClass,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
}),
|
||||
writable: false,
|
||||
});
|
||||
if (superClass) setPrototypeOf(subClass, superClass);
|
||||
}
|
||||
|
7
tools/node_modules/eslint/node_modules/@babel/helpers/package.json
generated
vendored
7
tools/node_modules/eslint/node_modules/@babel/helpers/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helpers",
|
||||
"version": "7.16.3",
|
||||
"version": "7.16.5",
|
||||
"description": "Collection of helper functions used by Babel transforms.",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helpers",
|
||||
@ -16,11 +16,12 @@
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.16.0",
|
||||
"@babel/traverse": "^7.16.3",
|
||||
"@babel/traverse": "^7.16.5",
|
||||
"@babel/types": "^7.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.16.0"
|
||||
"@babel/helper-plugin-test-runner": "^7.16.5",
|
||||
"terser": "^5.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
48
tools/node_modules/eslint/node_modules/@babel/helpers/scripts/generate-helpers.js
generated
vendored
48
tools/node_modules/eslint/node_modules/@babel/helpers/scripts/generate-helpers.js
generated
vendored
@ -1,6 +1,7 @@
|
||||
import fs from "fs";
|
||||
import { join } from "path";
|
||||
import { URL, fileURLToPath } from "url";
|
||||
import { minify } from "terser"; // eslint-disable-line
|
||||
|
||||
const HELPERS_FOLDER = new URL("../src/helpers", import.meta.url);
|
||||
const IGNORED_FILES = new Set(["package.json"]);
|
||||
@ -8,11 +9,19 @@ const IGNORED_FILES = new Set(["package.json"]);
|
||||
export default async function generateHelpers() {
|
||||
let output = `/*
|
||||
* This file is auto-generated! Do not modify it directly.
|
||||
* To re-generate run 'make build'
|
||||
* To re-generate run 'yarn gulp generate-runtime-helpers'
|
||||
*/
|
||||
|
||||
import template from "@babel/template";
|
||||
|
||||
function helper(minVersion, source) {
|
||||
return Object.freeze({
|
||||
minVersion,
|
||||
ast: () => template.program.ast(source),
|
||||
})
|
||||
}
|
||||
|
||||
export default Object.freeze({
|
||||
`;
|
||||
|
||||
for (const file of (await fs.promises.readdir(HELPERS_FOLDER)).sort()) {
|
||||
@ -20,8 +29,6 @@ import template from "@babel/template";
|
||||
if (file.startsWith(".")) continue; // ignore e.g. vim swap files
|
||||
|
||||
const [helperName] = file.split(".");
|
||||
const isValidId = isValidBindingIdentifier(helperName);
|
||||
const varName = isValidId ? helperName : `_${helperName}`;
|
||||
|
||||
const filePath = join(fileURLToPath(HELPERS_FOLDER), file);
|
||||
if (!file.endsWith(".js")) {
|
||||
@ -38,31 +45,20 @@ import template from "@babel/template";
|
||||
}
|
||||
const { minVersion } = minVersionMatch.groups;
|
||||
|
||||
// TODO: We can minify the helpers in production
|
||||
const source = fileContents
|
||||
// Remove comments
|
||||
.replace(/\/\*[^]*?\*\/|\/\/.*/g, "")
|
||||
// Remove multiple newlines
|
||||
.replace(/\n{2,}/g, "\n");
|
||||
const source = await minify(fileContents, {
|
||||
mangle: false,
|
||||
// The _typeof helper has a custom directive that we must keep
|
||||
compress: { directives: false },
|
||||
});
|
||||
|
||||
const intro = isValidId
|
||||
? "export "
|
||||
: `export { ${varName} as ${helperName} }\n`;
|
||||
|
||||
output += `\n${intro}const ${varName} = {
|
||||
minVersion: ${JSON.stringify(minVersion)},
|
||||
ast: () => template.program.ast(${JSON.stringify(source)})
|
||||
};\n`;
|
||||
output += `\
|
||||
${JSON.stringify(helperName)}: helper(
|
||||
${JSON.stringify(minVersion)},
|
||||
${JSON.stringify(source.code)},
|
||||
),
|
||||
`;
|
||||
}
|
||||
|
||||
output += "});";
|
||||
return output;
|
||||
}
|
||||
|
||||
function isValidBindingIdentifier(name) {
|
||||
try {
|
||||
Function(`var ${name}`);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
1569
tools/node_modules/eslint/node_modules/@babel/parser/lib/index.js
generated
vendored
1569
tools/node_modules/eslint/node_modules/@babel/parser/lib/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
4
tools/node_modules/eslint/node_modules/@babel/parser/package.json
generated
vendored
4
tools/node_modules/eslint/node_modules/@babel/parser/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.16.4",
|
||||
"version": "7.16.6",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-parser",
|
||||
@ -34,7 +34,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.16.0",
|
||||
"@babel/helper-fixtures": "^7.16.0",
|
||||
"@babel/helper-fixtures": "^7.16.5",
|
||||
"@babel/helper-validator-identifier": "^7.15.7",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-import-assertions",
|
||||
"version": "7.16.0",
|
||||
"version": "7.16.5",
|
||||
"description": "Allow parsing of the module assertion attributes in the import statement",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -16,13 +16,13 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.14.5"
|
||||
"@babel/helper-plugin-utils": "^7.16.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.0"
|
||||
"@babel/core": "^7.16.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
@ -1,13 +0,0 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-import-assertions",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push(["importAssertions"]);
|
||||
},
|
||||
};
|
||||
});
|
206
tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/conversion.js
generated
vendored
206
tools/node_modules/eslint/node_modules/@babel/traverse/lib/path/conversion.js
generated
vendored
@ -11,8 +11,12 @@ exports.unwrapFunctionEnvironment = unwrapFunctionEnvironment;
|
||||
|
||||
var _t = require("@babel/types");
|
||||
|
||||
var _helperEnvironmentVisitor = require("@babel/helper-environment-visitor");
|
||||
|
||||
var _helperFunctionName = require("@babel/helper-function-name");
|
||||
|
||||
var _visitors = require("../visitors");
|
||||
|
||||
const {
|
||||
arrowFunctionExpression,
|
||||
assignmentExpression,
|
||||
@ -144,6 +148,16 @@ function arrowFunctionToExpression({
|
||||
}
|
||||
}
|
||||
|
||||
const getSuperCallsVisitor = (0, _visitors.merge)([{
|
||||
CallExpression(child, {
|
||||
allSuperCalls
|
||||
}) {
|
||||
if (!child.get("callee").isSuper()) return;
|
||||
allSuperCalls.push(child);
|
||||
}
|
||||
|
||||
}, _helperEnvironmentVisitor.default]);
|
||||
|
||||
function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow = true) {
|
||||
let arrowParent;
|
||||
let thisEnvFn = fnPath.findParent(p => {
|
||||
@ -190,21 +204,8 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
|
||||
}
|
||||
|
||||
const allSuperCalls = [];
|
||||
thisEnvFn.traverse({
|
||||
Function(child) {
|
||||
if (child.isArrowFunctionExpression()) return;
|
||||
child.skip();
|
||||
},
|
||||
|
||||
ClassProperty(child) {
|
||||
child.skip();
|
||||
},
|
||||
|
||||
CallExpression(child) {
|
||||
if (!child.get("callee").isSuper()) return;
|
||||
allSuperCalls.push(child);
|
||||
}
|
||||
|
||||
thisEnvFn.traverse(getSuperCallsVisitor, {
|
||||
allSuperCalls
|
||||
});
|
||||
const superBinding = getSuperBinding(thisEnvFn);
|
||||
allSuperCalls.forEach(superCall => {
|
||||
@ -341,27 +342,25 @@ function hasSuperClass(thisEnvFn) {
|
||||
return thisEnvFn.isClassMethod() && !!thisEnvFn.parentPath.parentPath.node.superClass;
|
||||
}
|
||||
|
||||
const assignSuperThisVisitor = (0, _visitors.merge)([{
|
||||
CallExpression(child, {
|
||||
supers,
|
||||
thisBinding
|
||||
}) {
|
||||
if (!child.get("callee").isSuper()) return;
|
||||
if (supers.has(child.node)) return;
|
||||
supers.add(child.node);
|
||||
child.replaceWithMultiple([child.node, assignmentExpression("=", identifier(thisBinding), identifier("this"))]);
|
||||
}
|
||||
|
||||
}, _helperEnvironmentVisitor.default]);
|
||||
|
||||
function getThisBinding(thisEnvFn, inConstructor) {
|
||||
return getBinding(thisEnvFn, "this", thisBinding => {
|
||||
if (!inConstructor || !hasSuperClass(thisEnvFn)) return thisExpression();
|
||||
const supers = new WeakSet();
|
||||
thisEnvFn.traverse({
|
||||
Function(child) {
|
||||
if (child.isArrowFunctionExpression()) return;
|
||||
child.skip();
|
||||
},
|
||||
|
||||
ClassProperty(child) {
|
||||
child.skip();
|
||||
},
|
||||
|
||||
CallExpression(child) {
|
||||
if (!child.get("callee").isSuper()) return;
|
||||
if (supers.has(child.node)) return;
|
||||
supers.add(child.node);
|
||||
child.replaceWithMultiple([child.node, assignmentExpression("=", identifier(thisBinding), identifier("this"))]);
|
||||
}
|
||||
|
||||
thisEnvFn.traverse(assignSuperThisVisitor, {
|
||||
supers: new WeakSet(),
|
||||
thisBinding
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -414,76 +413,89 @@ function getBinding(thisEnvFn, key, init) {
|
||||
return data;
|
||||
}
|
||||
|
||||
const getScopeInformationVisitor = (0, _visitors.merge)([{
|
||||
ThisExpression(child, {
|
||||
thisPaths
|
||||
}) {
|
||||
thisPaths.push(child);
|
||||
},
|
||||
|
||||
JSXIdentifier(child, {
|
||||
thisPaths
|
||||
}) {
|
||||
if (child.node.name !== "this") return;
|
||||
|
||||
if (!child.parentPath.isJSXMemberExpression({
|
||||
object: child.node
|
||||
}) && !child.parentPath.isJSXOpeningElement({
|
||||
name: child.node
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
|
||||
thisPaths.push(child);
|
||||
},
|
||||
|
||||
CallExpression(child, {
|
||||
superCalls
|
||||
}) {
|
||||
if (child.get("callee").isSuper()) superCalls.push(child);
|
||||
},
|
||||
|
||||
MemberExpression(child, {
|
||||
superProps
|
||||
}) {
|
||||
if (child.get("object").isSuper()) superProps.push(child);
|
||||
},
|
||||
|
||||
Identifier(child, {
|
||||
argumentsPaths
|
||||
}) {
|
||||
if (!child.isReferencedIdentifier({
|
||||
name: "arguments"
|
||||
})) return;
|
||||
let curr = child.scope;
|
||||
|
||||
do {
|
||||
if (curr.hasOwnBinding("arguments")) {
|
||||
curr.rename("arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
if (curr.path.isFunction() && !curr.path.isArrowFunctionExpression()) {
|
||||
break;
|
||||
}
|
||||
} while (curr = curr.parent);
|
||||
|
||||
argumentsPaths.push(child);
|
||||
},
|
||||
|
||||
MetaProperty(child, {
|
||||
newTargetPaths
|
||||
}) {
|
||||
if (!child.get("meta").isIdentifier({
|
||||
name: "new"
|
||||
})) return;
|
||||
if (!child.get("property").isIdentifier({
|
||||
name: "target"
|
||||
})) return;
|
||||
newTargetPaths.push(child);
|
||||
}
|
||||
|
||||
}, _helperEnvironmentVisitor.default]);
|
||||
|
||||
function getScopeInformation(fnPath) {
|
||||
const thisPaths = [];
|
||||
const argumentsPaths = [];
|
||||
const newTargetPaths = [];
|
||||
const superProps = [];
|
||||
const superCalls = [];
|
||||
fnPath.traverse({
|
||||
ClassProperty(child) {
|
||||
child.skip();
|
||||
},
|
||||
|
||||
Function(child) {
|
||||
if (child.isArrowFunctionExpression()) return;
|
||||
child.skip();
|
||||
},
|
||||
|
||||
ThisExpression(child) {
|
||||
thisPaths.push(child);
|
||||
},
|
||||
|
||||
JSXIdentifier(child) {
|
||||
if (child.node.name !== "this") return;
|
||||
|
||||
if (!child.parentPath.isJSXMemberExpression({
|
||||
object: child.node
|
||||
}) && !child.parentPath.isJSXOpeningElement({
|
||||
name: child.node
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
|
||||
thisPaths.push(child);
|
||||
},
|
||||
|
||||
CallExpression(child) {
|
||||
if (child.get("callee").isSuper()) superCalls.push(child);
|
||||
},
|
||||
|
||||
MemberExpression(child) {
|
||||
if (child.get("object").isSuper()) superProps.push(child);
|
||||
},
|
||||
|
||||
ReferencedIdentifier(child) {
|
||||
if (child.node.name !== "arguments") return;
|
||||
let curr = child.scope;
|
||||
|
||||
do {
|
||||
if (curr.hasOwnBinding("arguments")) {
|
||||
curr.rename("arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
if (curr.path.isFunction() && !curr.path.isArrowFunctionExpression()) {
|
||||
break;
|
||||
}
|
||||
} while (curr = curr.parent);
|
||||
|
||||
argumentsPaths.push(child);
|
||||
},
|
||||
|
||||
MetaProperty(child) {
|
||||
if (!child.get("meta").isIdentifier({
|
||||
name: "new"
|
||||
})) return;
|
||||
if (!child.get("property").isIdentifier({
|
||||
name: "target"
|
||||
})) return;
|
||||
newTargetPaths.push(child);
|
||||
}
|
||||
|
||||
fnPath.traverse(getScopeInformationVisitor, {
|
||||
thisPaths,
|
||||
argumentsPaths,
|
||||
newTargetPaths,
|
||||
superProps,
|
||||
superCalls
|
||||
});
|
||||
return {
|
||||
thisPaths,
|
||||
|
3
tools/node_modules/eslint/node_modules/@babel/traverse/lib/scope/index.js
generated
vendored
3
tools/node_modules/eslint/node_modules/@babel/traverse/lib/scope/index.js
generated
vendored
@ -575,6 +575,7 @@ class Scope {
|
||||
this.registerBinding(path.node.kind, declar);
|
||||
}
|
||||
} else if (path.isClassDeclaration()) {
|
||||
if (path.node.declare) return;
|
||||
this.registerBinding("let", path);
|
||||
} else if (path.isImportDeclaration()) {
|
||||
const specifiers = path.get("specifiers");
|
||||
@ -940,6 +941,8 @@ class Scope {
|
||||
if ((_previousPath = previousPath) != null && _previousPath.isPattern() && binding.kind !== "param" && binding.kind !== "local") {} else {
|
||||
return binding;
|
||||
}
|
||||
} else if (!binding && name === "arguments" && scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) {
|
||||
break;
|
||||
}
|
||||
|
||||
previousPath = scope.path;
|
||||
|
9
tools/node_modules/eslint/node_modules/@babel/traverse/package.json
generated
vendored
9
tools/node_modules/eslint/node_modules/@babel/traverse/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/traverse",
|
||||
"version": "7.16.3",
|
||||
"version": "7.16.5",
|
||||
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-traverse",
|
||||
@ -17,17 +17,18 @@
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.16.0",
|
||||
"@babel/generator": "^7.16.0",
|
||||
"@babel/generator": "^7.16.5",
|
||||
"@babel/helper-environment-visitor": "^7.16.5",
|
||||
"@babel/helper-function-name": "^7.16.0",
|
||||
"@babel/helper-hoist-variables": "^7.16.0",
|
||||
"@babel/helper-split-export-declaration": "^7.16.0",
|
||||
"@babel/parser": "^7.16.3",
|
||||
"@babel/parser": "^7.16.5",
|
||||
"@babel/types": "^7.16.0",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.16.0"
|
||||
"@babel/helper-plugin-test-runner": "^7.16.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
2
tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/dist/index.cjs.cjs
generated
vendored
2
tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/dist/index.cjs.cjs
generated
vendored
@ -388,7 +388,7 @@ const getTSFunctionComment = function (astNode) {
|
||||
};
|
||||
|
||||
const invokedExpression = new Set(['CallExpression', 'OptionalCallExpression', 'NewExpression']);
|
||||
const allowableCommentNode = new Set(['VariableDeclaration', 'ExpressionStatement', 'MethodDefinition', 'Property', 'ObjectProperty', 'ClassProperty', 'PropertyDefinition']);
|
||||
const allowableCommentNode = new Set(['VariableDeclaration', 'ExpressionStatement', 'MethodDefinition', 'Property', 'ObjectProperty', 'ClassProperty', 'PropertyDefinition', 'ExportDefaultDeclaration']);
|
||||
/**
|
||||
* Reduces the provided node to the appropriate node for evaluating
|
||||
* JSDoc comment status.
|
||||
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Sergii Iavorskyi
|
||||
|
||||
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.
|
@ -1,651 +0,0 @@
|
||||
var CommentParser = (function (exports) {
|
||||
'use strict';
|
||||
|
||||
function isSpace(source) {
|
||||
return /^\s+$/.test(source);
|
||||
}
|
||||
function splitCR(source) {
|
||||
const matches = source.match(/\r+$/);
|
||||
return matches == null
|
||||
? ['', source]
|
||||
: [source.slice(-matches[0].length), source.slice(0, -matches[0].length)];
|
||||
}
|
||||
function splitSpace(source) {
|
||||
const matches = source.match(/^\s+/);
|
||||
return matches == null
|
||||
? ['', source]
|
||||
: [source.slice(0, matches[0].length), source.slice(matches[0].length)];
|
||||
}
|
||||
function splitLines(source) {
|
||||
return source.split(/\n/);
|
||||
}
|
||||
function seedBlock(block = {}) {
|
||||
return Object.assign({ description: '', tags: [], source: [], problems: [] }, block);
|
||||
}
|
||||
function seedSpec(spec = {}) {
|
||||
return Object.assign({ tag: '', name: '', type: '', optional: false, description: '', problems: [], source: [] }, spec);
|
||||
}
|
||||
function seedTokens(tokens = {}) {
|
||||
return Object.assign({ start: '', delimiter: '', postDelimiter: '', tag: '', postTag: '', name: '', postName: '', type: '', postType: '', description: '', end: '', lineEnd: '' }, tokens);
|
||||
}
|
||||
/**
|
||||
* Assures Block.tags[].source contains references to the Block.source items,
|
||||
* using Block.source as a source of truth. This is a counterpart of rewireSpecs
|
||||
* @param block parsed coments block
|
||||
*/
|
||||
function rewireSource(block) {
|
||||
const source = block.source.reduce((acc, line) => acc.set(line.number, line), new Map());
|
||||
for (const spec of block.tags) {
|
||||
spec.source = spec.source.map((line) => source.get(line.number));
|
||||
}
|
||||
return block;
|
||||
}
|
||||
/**
|
||||
* Assures Block.source contains references to the Block.tags[].source items,
|
||||
* using Block.tags[].source as a source of truth. This is a counterpart of rewireSource
|
||||
* @param block parsed coments block
|
||||
*/
|
||||
function rewireSpecs(block) {
|
||||
const source = block.tags.reduce((acc, spec) => spec.source.reduce((acc, line) => acc.set(line.number, line), acc), new Map());
|
||||
block.source = block.source.map((line) => source.get(line.number) || line);
|
||||
return block;
|
||||
}
|
||||
|
||||
const reTag = /^@\S+/;
|
||||
/**
|
||||
* Creates configured `Parser`
|
||||
* @param {Partial<Options>} options
|
||||
*/
|
||||
function getParser$3({ fence = '```', } = {}) {
|
||||
const fencer = getFencer(fence);
|
||||
const toggleFence = (source, isFenced) => fencer(source) ? !isFenced : isFenced;
|
||||
return function parseBlock(source) {
|
||||
// start with description section
|
||||
const sections = [[]];
|
||||
let isFenced = false;
|
||||
for (const line of source) {
|
||||
if (reTag.test(line.tokens.description) && !isFenced) {
|
||||
sections.push([line]);
|
||||
}
|
||||
else {
|
||||
sections[sections.length - 1].push(line);
|
||||
}
|
||||
isFenced = toggleFence(line.tokens.description, isFenced);
|
||||
}
|
||||
return sections;
|
||||
};
|
||||
}
|
||||
function getFencer(fence) {
|
||||
if (typeof fence === 'string')
|
||||
return (source) => source.split(fence).length % 2 === 0;
|
||||
return fence;
|
||||
}
|
||||
|
||||
exports.Markers = void 0;
|
||||
(function (Markers) {
|
||||
Markers["start"] = "/**";
|
||||
Markers["nostart"] = "/***";
|
||||
Markers["delim"] = "*";
|
||||
Markers["end"] = "*/";
|
||||
})(exports.Markers || (exports.Markers = {}));
|
||||
|
||||
function getParser$2({ startLine = 0, } = {}) {
|
||||
let block = null;
|
||||
let num = startLine;
|
||||
return function parseSource(source) {
|
||||
let rest = source;
|
||||
const tokens = seedTokens();
|
||||
[tokens.lineEnd, rest] = splitCR(rest);
|
||||
[tokens.start, rest] = splitSpace(rest);
|
||||
if (block === null &&
|
||||
rest.startsWith(exports.Markers.start) &&
|
||||
!rest.startsWith(exports.Markers.nostart)) {
|
||||
block = [];
|
||||
tokens.delimiter = rest.slice(0, exports.Markers.start.length);
|
||||
rest = rest.slice(exports.Markers.start.length);
|
||||
[tokens.postDelimiter, rest] = splitSpace(rest);
|
||||
}
|
||||
if (block === null) {
|
||||
num++;
|
||||
return null;
|
||||
}
|
||||
const isClosed = rest.trimRight().endsWith(exports.Markers.end);
|
||||
if (tokens.delimiter === '' &&
|
||||
rest.startsWith(exports.Markers.delim) &&
|
||||
!rest.startsWith(exports.Markers.end)) {
|
||||
tokens.delimiter = exports.Markers.delim;
|
||||
rest = rest.slice(exports.Markers.delim.length);
|
||||
[tokens.postDelimiter, rest] = splitSpace(rest);
|
||||
}
|
||||
if (isClosed) {
|
||||
const trimmed = rest.trimRight();
|
||||
tokens.end = rest.slice(trimmed.length - exports.Markers.end.length);
|
||||
rest = trimmed.slice(0, -exports.Markers.end.length);
|
||||
}
|
||||
tokens.description = rest;
|
||||
block.push({ number: num, source, tokens });
|
||||
num++;
|
||||
if (isClosed) {
|
||||
const result = block.slice();
|
||||
block = null;
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
function getParser$1({ tokenizers }) {
|
||||
return function parseSpec(source) {
|
||||
var _a;
|
||||
let spec = seedSpec({ source });
|
||||
for (const tokenize of tokenizers) {
|
||||
spec = tokenize(spec);
|
||||
if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical)
|
||||
break;
|
||||
}
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits the `@prefix` from remaining `Spec.lines[].token.descrioption` into the `tag` token,
|
||||
* and populates `spec.tag`
|
||||
*/
|
||||
function tagTokenizer() {
|
||||
return (spec) => {
|
||||
const { tokens } = spec.source[0];
|
||||
const match = tokens.description.match(/\s*(@(\S+))(\s*)/);
|
||||
if (match === null) {
|
||||
spec.problems.push({
|
||||
code: 'spec:tag:prefix',
|
||||
message: 'tag should start with "@" symbol',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
tokens.tag = match[1];
|
||||
tokens.postTag = match[3];
|
||||
tokens.description = tokens.description.slice(match[0].length);
|
||||
spec.tag = match[2];
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description`
|
||||
* tokens and populates Spec.type`
|
||||
*
|
||||
* @param {Spacing} spacing tells how to deal with a whitespace
|
||||
* for type values going over multiple lines
|
||||
*/
|
||||
function typeTokenizer(spacing = 'compact') {
|
||||
const join = getJoiner$1(spacing);
|
||||
return (spec) => {
|
||||
let curlies = 0;
|
||||
let lines = [];
|
||||
for (const [i, { tokens }] of spec.source.entries()) {
|
||||
let type = '';
|
||||
if (i === 0 && tokens.description[0] !== '{')
|
||||
return spec;
|
||||
for (const ch of tokens.description) {
|
||||
if (ch === '{')
|
||||
curlies++;
|
||||
if (ch === '}')
|
||||
curlies--;
|
||||
type += ch;
|
||||
if (curlies === 0)
|
||||
break;
|
||||
}
|
||||
lines.push([tokens, type]);
|
||||
if (curlies === 0)
|
||||
break;
|
||||
}
|
||||
if (curlies !== 0) {
|
||||
spec.problems.push({
|
||||
code: 'spec:type:unpaired-curlies',
|
||||
message: 'unpaired curlies',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
const parts = [];
|
||||
const offset = lines[0][0].postDelimiter.length;
|
||||
for (const [i, [tokens, type]] of lines.entries()) {
|
||||
tokens.type = type;
|
||||
if (i > 0) {
|
||||
tokens.type = tokens.postDelimiter.slice(offset) + type;
|
||||
tokens.postDelimiter = tokens.postDelimiter.slice(0, offset);
|
||||
}
|
||||
[tokens.postType, tokens.description] = splitSpace(tokens.description.slice(type.length));
|
||||
parts.push(tokens.type);
|
||||
}
|
||||
parts[0] = parts[0].slice(1);
|
||||
parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1);
|
||||
spec.type = join(parts);
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
const trim = (x) => x.trim();
|
||||
function getJoiner$1(spacing) {
|
||||
if (spacing === 'compact')
|
||||
return (t) => t.map(trim).join('');
|
||||
else if (spacing === 'preserve')
|
||||
return (t) => t.join('\n');
|
||||
else
|
||||
return spacing;
|
||||
}
|
||||
|
||||
const isQuoted = (s) => s && s.startsWith('"') && s.endsWith('"');
|
||||
/**
|
||||
* Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens,
|
||||
* and populates the `spec.name`
|
||||
*/
|
||||
function nameTokenizer() {
|
||||
const typeEnd = (num, { tokens }, i) => tokens.type === '' ? num : i;
|
||||
return (spec) => {
|
||||
// look for the name in the line where {type} ends
|
||||
const { tokens } = spec.source[spec.source.reduce(typeEnd, 0)];
|
||||
const source = tokens.description.trimLeft();
|
||||
const quotedGroups = source.split('"');
|
||||
// if it starts with quoted group, assume it is a literal
|
||||
if (quotedGroups.length > 1 &&
|
||||
quotedGroups[0] === '' &&
|
||||
quotedGroups.length % 2 === 1) {
|
||||
spec.name = quotedGroups[1];
|
||||
tokens.name = `"${quotedGroups[1]}"`;
|
||||
[tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length));
|
||||
return spec;
|
||||
}
|
||||
let brackets = 0;
|
||||
let name = '';
|
||||
let optional = false;
|
||||
let defaultValue;
|
||||
// assume name is non-space string or anything wrapped into brackets
|
||||
for (const ch of source) {
|
||||
if (brackets === 0 && isSpace(ch))
|
||||
break;
|
||||
if (ch === '[')
|
||||
brackets++;
|
||||
if (ch === ']')
|
||||
brackets--;
|
||||
name += ch;
|
||||
}
|
||||
if (brackets !== 0) {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:unpaired-brackets',
|
||||
message: 'unpaired brackets',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
const nameToken = name;
|
||||
if (name[0] === '[' && name[name.length - 1] === ']') {
|
||||
optional = true;
|
||||
name = name.slice(1, -1);
|
||||
const parts = name.split('=');
|
||||
name = parts[0].trim();
|
||||
if (parts[1] !== undefined)
|
||||
defaultValue = parts.slice(1).join('=').trim();
|
||||
if (name === '') {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:empty-name',
|
||||
message: 'empty name',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
if (defaultValue === '') {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:empty-default',
|
||||
message: 'empty default value',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
// has "=" and is not a string, except for "=>"
|
||||
if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:invalid-default',
|
||||
message: 'invalid default value syntax',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
}
|
||||
spec.optional = optional;
|
||||
spec.name = name;
|
||||
tokens.name = nameToken;
|
||||
if (defaultValue !== undefined)
|
||||
spec.default = defaultValue;
|
||||
[tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length));
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes no changes to `spec.lines[].tokens` but joins them into `spec.description`
|
||||
* following given spacing srtategy
|
||||
* @param {Spacing} spacing tells how to handle the whitespace
|
||||
*/
|
||||
function descriptionTokenizer(spacing = 'compact') {
|
||||
const join = getJoiner(spacing);
|
||||
return (spec) => {
|
||||
spec.description = join(spec.source);
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
function getJoiner(spacing) {
|
||||
if (spacing === 'compact')
|
||||
return compactJoiner;
|
||||
if (spacing === 'preserve')
|
||||
return preserveJoiner;
|
||||
return spacing;
|
||||
}
|
||||
function compactJoiner(lines) {
|
||||
return lines
|
||||
.map(({ tokens: { description } }) => description.trim())
|
||||
.filter((description) => description !== '')
|
||||
.join(' ');
|
||||
}
|
||||
const lineNo = (num, { tokens }, i) => tokens.type === '' ? num : i;
|
||||
const getDescription = ({ tokens }) => (tokens.delimiter === '' ? tokens.start : tokens.postDelimiter.slice(1)) +
|
||||
tokens.description;
|
||||
function preserveJoiner(lines) {
|
||||
if (lines.length === 0)
|
||||
return '';
|
||||
// skip the opening line with no description
|
||||
if (lines[0].tokens.description === '' &&
|
||||
lines[0].tokens.delimiter === exports.Markers.start)
|
||||
lines = lines.slice(1);
|
||||
// skip the closing line with no description
|
||||
const lastLine = lines[lines.length - 1];
|
||||
if (lastLine !== undefined &&
|
||||
lastLine.tokens.description === '' &&
|
||||
lastLine.tokens.end.endsWith(exports.Markers.end))
|
||||
lines = lines.slice(0, -1);
|
||||
// description starts at the last line of type definition
|
||||
lines = lines.slice(lines.reduce(lineNo, 0));
|
||||
return lines.map(getDescription).join('\n');
|
||||
}
|
||||
|
||||
function getParser({ startLine = 0, fence = '```', spacing = 'compact', tokenizers = [
|
||||
tagTokenizer(),
|
||||
typeTokenizer(spacing),
|
||||
nameTokenizer(),
|
||||
descriptionTokenizer(spacing),
|
||||
], } = {}) {
|
||||
if (startLine < 0 || startLine % 1 > 0)
|
||||
throw new Error('Invalid startLine');
|
||||
const parseSource = getParser$2({ startLine });
|
||||
const parseBlock = getParser$3({ fence });
|
||||
const parseSpec = getParser$1({ tokenizers });
|
||||
const joinDescription = getJoiner(spacing);
|
||||
const notEmpty = (line) => line.tokens.description.trim() != '';
|
||||
return function (source) {
|
||||
const blocks = [];
|
||||
for (const line of splitLines(source)) {
|
||||
const lines = parseSource(line);
|
||||
if (lines === null)
|
||||
continue;
|
||||
if (lines.find(notEmpty) === undefined)
|
||||
continue;
|
||||
const sections = parseBlock(lines);
|
||||
const specs = sections.slice(1).map(parseSpec);
|
||||
blocks.push({
|
||||
description: joinDescription(sections[0]),
|
||||
tags: specs,
|
||||
source: lines,
|
||||
problems: specs.reduce((acc, spec) => acc.concat(spec.problems), []),
|
||||
});
|
||||
}
|
||||
return blocks;
|
||||
};
|
||||
}
|
||||
|
||||
function join(tokens) {
|
||||
return (tokens.start +
|
||||
tokens.delimiter +
|
||||
tokens.postDelimiter +
|
||||
tokens.tag +
|
||||
tokens.postTag +
|
||||
tokens.type +
|
||||
tokens.postType +
|
||||
tokens.name +
|
||||
tokens.postName +
|
||||
tokens.description +
|
||||
tokens.end +
|
||||
tokens.lineEnd);
|
||||
}
|
||||
function getStringifier() {
|
||||
return (block) => block.source.map(({ tokens }) => join(tokens)).join('\n');
|
||||
}
|
||||
|
||||
var __rest$2 = (window && window.__rest) || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const zeroWidth$1 = {
|
||||
start: 0,
|
||||
tag: 0,
|
||||
type: 0,
|
||||
name: 0,
|
||||
};
|
||||
const getWidth = (w, { tokens: t }) => ({
|
||||
start: t.delimiter === exports.Markers.start ? t.start.length : w.start,
|
||||
tag: Math.max(w.tag, t.tag.length),
|
||||
type: Math.max(w.type, t.type.length),
|
||||
name: Math.max(w.name, t.name.length),
|
||||
});
|
||||
const space = (len) => ''.padStart(len, ' ');
|
||||
function align$1() {
|
||||
let intoTags = false;
|
||||
let w;
|
||||
function update(line) {
|
||||
const tokens = Object.assign({}, line.tokens);
|
||||
if (tokens.tag !== '')
|
||||
intoTags = true;
|
||||
const isEmpty = tokens.tag === '' &&
|
||||
tokens.name === '' &&
|
||||
tokens.type === '' &&
|
||||
tokens.description === '';
|
||||
// dangling '*/'
|
||||
if (tokens.end === exports.Markers.end && isEmpty) {
|
||||
tokens.start = space(w.start + 1);
|
||||
return Object.assign(Object.assign({}, line), { tokens });
|
||||
}
|
||||
switch (tokens.delimiter) {
|
||||
case exports.Markers.start:
|
||||
tokens.start = space(w.start);
|
||||
break;
|
||||
case exports.Markers.delim:
|
||||
tokens.start = space(w.start + 1);
|
||||
break;
|
||||
default:
|
||||
tokens.delimiter = '';
|
||||
tokens.start = space(w.start + 2); // compensate delimiter
|
||||
}
|
||||
if (!intoTags) {
|
||||
tokens.postDelimiter = tokens.description === '' ? '' : ' ';
|
||||
return Object.assign(Object.assign({}, line), { tokens });
|
||||
}
|
||||
const nothingAfter = {
|
||||
delim: false,
|
||||
tag: false,
|
||||
type: false,
|
||||
name: false,
|
||||
};
|
||||
if (tokens.description === '') {
|
||||
nothingAfter.name = true;
|
||||
tokens.postName = '';
|
||||
if (tokens.name === '') {
|
||||
nothingAfter.type = true;
|
||||
tokens.postType = '';
|
||||
if (tokens.type === '') {
|
||||
nothingAfter.tag = true;
|
||||
tokens.postTag = '';
|
||||
if (tokens.tag === '') {
|
||||
nothingAfter.delim = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tokens.postDelimiter = nothingAfter.delim ? '' : ' ';
|
||||
if (!nothingAfter.tag)
|
||||
tokens.postTag = space(w.tag - tokens.tag.length + 1);
|
||||
if (!nothingAfter.type)
|
||||
tokens.postType = space(w.type - tokens.type.length + 1);
|
||||
if (!nothingAfter.name)
|
||||
tokens.postName = space(w.name - tokens.name.length + 1);
|
||||
return Object.assign(Object.assign({}, line), { tokens });
|
||||
}
|
||||
return (_a) => {
|
||||
var { source } = _a, fields = __rest$2(_a, ["source"]);
|
||||
w = source.reduce(getWidth, Object.assign({}, zeroWidth$1));
|
||||
return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) }));
|
||||
};
|
||||
}
|
||||
|
||||
var __rest$1 = (window && window.__rest) || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const pull = (offset) => (str) => str.slice(offset);
|
||||
const push = (offset) => {
|
||||
const space = ''.padStart(offset, ' ');
|
||||
return (str) => str + space;
|
||||
};
|
||||
function indent(pos) {
|
||||
let shift;
|
||||
const pad = (start) => {
|
||||
if (shift === undefined) {
|
||||
const offset = pos - start.length;
|
||||
shift = offset > 0 ? push(offset) : pull(-offset);
|
||||
}
|
||||
return shift(start);
|
||||
};
|
||||
const update = (line) => (Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { start: pad(line.tokens.start) }) }));
|
||||
return (_a) => {
|
||||
var { source } = _a, fields = __rest$1(_a, ["source"]);
|
||||
return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) }));
|
||||
};
|
||||
}
|
||||
|
||||
var __rest = (window && window.__rest) || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
function crlf(ending) {
|
||||
function update(line) {
|
||||
return Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { lineEnd: ending === 'LF' ? '' : '\r' }) });
|
||||
}
|
||||
return (_a) => {
|
||||
var { source } = _a, fields = __rest(_a, ["source"]);
|
||||
return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) }));
|
||||
};
|
||||
}
|
||||
|
||||
function flow(...transforms) {
|
||||
return (block) => transforms.reduce((block, t) => t(block), block);
|
||||
}
|
||||
|
||||
const zeroWidth = {
|
||||
line: 0,
|
||||
start: 0,
|
||||
delimiter: 0,
|
||||
postDelimiter: 0,
|
||||
tag: 0,
|
||||
postTag: 0,
|
||||
name: 0,
|
||||
postName: 0,
|
||||
type: 0,
|
||||
postType: 0,
|
||||
description: 0,
|
||||
end: 0,
|
||||
lineEnd: 0,
|
||||
};
|
||||
const headers = { lineEnd: 'CR' };
|
||||
const fields = Object.keys(zeroWidth);
|
||||
const repr = (x) => (isSpace(x) ? `{${x.length}}` : x);
|
||||
const frame = (line) => '|' + line.join('|') + '|';
|
||||
const align = (width, tokens) => Object.keys(tokens).map((k) => repr(tokens[k]).padEnd(width[k]));
|
||||
function inspect({ source }) {
|
||||
var _a, _b;
|
||||
if (source.length === 0)
|
||||
return '';
|
||||
const width = Object.assign({}, zeroWidth);
|
||||
for (const f of fields)
|
||||
width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length;
|
||||
for (const { number, tokens } of source) {
|
||||
width.line = Math.max(width.line, number.toString().length);
|
||||
for (const k in tokens)
|
||||
width[k] = Math.max(width[k], repr(tokens[k]).length);
|
||||
}
|
||||
const lines = [[], []];
|
||||
for (const f of fields)
|
||||
lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f]));
|
||||
for (const f of fields)
|
||||
lines[1].push('-'.padEnd(width[f], '-'));
|
||||
for (const { number, tokens } of source) {
|
||||
const line = number.toString().padStart(width.line);
|
||||
lines.push([line, ...align(width, tokens)]);
|
||||
}
|
||||
return lines.map(frame).join('\n');
|
||||
}
|
||||
|
||||
function parse(source, options = {}) {
|
||||
return getParser(options)(source);
|
||||
}
|
||||
const stringify = getStringifier();
|
||||
const transforms = {
|
||||
flow: flow,
|
||||
align: align$1,
|
||||
indent: indent,
|
||||
crlf: crlf,
|
||||
};
|
||||
const tokenizers = {
|
||||
tag: tagTokenizer,
|
||||
type: typeTokenizer,
|
||||
name: nameTokenizer,
|
||||
description: descriptionTokenizer,
|
||||
};
|
||||
const util = { rewireSpecs, rewireSource, seedBlock, seedTokens };
|
||||
|
||||
exports.inspect = inspect;
|
||||
exports.parse = parse;
|
||||
exports.stringify = stringify;
|
||||
exports.tokenizers = tokenizers;
|
||||
exports.transforms = transforms;
|
||||
exports.util = util;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
return exports;
|
||||
|
||||
}({}));
|
@ -1,30 +0,0 @@
|
||||
import getParser from './parser/index.js';
|
||||
import descriptionTokenizer from './parser/tokenizers/description.js';
|
||||
import nameTokenizer from './parser/tokenizers/name.js';
|
||||
import tagTokenizer from './parser/tokenizers/tag.js';
|
||||
import typeTokenizer from './parser/tokenizers/type.js';
|
||||
import getStringifier from './stringifier/index.js';
|
||||
import alignTransform from './transforms/align.js';
|
||||
import indentTransform from './transforms/indent.js';
|
||||
import crlfTransform from './transforms/crlf.js';
|
||||
import { flow as flowTransform } from './transforms/index.js';
|
||||
import { rewireSpecs, rewireSource, seedBlock, seedTokens } from './util.js';
|
||||
export * from './primitives.js';
|
||||
export function parse(source, options = {}) {
|
||||
return getParser(options)(source);
|
||||
}
|
||||
export const stringify = getStringifier();
|
||||
export { default as inspect } from './stringifier/inspect.js';
|
||||
export const transforms = {
|
||||
flow: flowTransform,
|
||||
align: alignTransform,
|
||||
indent: indentTransform,
|
||||
crlf: crlfTransform,
|
||||
};
|
||||
export const tokenizers = {
|
||||
tag: tagTokenizer,
|
||||
type: typeTokenizer,
|
||||
name: nameTokenizer,
|
||||
description: descriptionTokenizer,
|
||||
};
|
||||
export const util = { rewireSpecs, rewireSource, seedBlock, seedTokens };
|
@ -1,29 +0,0 @@
|
||||
const reTag = /^@\S+/;
|
||||
/**
|
||||
* Creates configured `Parser`
|
||||
* @param {Partial<Options>} options
|
||||
*/
|
||||
export default function getParser({ fence = '```', } = {}) {
|
||||
const fencer = getFencer(fence);
|
||||
const toggleFence = (source, isFenced) => fencer(source) ? !isFenced : isFenced;
|
||||
return function parseBlock(source) {
|
||||
// start with description section
|
||||
const sections = [[]];
|
||||
let isFenced = false;
|
||||
for (const line of source) {
|
||||
if (reTag.test(line.tokens.description) && !isFenced) {
|
||||
sections.push([line]);
|
||||
}
|
||||
else {
|
||||
sections[sections.length - 1].push(line);
|
||||
}
|
||||
isFenced = toggleFence(line.tokens.description, isFenced);
|
||||
}
|
||||
return sections;
|
||||
};
|
||||
}
|
||||
function getFencer(fence) {
|
||||
if (typeof fence === 'string')
|
||||
return (source) => source.split(fence).length % 2 === 0;
|
||||
return fence;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
import { splitLines } from '../util.js';
|
||||
import blockParser from './block-parser.js';
|
||||
import sourceParser from './source-parser.js';
|
||||
import specParser from './spec-parser.js';
|
||||
import tokenizeTag from './tokenizers/tag.js';
|
||||
import tokenizeType from './tokenizers/type.js';
|
||||
import tokenizeName from './tokenizers/name.js';
|
||||
import tokenizeDescription, { getJoiner as getDescriptionJoiner, } from './tokenizers/description.js';
|
||||
export default function getParser({ startLine = 0, fence = '```', spacing = 'compact', tokenizers = [
|
||||
tokenizeTag(),
|
||||
tokenizeType(spacing),
|
||||
tokenizeName(),
|
||||
tokenizeDescription(spacing),
|
||||
], } = {}) {
|
||||
if (startLine < 0 || startLine % 1 > 0)
|
||||
throw new Error('Invalid startLine');
|
||||
const parseSource = sourceParser({ startLine });
|
||||
const parseBlock = blockParser({ fence });
|
||||
const parseSpec = specParser({ tokenizers });
|
||||
const joinDescription = getDescriptionJoiner(spacing);
|
||||
const notEmpty = (line) => line.tokens.description.trim() != '';
|
||||
return function (source) {
|
||||
const blocks = [];
|
||||
for (const line of splitLines(source)) {
|
||||
const lines = parseSource(line);
|
||||
if (lines === null)
|
||||
continue;
|
||||
if (lines.find(notEmpty) === undefined)
|
||||
continue;
|
||||
const sections = parseBlock(lines);
|
||||
const specs = sections.slice(1).map(parseSpec);
|
||||
blocks.push({
|
||||
description: joinDescription(sections[0]),
|
||||
tags: specs,
|
||||
source: lines,
|
||||
problems: specs.reduce((acc, spec) => acc.concat(spec.problems), []),
|
||||
});
|
||||
}
|
||||
return blocks;
|
||||
};
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
import { Markers } from '../primitives.js';
|
||||
import { seedTokens, splitSpace, splitCR } from '../util.js';
|
||||
export default function getParser({ startLine = 0, } = {}) {
|
||||
let block = null;
|
||||
let num = startLine;
|
||||
return function parseSource(source) {
|
||||
let rest = source;
|
||||
const tokens = seedTokens();
|
||||
[tokens.lineEnd, rest] = splitCR(rest);
|
||||
[tokens.start, rest] = splitSpace(rest);
|
||||
if (block === null &&
|
||||
rest.startsWith(Markers.start) &&
|
||||
!rest.startsWith(Markers.nostart)) {
|
||||
block = [];
|
||||
tokens.delimiter = rest.slice(0, Markers.start.length);
|
||||
rest = rest.slice(Markers.start.length);
|
||||
[tokens.postDelimiter, rest] = splitSpace(rest);
|
||||
}
|
||||
if (block === null) {
|
||||
num++;
|
||||
return null;
|
||||
}
|
||||
const isClosed = rest.trimRight().endsWith(Markers.end);
|
||||
if (tokens.delimiter === '' &&
|
||||
rest.startsWith(Markers.delim) &&
|
||||
!rest.startsWith(Markers.end)) {
|
||||
tokens.delimiter = Markers.delim;
|
||||
rest = rest.slice(Markers.delim.length);
|
||||
[tokens.postDelimiter, rest] = splitSpace(rest);
|
||||
}
|
||||
if (isClosed) {
|
||||
const trimmed = rest.trimRight();
|
||||
tokens.end = rest.slice(trimmed.length - Markers.end.length);
|
||||
rest = trimmed.slice(0, -Markers.end.length);
|
||||
}
|
||||
tokens.description = rest;
|
||||
block.push({ number: num, source, tokens });
|
||||
num++;
|
||||
if (isClosed) {
|
||||
const result = block.slice();
|
||||
block = null;
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import { seedSpec } from '../util.js';
|
||||
export default function getParser({ tokenizers }) {
|
||||
return function parseSpec(source) {
|
||||
var _a;
|
||||
let spec = seedSpec({ source });
|
||||
for (const tokenize of tokenizers) {
|
||||
spec = tokenize(spec);
|
||||
if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical)
|
||||
break;
|
||||
}
|
||||
return spec;
|
||||
};
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
import { Markers } from '../../primitives.js';
|
||||
/**
|
||||
* Makes no changes to `spec.lines[].tokens` but joins them into `spec.description`
|
||||
* following given spacing srtategy
|
||||
* @param {Spacing} spacing tells how to handle the whitespace
|
||||
*/
|
||||
export default function descriptionTokenizer(spacing = 'compact') {
|
||||
const join = getJoiner(spacing);
|
||||
return (spec) => {
|
||||
spec.description = join(spec.source);
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
export function getJoiner(spacing) {
|
||||
if (spacing === 'compact')
|
||||
return compactJoiner;
|
||||
if (spacing === 'preserve')
|
||||
return preserveJoiner;
|
||||
return spacing;
|
||||
}
|
||||
function compactJoiner(lines) {
|
||||
return lines
|
||||
.map(({ tokens: { description } }) => description.trim())
|
||||
.filter((description) => description !== '')
|
||||
.join(' ');
|
||||
}
|
||||
const lineNo = (num, { tokens }, i) => tokens.type === '' ? num : i;
|
||||
const getDescription = ({ tokens }) => (tokens.delimiter === '' ? tokens.start : tokens.postDelimiter.slice(1)) +
|
||||
tokens.description;
|
||||
function preserveJoiner(lines) {
|
||||
if (lines.length === 0)
|
||||
return '';
|
||||
// skip the opening line with no description
|
||||
if (lines[0].tokens.description === '' &&
|
||||
lines[0].tokens.delimiter === Markers.start)
|
||||
lines = lines.slice(1);
|
||||
// skip the closing line with no description
|
||||
const lastLine = lines[lines.length - 1];
|
||||
if (lastLine !== undefined &&
|
||||
lastLine.tokens.description === '' &&
|
||||
lastLine.tokens.end.endsWith(Markers.end))
|
||||
lines = lines.slice(0, -1);
|
||||
// description starts at the last line of type definition
|
||||
lines = lines.slice(lines.reduce(lineNo, 0));
|
||||
return lines.map(getDescription).join('\n');
|
||||
}
|
@ -1 +0,0 @@
|
||||
export {};
|
@ -1,91 +0,0 @@
|
||||
import { splitSpace, isSpace } from '../../util.js';
|
||||
const isQuoted = (s) => s && s.startsWith('"') && s.endsWith('"');
|
||||
/**
|
||||
* Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens,
|
||||
* and populates the `spec.name`
|
||||
*/
|
||||
export default function nameTokenizer() {
|
||||
const typeEnd = (num, { tokens }, i) => tokens.type === '' ? num : i;
|
||||
return (spec) => {
|
||||
// look for the name in the line where {type} ends
|
||||
const { tokens } = spec.source[spec.source.reduce(typeEnd, 0)];
|
||||
const source = tokens.description.trimLeft();
|
||||
const quotedGroups = source.split('"');
|
||||
// if it starts with quoted group, assume it is a literal
|
||||
if (quotedGroups.length > 1 &&
|
||||
quotedGroups[0] === '' &&
|
||||
quotedGroups.length % 2 === 1) {
|
||||
spec.name = quotedGroups[1];
|
||||
tokens.name = `"${quotedGroups[1]}"`;
|
||||
[tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length));
|
||||
return spec;
|
||||
}
|
||||
let brackets = 0;
|
||||
let name = '';
|
||||
let optional = false;
|
||||
let defaultValue;
|
||||
// assume name is non-space string or anything wrapped into brackets
|
||||
for (const ch of source) {
|
||||
if (brackets === 0 && isSpace(ch))
|
||||
break;
|
||||
if (ch === '[')
|
||||
brackets++;
|
||||
if (ch === ']')
|
||||
brackets--;
|
||||
name += ch;
|
||||
}
|
||||
if (brackets !== 0) {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:unpaired-brackets',
|
||||
message: 'unpaired brackets',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
const nameToken = name;
|
||||
if (name[0] === '[' && name[name.length - 1] === ']') {
|
||||
optional = true;
|
||||
name = name.slice(1, -1);
|
||||
const parts = name.split('=');
|
||||
name = parts[0].trim();
|
||||
if (parts[1] !== undefined)
|
||||
defaultValue = parts.slice(1).join('=').trim();
|
||||
if (name === '') {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:empty-name',
|
||||
message: 'empty name',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
if (defaultValue === '') {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:empty-default',
|
||||
message: 'empty default value',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
// has "=" and is not a string, except for "=>"
|
||||
if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:invalid-default',
|
||||
message: 'invalid default value syntax',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
}
|
||||
spec.optional = optional;
|
||||
spec.name = name;
|
||||
tokens.name = nameToken;
|
||||
if (defaultValue !== undefined)
|
||||
spec.default = defaultValue;
|
||||
[tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length));
|
||||
return spec;
|
||||
};
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
/**
|
||||
* Splits the `@prefix` from remaining `Spec.lines[].token.descrioption` into the `tag` token,
|
||||
* and populates `spec.tag`
|
||||
*/
|
||||
export default function tagTokenizer() {
|
||||
return (spec) => {
|
||||
const { tokens } = spec.source[0];
|
||||
const match = tokens.description.match(/\s*(@(\S+))(\s*)/);
|
||||
if (match === null) {
|
||||
spec.problems.push({
|
||||
code: 'spec:tag:prefix',
|
||||
message: 'tag should start with "@" symbol',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
tokens.tag = match[1];
|
||||
tokens.postTag = match[3];
|
||||
tokens.description = tokens.description.slice(match[0].length);
|
||||
spec.tag = match[2];
|
||||
return spec;
|
||||
};
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
import { splitSpace } from '../../util.js';
|
||||
/**
|
||||
* Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description`
|
||||
* tokens and populates Spec.type`
|
||||
*
|
||||
* @param {Spacing} spacing tells how to deal with a whitespace
|
||||
* for type values going over multiple lines
|
||||
*/
|
||||
export default function typeTokenizer(spacing = 'compact') {
|
||||
const join = getJoiner(spacing);
|
||||
return (spec) => {
|
||||
let curlies = 0;
|
||||
let lines = [];
|
||||
for (const [i, { tokens }] of spec.source.entries()) {
|
||||
let type = '';
|
||||
if (i === 0 && tokens.description[0] !== '{')
|
||||
return spec;
|
||||
for (const ch of tokens.description) {
|
||||
if (ch === '{')
|
||||
curlies++;
|
||||
if (ch === '}')
|
||||
curlies--;
|
||||
type += ch;
|
||||
if (curlies === 0)
|
||||
break;
|
||||
}
|
||||
lines.push([tokens, type]);
|
||||
if (curlies === 0)
|
||||
break;
|
||||
}
|
||||
if (curlies !== 0) {
|
||||
spec.problems.push({
|
||||
code: 'spec:type:unpaired-curlies',
|
||||
message: 'unpaired curlies',
|
||||
line: spec.source[0].number,
|
||||
critical: true,
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
const parts = [];
|
||||
const offset = lines[0][0].postDelimiter.length;
|
||||
for (const [i, [tokens, type]] of lines.entries()) {
|
||||
tokens.type = type;
|
||||
if (i > 0) {
|
||||
tokens.type = tokens.postDelimiter.slice(offset) + type;
|
||||
tokens.postDelimiter = tokens.postDelimiter.slice(0, offset);
|
||||
}
|
||||
[tokens.postType, tokens.description] = splitSpace(tokens.description.slice(type.length));
|
||||
parts.push(tokens.type);
|
||||
}
|
||||
parts[0] = parts[0].slice(1);
|
||||
parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1);
|
||||
spec.type = join(parts);
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
const trim = (x) => x.trim();
|
||||
function getJoiner(spacing) {
|
||||
if (spacing === 'compact')
|
||||
return (t) => t.map(trim).join('');
|
||||
else if (spacing === 'preserve')
|
||||
return (t) => t.join('\n');
|
||||
else
|
||||
return spacing;
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
export var Markers;
|
||||
(function (Markers) {
|
||||
Markers["start"] = "/**";
|
||||
Markers["nostart"] = "/***";
|
||||
Markers["delim"] = "*";
|
||||
Markers["end"] = "*/";
|
||||
})(Markers || (Markers = {}));
|
@ -1,17 +0,0 @@
|
||||
function join(tokens) {
|
||||
return (tokens.start +
|
||||
tokens.delimiter +
|
||||
tokens.postDelimiter +
|
||||
tokens.tag +
|
||||
tokens.postTag +
|
||||
tokens.type +
|
||||
tokens.postType +
|
||||
tokens.name +
|
||||
tokens.postName +
|
||||
tokens.description +
|
||||
tokens.end +
|
||||
tokens.lineEnd);
|
||||
}
|
||||
export default function getStringifier() {
|
||||
return (block) => block.source.map(({ tokens }) => join(tokens)).join('\n');
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
import { isSpace } from '../util.js';
|
||||
const zeroWidth = {
|
||||
line: 0,
|
||||
start: 0,
|
||||
delimiter: 0,
|
||||
postDelimiter: 0,
|
||||
tag: 0,
|
||||
postTag: 0,
|
||||
name: 0,
|
||||
postName: 0,
|
||||
type: 0,
|
||||
postType: 0,
|
||||
description: 0,
|
||||
end: 0,
|
||||
lineEnd: 0,
|
||||
};
|
||||
const headers = { lineEnd: 'CR' };
|
||||
const fields = Object.keys(zeroWidth);
|
||||
const repr = (x) => (isSpace(x) ? `{${x.length}}` : x);
|
||||
const frame = (line) => '|' + line.join('|') + '|';
|
||||
const align = (width, tokens) => Object.keys(tokens).map((k) => repr(tokens[k]).padEnd(width[k]));
|
||||
export default function inspect({ source }) {
|
||||
var _a, _b;
|
||||
if (source.length === 0)
|
||||
return '';
|
||||
const width = Object.assign({}, zeroWidth);
|
||||
for (const f of fields)
|
||||
width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length;
|
||||
for (const { number, tokens } of source) {
|
||||
width.line = Math.max(width.line, number.toString().length);
|
||||
for (const k in tokens)
|
||||
width[k] = Math.max(width[k], repr(tokens[k]).length);
|
||||
}
|
||||
const lines = [[], []];
|
||||
for (const f of fields)
|
||||
lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f]));
|
||||
for (const f of fields)
|
||||
lines[1].push('-'.padEnd(width[f], '-'));
|
||||
for (const { number, tokens } of source) {
|
||||
const line = number.toString().padStart(width.line);
|
||||
lines.push([line, ...align(width, tokens)]);
|
||||
}
|
||||
return lines.map(frame).join('\n');
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
var __rest = (this && this.__rest) || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
import { Markers } from '../primitives.js';
|
||||
import { rewireSource } from '../util.js';
|
||||
const zeroWidth = {
|
||||
start: 0,
|
||||
tag: 0,
|
||||
type: 0,
|
||||
name: 0,
|
||||
};
|
||||
const getWidth = (w, { tokens: t }) => ({
|
||||
start: t.delimiter === Markers.start ? t.start.length : w.start,
|
||||
tag: Math.max(w.tag, t.tag.length),
|
||||
type: Math.max(w.type, t.type.length),
|
||||
name: Math.max(w.name, t.name.length),
|
||||
});
|
||||
const space = (len) => ''.padStart(len, ' ');
|
||||
export default function align() {
|
||||
let intoTags = false;
|
||||
let w;
|
||||
function update(line) {
|
||||
const tokens = Object.assign({}, line.tokens);
|
||||
if (tokens.tag !== '')
|
||||
intoTags = true;
|
||||
const isEmpty = tokens.tag === '' &&
|
||||
tokens.name === '' &&
|
||||
tokens.type === '' &&
|
||||
tokens.description === '';
|
||||
// dangling '*/'
|
||||
if (tokens.end === Markers.end && isEmpty) {
|
||||
tokens.start = space(w.start + 1);
|
||||
return Object.assign(Object.assign({}, line), { tokens });
|
||||
}
|
||||
switch (tokens.delimiter) {
|
||||
case Markers.start:
|
||||
tokens.start = space(w.start);
|
||||
break;
|
||||
case Markers.delim:
|
||||
tokens.start = space(w.start + 1);
|
||||
break;
|
||||
default:
|
||||
tokens.delimiter = '';
|
||||
tokens.start = space(w.start + 2); // compensate delimiter
|
||||
}
|
||||
if (!intoTags) {
|
||||
tokens.postDelimiter = tokens.description === '' ? '' : ' ';
|
||||
return Object.assign(Object.assign({}, line), { tokens });
|
||||
}
|
||||
const nothingAfter = {
|
||||
delim: false,
|
||||
tag: false,
|
||||
type: false,
|
||||
name: false,
|
||||
};
|
||||
if (tokens.description === '') {
|
||||
nothingAfter.name = true;
|
||||
tokens.postName = '';
|
||||
if (tokens.name === '') {
|
||||
nothingAfter.type = true;
|
||||
tokens.postType = '';
|
||||
if (tokens.type === '') {
|
||||
nothingAfter.tag = true;
|
||||
tokens.postTag = '';
|
||||
if (tokens.tag === '') {
|
||||
nothingAfter.delim = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tokens.postDelimiter = nothingAfter.delim ? '' : ' ';
|
||||
if (!nothingAfter.tag)
|
||||
tokens.postTag = space(w.tag - tokens.tag.length + 1);
|
||||
if (!nothingAfter.type)
|
||||
tokens.postType = space(w.type - tokens.type.length + 1);
|
||||
if (!nothingAfter.name)
|
||||
tokens.postName = space(w.name - tokens.name.length + 1);
|
||||
return Object.assign(Object.assign({}, line), { tokens });
|
||||
}
|
||||
return (_a) => {
|
||||
var { source } = _a, fields = __rest(_a, ["source"]);
|
||||
w = source.reduce(getWidth, Object.assign({}, zeroWidth));
|
||||
return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) }));
|
||||
};
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
var __rest = (this && this.__rest) || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
import { rewireSource } from '../util.js';
|
||||
const order = [
|
||||
'end',
|
||||
'description',
|
||||
'postType',
|
||||
'type',
|
||||
'postName',
|
||||
'name',
|
||||
'postTag',
|
||||
'tag',
|
||||
'postDelimiter',
|
||||
'delimiter',
|
||||
'start',
|
||||
];
|
||||
export default function crlf(ending) {
|
||||
function update(line) {
|
||||
return Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { lineEnd: ending === 'LF' ? '' : '\r' }) });
|
||||
}
|
||||
return (_a) => {
|
||||
var { source } = _a, fields = __rest(_a, ["source"]);
|
||||
return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) }));
|
||||
};
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
var __rest = (this && this.__rest) || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
import { rewireSource } from '../util.js';
|
||||
const pull = (offset) => (str) => str.slice(offset);
|
||||
const push = (offset) => {
|
||||
const space = ''.padStart(offset, ' ');
|
||||
return (str) => str + space;
|
||||
};
|
||||
export default function indent(pos) {
|
||||
let shift;
|
||||
const pad = (start) => {
|
||||
if (shift === undefined) {
|
||||
const offset = pos - start.length;
|
||||
shift = offset > 0 ? push(offset) : pull(-offset);
|
||||
}
|
||||
return shift(start);
|
||||
};
|
||||
const update = (line) => (Object.assign(Object.assign({}, line), { tokens: Object.assign(Object.assign({}, line.tokens), { start: pad(line.tokens.start) }) }));
|
||||
return (_a) => {
|
||||
var { source } = _a, fields = __rest(_a, ["source"]);
|
||||
return rewireSource(Object.assign(Object.assign({}, fields), { source: source.map(update) }));
|
||||
};
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
export function flow(...transforms) {
|
||||
return (block) => transforms.reduce((block, t) => t(block), block);
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
export function isSpace(source) {
|
||||
return /^\s+$/.test(source);
|
||||
}
|
||||
export function hasCR(source) {
|
||||
return /\r$/.test(source);
|
||||
}
|
||||
export function splitCR(source) {
|
||||
const matches = source.match(/\r+$/);
|
||||
return matches == null
|
||||
? ['', source]
|
||||
: [source.slice(-matches[0].length), source.slice(0, -matches[0].length)];
|
||||
}
|
||||
export function splitSpace(source) {
|
||||
const matches = source.match(/^\s+/);
|
||||
return matches == null
|
||||
? ['', source]
|
||||
: [source.slice(0, matches[0].length), source.slice(matches[0].length)];
|
||||
}
|
||||
export function splitLines(source) {
|
||||
return source.split(/\n/);
|
||||
}
|
||||
export function seedBlock(block = {}) {
|
||||
return Object.assign({ description: '', tags: [], source: [], problems: [] }, block);
|
||||
}
|
||||
export function seedSpec(spec = {}) {
|
||||
return Object.assign({ tag: '', name: '', type: '', optional: false, description: '', problems: [], source: [] }, spec);
|
||||
}
|
||||
export function seedTokens(tokens = {}) {
|
||||
return Object.assign({ start: '', delimiter: '', postDelimiter: '', tag: '', postTag: '', name: '', postName: '', type: '', postType: '', description: '', end: '', lineEnd: '' }, tokens);
|
||||
}
|
||||
/**
|
||||
* Assures Block.tags[].source contains references to the Block.source items,
|
||||
* using Block.source as a source of truth. This is a counterpart of rewireSpecs
|
||||
* @param block parsed coments block
|
||||
*/
|
||||
export function rewireSource(block) {
|
||||
const source = block.source.reduce((acc, line) => acc.set(line.number, line), new Map());
|
||||
for (const spec of block.tags) {
|
||||
spec.source = spec.source.map((line) => source.get(line.number));
|
||||
}
|
||||
return block;
|
||||
}
|
||||
/**
|
||||
* Assures Block.source contains references to the Block.tags[].source items,
|
||||
* using Block.tags[].source as a source of truth. This is a counterpart of rewireSource
|
||||
* @param block parsed coments block
|
||||
*/
|
||||
export function rewireSpecs(block) {
|
||||
const source = block.tags.reduce((acc, spec) => spec.source.reduce((acc, line) => acc.set(line.number, line), acc), new Map());
|
||||
block.source = block.source.map((line) => source.get(line.number) || line);
|
||||
return block;
|
||||
}
|
@ -1,207 +0,0 @@
|
||||
// For a detailed explanation regarding each configuration property, visit:
|
||||
// https://jestjs.io/docs/en/configuration.html
|
||||
|
||||
const { compilerOptions: tsconfig } = JSON.parse(
|
||||
require('fs').readFileSync('./tsconfig.node.json')
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsconfig,
|
||||
},
|
||||
},
|
||||
|
||||
// All imported modules in your tests should be mocked automatically
|
||||
// automock: false,
|
||||
|
||||
// Stop running tests after `n` failures
|
||||
// bail: 0,
|
||||
|
||||
// The directory where Jest should store its cached dependency information
|
||||
// cacheDirectory: "/private/var/folders/_g/g97k3tbx31x08qqy2z18kxq80000gn/T/jest_dx",
|
||||
|
||||
// Automatically clear mock calls and instances between every test
|
||||
// clearMocks: false,
|
||||
|
||||
// Indicates whether the coverage information should be collected while executing the test
|
||||
collectCoverage: true,
|
||||
|
||||
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
||||
// collectCoverageFrom: undefined,
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
// coverageDirectory: ".coverage",
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/node_modules/', '/lib/', '/tests/'],
|
||||
|
||||
// Indicates which provider should be used to instrument code for coverage
|
||||
coverageProvider: 'v8',
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
// coverageReporters: [
|
||||
// "json",
|
||||
// "text",
|
||||
// "lcov",
|
||||
// "clover"
|
||||
// ],
|
||||
|
||||
// An object that configures minimum threshold enforcement for coverage results
|
||||
// coverageThreshold: {
|
||||
// global : {
|
||||
// branches: 85,
|
||||
// functions: 85,
|
||||
// lines: 85,
|
||||
// statements: 85
|
||||
// }
|
||||
// },
|
||||
|
||||
// A path to a custom dependency extractor
|
||||
// dependencyExtractor: undefined,
|
||||
|
||||
// Make calling deprecated APIs throw helpful error messages
|
||||
// errorOnDeprecated: false,
|
||||
|
||||
// Force coverage collection from ignored files using an array of glob patterns
|
||||
// forceCoverageMatch: [],
|
||||
|
||||
// A path to a module which exports an async function that is triggered once before all test suites
|
||||
// globalSetup: undefined,
|
||||
|
||||
// A path to a module which exports an async function that is triggered once after all test suites
|
||||
// globalTeardown: undefined,
|
||||
|
||||
// A set of global variables that need to be available in all test environments
|
||||
// globals: {},
|
||||
|
||||
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
|
||||
// maxWorkers: "50%",
|
||||
|
||||
// An array of directory names to be searched recursively up from the requiring module's location
|
||||
// moduleDirectories: [
|
||||
// "node_modules"
|
||||
// ],
|
||||
|
||||
// An array of file extensions your modules use
|
||||
// moduleFileExtensions: [
|
||||
// "js",
|
||||
// "json",
|
||||
// "jsx",
|
||||
// "ts",
|
||||
// "tsx",
|
||||
// "node"
|
||||
// ],
|
||||
|
||||
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
|
||||
// moduleNameMapper: {},
|
||||
|
||||
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
||||
// modulePathIgnorePatterns: [],
|
||||
|
||||
// Activates notifications for test results
|
||||
// notify: false,
|
||||
|
||||
// An enum that specifies notification mode. Requires { notify: true }
|
||||
// notifyMode: "failure-change",
|
||||
|
||||
// A preset that is used as a base for Jest's configuration
|
||||
preset: 'ts-jest',
|
||||
|
||||
// Run tests from one or more projects
|
||||
// projects: undefined,
|
||||
|
||||
// Use this configuration option to add custom reporters to Jest
|
||||
// reporters: undefined,
|
||||
|
||||
// Automatically reset mock state between every test
|
||||
// resetMocks: false,
|
||||
|
||||
// Reset the module registry before running each individual test
|
||||
// resetModules: false,
|
||||
|
||||
// A path to a custom resolver
|
||||
// resolver: undefined,
|
||||
|
||||
// Automatically restore mock state between every test
|
||||
// restoreMocks: false,
|
||||
|
||||
// The root directory that Jest should scan for tests and modules within
|
||||
// rootDir: undefined,
|
||||
|
||||
// A list of paths to directories that Jest should use to search for files in
|
||||
roots: ['<rootDir>/tests/'],
|
||||
|
||||
// Allows you to use a custom runner instead of Jest's default test runner
|
||||
// runner: "jest-runner",
|
||||
|
||||
// The paths to modules that run some code to configure or set up the testing environment before each test
|
||||
// setupFiles: [],
|
||||
|
||||
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
||||
// setupFilesAfterEnv: [],
|
||||
|
||||
// The number of seconds after which a test is considered as slow and reported as such in the results.
|
||||
// slowTestThreshold: 5,
|
||||
|
||||
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
|
||||
// snapshotSerializers: [],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
testEnvironment: 'node',
|
||||
|
||||
// Options that will be passed to the testEnvironment
|
||||
// testEnvironmentOptions: {},
|
||||
|
||||
// Adds a location field to test results
|
||||
// testLocationInResults: false,
|
||||
|
||||
// The glob patterns Jest uses to detect test files
|
||||
// testMatch: [
|
||||
// "**/__tests__/**/*.[jt]s?(x)",
|
||||
// "**/?(*.)+(spec|test).[tj]s?(x)"
|
||||
// ],
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
// testPathIgnorePatterns: [
|
||||
// "/node_modules/"
|
||||
// ],
|
||||
|
||||
// The regexp pattern or array of patterns that Jest uses to detect test files
|
||||
// testRegex: [],
|
||||
|
||||
// This option allows the use of a custom results processor
|
||||
// testResultsProcessor: undefined,
|
||||
|
||||
// This option allows use of a custom test runner
|
||||
// testRunner: "jasmine2",
|
||||
|
||||
// This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
|
||||
// testURL: "http://localhost",
|
||||
|
||||
// Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
|
||||
// timers: "real",
|
||||
|
||||
// A map from regular expressions to paths to transformers
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest',
|
||||
},
|
||||
|
||||
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
||||
// transformIgnorePatterns: [
|
||||
// "/node_modules/",
|
||||
// "\\.pnp\\.[^\\/]+$"
|
||||
// ],
|
||||
|
||||
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
||||
// unmockedModulePathPatterns: undefined,
|
||||
|
||||
// Indicates whether each individual test should be reported during the run
|
||||
// verbose: undefined,
|
||||
|
||||
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
|
||||
// watchPathIgnorePatterns: [],
|
||||
|
||||
// Whether to use watchman for file crawling
|
||||
// watchman: true,
|
||||
};
|
@ -1,82 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return m[k];
|
||||
}
|
||||
});
|
||||
} : function (o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
var __exportStar = this && this.__exportStar || function (m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.util = exports.tokenizers = exports.transforms = exports.inspect = exports.stringify = exports.parse = void 0;
|
||||
|
||||
const index_1 = require("./parser/index.cjs");
|
||||
|
||||
const description_1 = require("./parser/tokenizers/description.cjs");
|
||||
|
||||
const name_1 = require("./parser/tokenizers/name.cjs");
|
||||
|
||||
const tag_1 = require("./parser/tokenizers/tag.cjs");
|
||||
|
||||
const type_1 = require("./parser/tokenizers/type.cjs");
|
||||
|
||||
const index_2 = require("./stringifier/index.cjs");
|
||||
|
||||
const align_1 = require("./transforms/align.cjs");
|
||||
|
||||
const indent_1 = require("./transforms/indent.cjs");
|
||||
|
||||
const crlf_1 = require("./transforms/crlf.cjs");
|
||||
|
||||
const index_3 = require("./transforms/index.cjs");
|
||||
|
||||
const util_1 = require("./util.cjs");
|
||||
|
||||
__exportStar(require("./primitives.cjs"), exports);
|
||||
|
||||
function parse(source, options = {}) {
|
||||
return index_1.default(options)(source);
|
||||
}
|
||||
|
||||
exports.parse = parse;
|
||||
exports.stringify = index_2.default();
|
||||
|
||||
var inspect_1 = require("./stringifier/inspect.cjs");
|
||||
|
||||
Object.defineProperty(exports, "inspect", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return inspect_1.default;
|
||||
}
|
||||
});
|
||||
exports.transforms = {
|
||||
flow: index_3.flow,
|
||||
align: align_1.default,
|
||||
indent: indent_1.default,
|
||||
crlf: crlf_1.default
|
||||
};
|
||||
exports.tokenizers = {
|
||||
tag: tag_1.default,
|
||||
type: type_1.default,
|
||||
name: name_1.default,
|
||||
description: description_1.default
|
||||
};
|
||||
exports.util = {
|
||||
rewireSpecs: util_1.rewireSpecs,
|
||||
rewireSource: util_1.rewireSource,
|
||||
seedBlock: util_1.seedBlock,
|
||||
seedTokens: util_1.seedTokens
|
||||
};
|
||||
//# sourceMappingURL=index.cjs.map
|
@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
const reTag = /^@\S+/;
|
||||
/**
|
||||
* Creates configured `Parser`
|
||||
* @param {Partial<Options>} options
|
||||
*/
|
||||
|
||||
function getParser({
|
||||
fence = '```'
|
||||
} = {}) {
|
||||
const fencer = getFencer(fence);
|
||||
|
||||
const toggleFence = (source, isFenced) => fencer(source) ? !isFenced : isFenced;
|
||||
|
||||
return function parseBlock(source) {
|
||||
// start with description section
|
||||
const sections = [[]];
|
||||
let isFenced = false;
|
||||
|
||||
for (const line of source) {
|
||||
if (reTag.test(line.tokens.description) && !isFenced) {
|
||||
sections.push([line]);
|
||||
} else {
|
||||
sections[sections.length - 1].push(line);
|
||||
}
|
||||
|
||||
isFenced = toggleFence(line.tokens.description, isFenced);
|
||||
}
|
||||
|
||||
return sections;
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = getParser;
|
||||
|
||||
function getFencer(fence) {
|
||||
if (typeof fence === 'string') return source => source.split(fence).length % 2 === 0;
|
||||
return fence;
|
||||
}
|
||||
//# sourceMappingURL=block-parser.cjs.map
|
@ -1,65 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
const util_1 = require("../util.cjs");
|
||||
|
||||
const block_parser_1 = require("./block-parser.cjs");
|
||||
|
||||
const source_parser_1 = require("./source-parser.cjs");
|
||||
|
||||
const spec_parser_1 = require("./spec-parser.cjs");
|
||||
|
||||
const tag_1 = require("./tokenizers/tag.cjs");
|
||||
|
||||
const type_1 = require("./tokenizers/type.cjs");
|
||||
|
||||
const name_1 = require("./tokenizers/name.cjs");
|
||||
|
||||
const description_1 = require("./tokenizers/description.cjs");
|
||||
|
||||
function getParser({
|
||||
startLine = 0,
|
||||
fence = '```',
|
||||
spacing = 'compact',
|
||||
tokenizers = [tag_1.default(), type_1.default(spacing), name_1.default(), description_1.default(spacing)]
|
||||
} = {}) {
|
||||
if (startLine < 0 || startLine % 1 > 0) throw new Error('Invalid startLine');
|
||||
const parseSource = source_parser_1.default({
|
||||
startLine
|
||||
});
|
||||
const parseBlock = block_parser_1.default({
|
||||
fence
|
||||
});
|
||||
const parseSpec = spec_parser_1.default({
|
||||
tokenizers
|
||||
});
|
||||
const joinDescription = description_1.getJoiner(spacing);
|
||||
|
||||
const notEmpty = line => line.tokens.description.trim() != '';
|
||||
|
||||
return function (source) {
|
||||
const blocks = [];
|
||||
|
||||
for (const line of util_1.splitLines(source)) {
|
||||
const lines = parseSource(line);
|
||||
if (lines === null) continue;
|
||||
if (lines.find(notEmpty) === undefined) continue;
|
||||
const sections = parseBlock(lines);
|
||||
const specs = sections.slice(1).map(parseSpec);
|
||||
blocks.push({
|
||||
description: joinDescription(sections[0]),
|
||||
tags: specs,
|
||||
source: lines,
|
||||
problems: specs.reduce((acc, spec) => acc.concat(spec.problems), [])
|
||||
});
|
||||
}
|
||||
|
||||
return blocks;
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = getParser;
|
||||
//# sourceMappingURL=index.cjs.map
|
@ -1,67 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
const primitives_1 = require("../primitives.cjs");
|
||||
|
||||
const util_1 = require("../util.cjs");
|
||||
|
||||
function getParser({
|
||||
startLine = 0
|
||||
} = {}) {
|
||||
let block = null;
|
||||
let num = startLine;
|
||||
return function parseSource(source) {
|
||||
let rest = source;
|
||||
const tokens = util_1.seedTokens();
|
||||
[tokens.lineEnd, rest] = util_1.splitCR(rest);
|
||||
[tokens.start, rest] = util_1.splitSpace(rest);
|
||||
|
||||
if (block === null && rest.startsWith(primitives_1.Markers.start) && !rest.startsWith(primitives_1.Markers.nostart)) {
|
||||
block = [];
|
||||
tokens.delimiter = rest.slice(0, primitives_1.Markers.start.length);
|
||||
rest = rest.slice(primitives_1.Markers.start.length);
|
||||
[tokens.postDelimiter, rest] = util_1.splitSpace(rest);
|
||||
}
|
||||
|
||||
if (block === null) {
|
||||
num++;
|
||||
return null;
|
||||
}
|
||||
|
||||
const isClosed = rest.trimRight().endsWith(primitives_1.Markers.end);
|
||||
|
||||
if (tokens.delimiter === '' && rest.startsWith(primitives_1.Markers.delim) && !rest.startsWith(primitives_1.Markers.end)) {
|
||||
tokens.delimiter = primitives_1.Markers.delim;
|
||||
rest = rest.slice(primitives_1.Markers.delim.length);
|
||||
[tokens.postDelimiter, rest] = util_1.splitSpace(rest);
|
||||
}
|
||||
|
||||
if (isClosed) {
|
||||
const trimmed = rest.trimRight();
|
||||
tokens.end = rest.slice(trimmed.length - primitives_1.Markers.end.length);
|
||||
rest = trimmed.slice(0, -primitives_1.Markers.end.length);
|
||||
}
|
||||
|
||||
tokens.description = rest;
|
||||
block.push({
|
||||
number: num,
|
||||
source,
|
||||
tokens
|
||||
});
|
||||
num++;
|
||||
|
||||
if (isClosed) {
|
||||
const result = block.slice();
|
||||
block = null;
|
||||
return result;
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = getParser;
|
||||
//# sourceMappingURL=source-parser.cjs.map
|
@ -1,29 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
const util_1 = require("../util.cjs");
|
||||
|
||||
function getParser({
|
||||
tokenizers
|
||||
}) {
|
||||
return function parseSpec(source) {
|
||||
var _a;
|
||||
|
||||
let spec = util_1.seedSpec({
|
||||
source
|
||||
});
|
||||
|
||||
for (const tokenize of tokenizers) {
|
||||
spec = tokenize(spec);
|
||||
if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical) break;
|
||||
}
|
||||
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = getParser;
|
||||
//# sourceMappingURL=spec-parser.cjs.map
|
@ -1,61 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getJoiner = void 0;
|
||||
|
||||
const primitives_1 = require("../../primitives.cjs");
|
||||
/**
|
||||
* Makes no changes to `spec.lines[].tokens` but joins them into `spec.description`
|
||||
* following given spacing srtategy
|
||||
* @param {Spacing} spacing tells how to handle the whitespace
|
||||
*/
|
||||
|
||||
|
||||
function descriptionTokenizer(spacing = 'compact') {
|
||||
const join = getJoiner(spacing);
|
||||
return spec => {
|
||||
spec.description = join(spec.source);
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = descriptionTokenizer;
|
||||
|
||||
function getJoiner(spacing) {
|
||||
if (spacing === 'compact') return compactJoiner;
|
||||
if (spacing === 'preserve') return preserveJoiner;
|
||||
return spacing;
|
||||
}
|
||||
|
||||
exports.getJoiner = getJoiner;
|
||||
|
||||
function compactJoiner(lines) {
|
||||
return lines.map(({
|
||||
tokens: {
|
||||
description
|
||||
}
|
||||
}) => description.trim()).filter(description => description !== '').join(' ');
|
||||
}
|
||||
|
||||
const lineNo = (num, {
|
||||
tokens
|
||||
}, i) => tokens.type === '' ? num : i;
|
||||
|
||||
const getDescription = ({
|
||||
tokens
|
||||
}) => (tokens.delimiter === '' ? tokens.start : tokens.postDelimiter.slice(1)) + tokens.description;
|
||||
|
||||
function preserveJoiner(lines) {
|
||||
if (lines.length === 0) return ''; // skip the opening line with no description
|
||||
|
||||
if (lines[0].tokens.description === '' && lines[0].tokens.delimiter === primitives_1.Markers.start) lines = lines.slice(1); // skip the closing line with no description
|
||||
|
||||
const lastLine = lines[lines.length - 1];
|
||||
if (lastLine !== undefined && lastLine.tokens.description === '' && lastLine.tokens.end.endsWith(primitives_1.Markers.end)) lines = lines.slice(0, -1); // description starts at the last line of type definition
|
||||
|
||||
lines = lines.slice(lines.reduce(lineNo, 0));
|
||||
return lines.map(getDescription).join('\n');
|
||||
}
|
||||
//# sourceMappingURL=description.cjs.map
|
@ -1,6 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
//# sourceMappingURL=index.cjs.map
|
@ -1,109 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
const util_1 = require("../../util.cjs");
|
||||
|
||||
const isQuoted = s => s && s.startsWith('"') && s.endsWith('"');
|
||||
/**
|
||||
* Splits remaining `spec.lines[].tokens.description` into `name` and `descriptions` tokens,
|
||||
* and populates the `spec.name`
|
||||
*/
|
||||
|
||||
|
||||
function nameTokenizer() {
|
||||
const typeEnd = (num, {
|
||||
tokens
|
||||
}, i) => tokens.type === '' ? num : i;
|
||||
|
||||
return spec => {
|
||||
// look for the name in the line where {type} ends
|
||||
const {
|
||||
tokens
|
||||
} = spec.source[spec.source.reduce(typeEnd, 0)];
|
||||
const source = tokens.description.trimLeft();
|
||||
const quotedGroups = source.split('"'); // if it starts with quoted group, assume it is a literal
|
||||
|
||||
if (quotedGroups.length > 1 && quotedGroups[0] === '' && quotedGroups.length % 2 === 1) {
|
||||
spec.name = quotedGroups[1];
|
||||
tokens.name = `"${quotedGroups[1]}"`;
|
||||
[tokens.postName, tokens.description] = util_1.splitSpace(source.slice(tokens.name.length));
|
||||
return spec;
|
||||
}
|
||||
|
||||
let brackets = 0;
|
||||
let name = '';
|
||||
let optional = false;
|
||||
let defaultValue; // assume name is non-space string or anything wrapped into brackets
|
||||
|
||||
for (const ch of source) {
|
||||
if (brackets === 0 && util_1.isSpace(ch)) break;
|
||||
if (ch === '[') brackets++;
|
||||
if (ch === ']') brackets--;
|
||||
name += ch;
|
||||
}
|
||||
|
||||
if (brackets !== 0) {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:unpaired-brackets',
|
||||
message: 'unpaired brackets',
|
||||
line: spec.source[0].number,
|
||||
critical: true
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
|
||||
const nameToken = name;
|
||||
|
||||
if (name[0] === '[' && name[name.length - 1] === ']') {
|
||||
optional = true;
|
||||
name = name.slice(1, -1);
|
||||
const parts = name.split('=');
|
||||
name = parts[0].trim();
|
||||
if (parts[1] !== undefined) defaultValue = parts.slice(1).join('=').trim();
|
||||
|
||||
if (name === '') {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:empty-name',
|
||||
message: 'empty name',
|
||||
line: spec.source[0].number,
|
||||
critical: true
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
|
||||
if (defaultValue === '') {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:empty-default',
|
||||
message: 'empty default value',
|
||||
line: spec.source[0].number,
|
||||
critical: true
|
||||
});
|
||||
return spec;
|
||||
} // has "=" and is not a string, except for "=>"
|
||||
|
||||
|
||||
if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) {
|
||||
spec.problems.push({
|
||||
code: 'spec:name:invalid-default',
|
||||
message: 'invalid default value syntax',
|
||||
line: spec.source[0].number,
|
||||
critical: true
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
}
|
||||
|
||||
spec.optional = optional;
|
||||
spec.name = name;
|
||||
tokens.name = nameToken;
|
||||
if (defaultValue !== undefined) spec.default = defaultValue;
|
||||
[tokens.postName, tokens.description] = util_1.splitSpace(source.slice(tokens.name.length));
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = nameTokenizer;
|
||||
//# sourceMappingURL=name.cjs.map
|
@ -1,37 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
/**
|
||||
* Splits the `@prefix` from remaining `Spec.lines[].token.descrioption` into the `tag` token,
|
||||
* and populates `spec.tag`
|
||||
*/
|
||||
|
||||
function tagTokenizer() {
|
||||
return spec => {
|
||||
const {
|
||||
tokens
|
||||
} = spec.source[0];
|
||||
const match = tokens.description.match(/\s*(@(\S+))(\s*)/);
|
||||
|
||||
if (match === null) {
|
||||
spec.problems.push({
|
||||
code: 'spec:tag:prefix',
|
||||
message: 'tag should start with "@" symbol',
|
||||
line: spec.source[0].number,
|
||||
critical: true
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
|
||||
tokens.tag = match[1];
|
||||
tokens.postTag = match[3];
|
||||
tokens.description = tokens.description.slice(match[0].length);
|
||||
spec.tag = match[2];
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = tagTokenizer;
|
||||
//# sourceMappingURL=tag.cjs.map
|
@ -1,79 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
const util_1 = require("../../util.cjs");
|
||||
/**
|
||||
* Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description`
|
||||
* tokens and populates Spec.type`
|
||||
*
|
||||
* @param {Spacing} spacing tells how to deal with a whitespace
|
||||
* for type values going over multiple lines
|
||||
*/
|
||||
|
||||
|
||||
function typeTokenizer(spacing = 'compact') {
|
||||
const join = getJoiner(spacing);
|
||||
return spec => {
|
||||
let curlies = 0;
|
||||
let lines = [];
|
||||
|
||||
for (const [i, {
|
||||
tokens
|
||||
}] of spec.source.entries()) {
|
||||
let type = '';
|
||||
if (i === 0 && tokens.description[0] !== '{') return spec;
|
||||
|
||||
for (const ch of tokens.description) {
|
||||
if (ch === '{') curlies++;
|
||||
if (ch === '}') curlies--;
|
||||
type += ch;
|
||||
if (curlies === 0) break;
|
||||
}
|
||||
|
||||
lines.push([tokens, type]);
|
||||
if (curlies === 0) break;
|
||||
}
|
||||
|
||||
if (curlies !== 0) {
|
||||
spec.problems.push({
|
||||
code: 'spec:type:unpaired-curlies',
|
||||
message: 'unpaired curlies',
|
||||
line: spec.source[0].number,
|
||||
critical: true
|
||||
});
|
||||
return spec;
|
||||
}
|
||||
|
||||
const parts = [];
|
||||
const offset = lines[0][0].postDelimiter.length;
|
||||
|
||||
for (const [i, [tokens, type]] of lines.entries()) {
|
||||
tokens.type = type;
|
||||
|
||||
if (i > 0) {
|
||||
tokens.type = tokens.postDelimiter.slice(offset) + type;
|
||||
tokens.postDelimiter = tokens.postDelimiter.slice(0, offset);
|
||||
}
|
||||
|
||||
[tokens.postType, tokens.description] = util_1.splitSpace(tokens.description.slice(type.length));
|
||||
parts.push(tokens.type);
|
||||
}
|
||||
|
||||
parts[0] = parts[0].slice(1);
|
||||
parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1);
|
||||
spec.type = join(parts);
|
||||
return spec;
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = typeTokenizer;
|
||||
|
||||
const trim = x => x.trim();
|
||||
|
||||
function getJoiner(spacing) {
|
||||
if (spacing === 'compact') return t => t.map(trim).join('');else if (spacing === 'preserve') return t => t.join('\n');else return spacing;
|
||||
}
|
||||
//# sourceMappingURL=type.cjs.map
|
@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Markers = void 0;
|
||||
var Markers;
|
||||
|
||||
(function (Markers) {
|
||||
Markers["start"] = "/**";
|
||||
Markers["nostart"] = "/***";
|
||||
Markers["delim"] = "*";
|
||||
Markers["end"] = "*/";
|
||||
})(Markers = exports.Markers || (exports.Markers = {}));
|
||||
//# sourceMappingURL=primitives.cjs.map
|
@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
function join(tokens) {
|
||||
return tokens.start + tokens.delimiter + tokens.postDelimiter + tokens.tag + tokens.postTag + tokens.type + tokens.postType + tokens.name + tokens.postName + tokens.description + tokens.end + tokens.lineEnd;
|
||||
}
|
||||
|
||||
function getStringifier() {
|
||||
return block => block.source.map(({
|
||||
tokens
|
||||
}) => join(tokens)).join('\n');
|
||||
}
|
||||
|
||||
exports.default = getStringifier;
|
||||
//# sourceMappingURL=index.cjs.map
|
@ -1,72 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
const util_1 = require("../util.cjs");
|
||||
|
||||
const zeroWidth = {
|
||||
line: 0,
|
||||
start: 0,
|
||||
delimiter: 0,
|
||||
postDelimiter: 0,
|
||||
tag: 0,
|
||||
postTag: 0,
|
||||
name: 0,
|
||||
postName: 0,
|
||||
type: 0,
|
||||
postType: 0,
|
||||
description: 0,
|
||||
end: 0,
|
||||
lineEnd: 0
|
||||
};
|
||||
const headers = {
|
||||
lineEnd: 'CR'
|
||||
};
|
||||
const fields = Object.keys(zeroWidth);
|
||||
|
||||
const repr = x => util_1.isSpace(x) ? `{${x.length}}` : x;
|
||||
|
||||
const frame = line => '|' + line.join('|') + '|';
|
||||
|
||||
const align = (width, tokens) => Object.keys(tokens).map(k => repr(tokens[k]).padEnd(width[k]));
|
||||
|
||||
function inspect({
|
||||
source
|
||||
}) {
|
||||
var _a, _b;
|
||||
|
||||
if (source.length === 0) return '';
|
||||
const width = Object.assign({}, zeroWidth);
|
||||
|
||||
for (const f of fields) width[f] = ((_a = headers[f]) !== null && _a !== void 0 ? _a : f).length;
|
||||
|
||||
for (const {
|
||||
number,
|
||||
tokens
|
||||
} of source) {
|
||||
width.line = Math.max(width.line, number.toString().length);
|
||||
|
||||
for (const k in tokens) width[k] = Math.max(width[k], repr(tokens[k]).length);
|
||||
}
|
||||
|
||||
const lines = [[], []];
|
||||
|
||||
for (const f of fields) lines[0].push(((_b = headers[f]) !== null && _b !== void 0 ? _b : f).padEnd(width[f]));
|
||||
|
||||
for (const f of fields) lines[1].push('-'.padEnd(width[f], '-'));
|
||||
|
||||
for (const {
|
||||
number,
|
||||
tokens
|
||||
} of source) {
|
||||
const line = number.toString().padStart(width.line);
|
||||
lines.push([line, ...align(width, tokens)]);
|
||||
}
|
||||
|
||||
return lines.map(frame).join('\n');
|
||||
}
|
||||
|
||||
exports.default = inspect;
|
||||
//# sourceMappingURL=inspect.cjs.map
|
@ -1,127 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var __rest = this && this.__rest || function (s, e) {
|
||||
var t = {};
|
||||
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
const primitives_1 = require("../primitives.cjs");
|
||||
|
||||
const util_1 = require("../util.cjs");
|
||||
|
||||
const zeroWidth = {
|
||||
start: 0,
|
||||
tag: 0,
|
||||
type: 0,
|
||||
name: 0
|
||||
};
|
||||
|
||||
const getWidth = (w, {
|
||||
tokens: t
|
||||
}) => ({
|
||||
start: t.delimiter === primitives_1.Markers.start ? t.start.length : w.start,
|
||||
tag: Math.max(w.tag, t.tag.length),
|
||||
type: Math.max(w.type, t.type.length),
|
||||
name: Math.max(w.name, t.name.length)
|
||||
});
|
||||
|
||||
const space = len => ''.padStart(len, ' ');
|
||||
|
||||
function align() {
|
||||
let intoTags = false;
|
||||
let w;
|
||||
|
||||
function update(line) {
|
||||
const tokens = Object.assign({}, line.tokens);
|
||||
if (tokens.tag !== '') intoTags = true;
|
||||
const isEmpty = tokens.tag === '' && tokens.name === '' && tokens.type === '' && tokens.description === ''; // dangling '*/'
|
||||
|
||||
if (tokens.end === primitives_1.Markers.end && isEmpty) {
|
||||
tokens.start = space(w.start + 1);
|
||||
return Object.assign(Object.assign({}, line), {
|
||||
tokens
|
||||
});
|
||||
}
|
||||
|
||||
switch (tokens.delimiter) {
|
||||
case primitives_1.Markers.start:
|
||||
tokens.start = space(w.start);
|
||||
break;
|
||||
|
||||
case primitives_1.Markers.delim:
|
||||
tokens.start = space(w.start + 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
tokens.delimiter = '';
|
||||
tokens.start = space(w.start + 2);
|
||||
// compensate delimiter
|
||||
}
|
||||
|
||||
if (!intoTags) {
|
||||
tokens.postDelimiter = tokens.description === '' ? '' : ' ';
|
||||
return Object.assign(Object.assign({}, line), {
|
||||
tokens
|
||||
});
|
||||
}
|
||||
|
||||
const nothingAfter = {
|
||||
delim: false,
|
||||
tag: false,
|
||||
type: false,
|
||||
name: false
|
||||
};
|
||||
|
||||
if (tokens.description === '') {
|
||||
nothingAfter.name = true;
|
||||
tokens.postName = '';
|
||||
|
||||
if (tokens.name === '') {
|
||||
nothingAfter.type = true;
|
||||
tokens.postType = '';
|
||||
|
||||
if (tokens.type === '') {
|
||||
nothingAfter.tag = true;
|
||||
tokens.postTag = '';
|
||||
|
||||
if (tokens.tag === '') {
|
||||
nothingAfter.delim = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tokens.postDelimiter = nothingAfter.delim ? '' : ' ';
|
||||
if (!nothingAfter.tag) tokens.postTag = space(w.tag - tokens.tag.length + 1);
|
||||
if (!nothingAfter.type) tokens.postType = space(w.type - tokens.type.length + 1);
|
||||
if (!nothingAfter.name) tokens.postName = space(w.name - tokens.name.length + 1);
|
||||
return Object.assign(Object.assign({}, line), {
|
||||
tokens
|
||||
});
|
||||
}
|
||||
|
||||
return _a => {
|
||||
var {
|
||||
source
|
||||
} = _a,
|
||||
fields = __rest(_a, ["source"]);
|
||||
|
||||
w = source.reduce(getWidth, Object.assign({}, zeroWidth));
|
||||
return util_1.rewireSource(Object.assign(Object.assign({}, fields), {
|
||||
source: source.map(update)
|
||||
}));
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = align;
|
||||
//# sourceMappingURL=align.cjs.map
|
@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var __rest = this && this.__rest || function (s, e) {
|
||||
var t = {};
|
||||
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
const util_1 = require("../util.cjs");
|
||||
|
||||
const order = ['end', 'description', 'postType', 'type', 'postName', 'name', 'postTag', 'tag', 'postDelimiter', 'delimiter', 'start'];
|
||||
|
||||
function crlf(ending) {
|
||||
function update(line) {
|
||||
return Object.assign(Object.assign({}, line), {
|
||||
tokens: Object.assign(Object.assign({}, line.tokens), {
|
||||
lineEnd: ending === 'LF' ? '' : '\r'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
return _a => {
|
||||
var {
|
||||
source
|
||||
} = _a,
|
||||
fields = __rest(_a, ["source"]);
|
||||
|
||||
return util_1.rewireSource(Object.assign(Object.assign({}, fields), {
|
||||
source: source.map(update)
|
||||
}));
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = crlf;
|
||||
//# sourceMappingURL=crlf.cjs.map
|
@ -1,58 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var __rest = this && this.__rest || function (s, e) {
|
||||
var t = {};
|
||||
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
const util_1 = require("../util.cjs");
|
||||
|
||||
const pull = offset => str => str.slice(offset);
|
||||
|
||||
const push = offset => {
|
||||
const space = ''.padStart(offset, ' ');
|
||||
return str => str + space;
|
||||
};
|
||||
|
||||
function indent(pos) {
|
||||
let shift;
|
||||
|
||||
const pad = start => {
|
||||
if (shift === undefined) {
|
||||
const offset = pos - start.length;
|
||||
shift = offset > 0 ? push(offset) : pull(-offset);
|
||||
}
|
||||
|
||||
return shift(start);
|
||||
};
|
||||
|
||||
const update = line => Object.assign(Object.assign({}, line), {
|
||||
tokens: Object.assign(Object.assign({}, line.tokens), {
|
||||
start: pad(line.tokens.start)
|
||||
})
|
||||
});
|
||||
|
||||
return _a => {
|
||||
var {
|
||||
source
|
||||
} = _a,
|
||||
fields = __rest(_a, ["source"]);
|
||||
|
||||
return util_1.rewireSource(Object.assign(Object.assign({}, fields), {
|
||||
source: source.map(update)
|
||||
}));
|
||||
};
|
||||
}
|
||||
|
||||
exports.default = indent;
|
||||
//# sourceMappingURL=indent.cjs.map
|
@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.flow = void 0;
|
||||
|
||||
function flow(...transforms) {
|
||||
return block => transforms.reduce((block, t) => t(block), block);
|
||||
}
|
||||
|
||||
exports.flow = flow;
|
||||
//# sourceMappingURL=index.cjs.map
|
@ -1,113 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.rewireSpecs = exports.rewireSource = exports.seedTokens = exports.seedSpec = exports.seedBlock = exports.splitLines = exports.splitSpace = exports.splitCR = exports.hasCR = exports.isSpace = void 0;
|
||||
|
||||
function isSpace(source) {
|
||||
return /^\s+$/.test(source);
|
||||
}
|
||||
|
||||
exports.isSpace = isSpace;
|
||||
|
||||
function hasCR(source) {
|
||||
return /\r$/.test(source);
|
||||
}
|
||||
|
||||
exports.hasCR = hasCR;
|
||||
|
||||
function splitCR(source) {
|
||||
const matches = source.match(/\r+$/);
|
||||
return matches == null ? ['', source] : [source.slice(-matches[0].length), source.slice(0, -matches[0].length)];
|
||||
}
|
||||
|
||||
exports.splitCR = splitCR;
|
||||
|
||||
function splitSpace(source) {
|
||||
const matches = source.match(/^\s+/);
|
||||
return matches == null ? ['', source] : [source.slice(0, matches[0].length), source.slice(matches[0].length)];
|
||||
}
|
||||
|
||||
exports.splitSpace = splitSpace;
|
||||
|
||||
function splitLines(source) {
|
||||
return source.split(/\n/);
|
||||
}
|
||||
|
||||
exports.splitLines = splitLines;
|
||||
|
||||
function seedBlock(block = {}) {
|
||||
return Object.assign({
|
||||
description: '',
|
||||
tags: [],
|
||||
source: [],
|
||||
problems: []
|
||||
}, block);
|
||||
}
|
||||
|
||||
exports.seedBlock = seedBlock;
|
||||
|
||||
function seedSpec(spec = {}) {
|
||||
return Object.assign({
|
||||
tag: '',
|
||||
name: '',
|
||||
type: '',
|
||||
optional: false,
|
||||
description: '',
|
||||
problems: [],
|
||||
source: []
|
||||
}, spec);
|
||||
}
|
||||
|
||||
exports.seedSpec = seedSpec;
|
||||
|
||||
function seedTokens(tokens = {}) {
|
||||
return Object.assign({
|
||||
start: '',
|
||||
delimiter: '',
|
||||
postDelimiter: '',
|
||||
tag: '',
|
||||
postTag: '',
|
||||
name: '',
|
||||
postName: '',
|
||||
type: '',
|
||||
postType: '',
|
||||
description: '',
|
||||
end: '',
|
||||
lineEnd: ''
|
||||
}, tokens);
|
||||
}
|
||||
|
||||
exports.seedTokens = seedTokens;
|
||||
/**
|
||||
* Assures Block.tags[].source contains references to the Block.source items,
|
||||
* using Block.source as a source of truth. This is a counterpart of rewireSpecs
|
||||
* @param block parsed coments block
|
||||
*/
|
||||
|
||||
function rewireSource(block) {
|
||||
const source = block.source.reduce((acc, line) => acc.set(line.number, line), new Map());
|
||||
|
||||
for (const spec of block.tags) {
|
||||
spec.source = spec.source.map(line => source.get(line.number));
|
||||
}
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
exports.rewireSource = rewireSource;
|
||||
/**
|
||||
* Assures Block.source contains references to the Block.tags[].source items,
|
||||
* using Block.tags[].source as a source of truth. This is a counterpart of rewireSource
|
||||
* @param block parsed coments block
|
||||
*/
|
||||
|
||||
function rewireSpecs(block) {
|
||||
const source = block.tags.reduce((acc, spec) => spec.source.reduce((acc, line) => acc.set(line.number, line), acc), new Map());
|
||||
block.source = block.source.map(line => source.get(line.number) || line);
|
||||
return block;
|
||||
}
|
||||
|
||||
exports.rewireSpecs = rewireSpecs;
|
||||
//# sourceMappingURL=util.cjs.map
|
@ -1,105 +0,0 @@
|
||||
# Migrating 0.x to 1.x
|
||||
|
||||
## Parser
|
||||
|
||||
0.x can be mostly translated into 1.x one way or another. The idea behind the new config structure is to handle only the most common cases, and provide the fallback for alternative implementation.
|
||||
|
||||
### `dotted_names: boolean`
|
||||
|
||||
> By default dotted names like `name.subname.subsubname` will be expanded into nested sections, this can be prevented by passing opts.dotted_names = false.
|
||||
|
||||
**Removed** This feature is removed but still can be done on top of the `parse()` output. Please post a request or contribute a PR if you need it.
|
||||
|
||||
### `trim: boolean`
|
||||
|
||||
> Set this to false to avoid the default of trimming whitespace at the start and end of each line.
|
||||
|
||||
In the new parser all original spacing is kept along with comment lines in `.source`. Description lines are joined together depending on `spacing` option
|
||||
|
||||
**New option:**
|
||||
|
||||
- `spacing: "compact"` lines concatenated with a single space and no line breaks
|
||||
- `spacing: "preserve"` keeps line breaks and space around as is. Indentation space counts from `*` delimiter or from the start of the line if the delimiter is omitted
|
||||
- `spacing: (lines: Line[]) => string` completely freeform joining strategy, since all original spacing can be accessed, there is no limit to how this can be implemented. See [primitives.ts](./src/primitives.ts) and [spacer.ts](./src/parser/spacer.ts)
|
||||
|
||||
### `join: string | number | boolean`
|
||||
|
||||
> If the following lines of a multiline comment do not start with a star, `join` will have the following effect on tag source (and description) when joining the lines together:
|
||||
>
|
||||
> - If a string, use that string in place of the leading whitespace (and avoid newlines).
|
||||
> - If a non-zero number (e.g., 1), do no trimming and avoid newlines.
|
||||
> - If undefined, false, or 0, use the default behavior of not trimming but adding a newline.
|
||||
> - Otherwise (e.g., if join is true), replace any leading whitespace with a single space and avoid newlines.
|
||||
>
|
||||
> Note that if a multi-line comment has lines that start with a star, these will be appended with initial whitespace as is and with newlines regardless of the join setting.
|
||||
|
||||
See the `spacing` option above, all the variations can be fine-tunned with `spacing: (lines: Line[]) => string`
|
||||
|
||||
### `fence: string | RegExp | ((source: string) => boolean)`
|
||||
|
||||
> Set to a string or regular expression to toggle state upon finding an odd number of matches within a line. Defaults to ```.
|
||||
>
|
||||
> If set to a function, it should return true to toggle fenced state; upon returning true the first time, this will prevent subsequent lines from being interpreted as starting a new jsdoc tag until such time as the function returns true again to indicate that the state has toggled back.
|
||||
|
||||
This is mostly kept the same
|
||||
|
||||
**New optoins:**
|
||||
|
||||
- ```` fence: '```' ```` same as 0.x
|
||||
- `fencer: (source: string) => boolean` same as 0.x, see [parser/block-parser.ts](./src/parser/block-parser.ts)
|
||||
|
||||
### `parsers: Parser[]`
|
||||
|
||||
> In case you need to parse tags in different way you can pass opts.parsers = [parser1, ..., parserN], where each parser is function name(str:String, data:Object):{source:String, data:Object}.
|
||||
> ...
|
||||
|
||||
**New options:**
|
||||
|
||||
- `tokenizers: []Tokenizer` is a list of functions extracting the `tag`, `type`, `name` and `description` tokens from this string. See [parser/spec-parser.ts](./src/parser/spec-parser.ts) and [primitives.ts](./src/primitives.ts)
|
||||
|
||||
Default tokenizers chain is
|
||||
|
||||
```js
|
||||
[
|
||||
tagTokenizer(),
|
||||
typeTokenizer(),
|
||||
nameTokenizer(),
|
||||
descriptionTokenizer(getSpacer(spacing)),
|
||||
]
|
||||
```
|
||||
|
||||
where
|
||||
|
||||
```ts
|
||||
type Tokenizer = (spec: Spec) => Spec
|
||||
|
||||
interface Spec {
|
||||
tag: string;
|
||||
name: string;
|
||||
default?: string;
|
||||
type: string;
|
||||
optional: boolean;
|
||||
description: string;
|
||||
problems: Problem[];
|
||||
source: Line[];
|
||||
}
|
||||
```
|
||||
|
||||
chain starts with blank `Spec` and each tokenizer fulfills a piece using `.source` input
|
||||
|
||||
## Stringifier
|
||||
|
||||
> One may also convert comment-parser JSON structures back into strings using the stringify method (stringify(o: (object|Array) [, opts: object]): string).
|
||||
> ...
|
||||
|
||||
Stringifier config follows the same strategy – a couple of common cases, and freeform formatter as a fallback
|
||||
|
||||
**New Options:**
|
||||
|
||||
- `format: "none"` re-assembles the source with original spacing and delimiters preserved
|
||||
- `format: "align"` aligns tag, name, type, and descriptions into fixed-width columns
|
||||
- `format: (tokens: Tokens) => string[]` do what you like, resulting lines will be concatenated into the output. Despite the simple interface, this can be turned into a complex stateful formatter, see `"align"` implementation in [transforms/align.ts](./src/transforms/align.ts)
|
||||
|
||||
## Stream
|
||||
|
||||
Work in progress
|
@ -1,85 +0,0 @@
|
||||
{
|
||||
"name": "comment-parser",
|
||||
"version": "1.2.4",
|
||||
"description": "Generic JSDoc-like comment parser",
|
||||
"type": "module",
|
||||
"main": "lib/index.cjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./es6/index.js",
|
||||
"require": "./lib/index.cjs"
|
||||
},
|
||||
"./primitives": {
|
||||
"import": "./es6/primitives.js",
|
||||
"require": "./lib/primitives.cjs"
|
||||
},
|
||||
"./util": {
|
||||
"import": "./es6/util.js",
|
||||
"require": "./lib/util.cjs"
|
||||
},
|
||||
"./parser/*": {
|
||||
"import": "./es6/parser/*.js",
|
||||
"require": "./lib/parser/*.cjs"
|
||||
},
|
||||
"./stringifier/*": {
|
||||
"import": "./es6/stringifier/*.js",
|
||||
"require": "./lib/stringifier/*.cjs"
|
||||
},
|
||||
"./transforms/*": {
|
||||
"import": "./es6/transforms/*.js",
|
||||
"require": "./lib/transforms/*.cjs"
|
||||
}
|
||||
},
|
||||
"types": "lib/index.d.ts",
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.23",
|
||||
"convert-extension": "^0.3.0",
|
||||
"jest": "^27.0.5",
|
||||
"prettier": "2.3.1",
|
||||
"replace": "^1.2.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^2.52.2",
|
||||
"ts-jest": "^27.0.3",
|
||||
"typescript": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rimraf lib es6 browser; tsc -p tsconfig.json && tsc -p tsconfig.node.json && rollup -o browser/index.js -f iife --context window -n CommentParser es6/index.js && convert-extension cjs lib/ && cd es6 && replace \"from '(\\.[^']*)'\" \"from '\\$1.js'\" * -r --include=\"*.js\"",
|
||||
"format": "prettier --write src tests",
|
||||
"pretest": "rimraf coverage; npm run build",
|
||||
"test": "prettier --check src tests && jest --verbose",
|
||||
"preversion": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:yavorskiy/comment-parser.git"
|
||||
},
|
||||
"keywords": [
|
||||
"jsdoc",
|
||||
"comments",
|
||||
"parser"
|
||||
],
|
||||
"author": "Sergiy Yavorsky <sergiy@yavorsky.me> (https://github.com/syavorsky)",
|
||||
"contributors": [
|
||||
"Alexej Yaroshevich (https://github.com/zxqfox)",
|
||||
"Andre Wachsmuth (https://github.com/blutorange)",
|
||||
"Brett Zamir (https://github.com/brettz9)",
|
||||
"Dieter Oberkofler (https://github.com/doberkofler)",
|
||||
"Evgeny Reznichenko (https://github.com/zxcabs)",
|
||||
"Javier \"Ciberma\" Mora (https://github.com/jhm-ciberman)",
|
||||
"Jordan Harband (https://github.com/ljharb)",
|
||||
"tengattack (https://github.com/tengattack)",
|
||||
"Jayden Seric (https://github.com/jaydenseric)"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/syavorsky/comment-parser/issues"
|
||||
},
|
||||
"homepage": "https://github.com/syavorsky/comment-parser",
|
||||
"dependencies": {}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2015",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"declaration": true,
|
||||
"outDir": "./lib",
|
||||
"lib": ["es2016", "es5"]
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
30
tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/package.json
generated
vendored
30
tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@es-joy/jsdoccomment",
|
||||
"version": "0.12.0",
|
||||
"version": "0.13.0",
|
||||
"author": "Brett Zamir <brettz9@yahoo.com>",
|
||||
"contributors": [],
|
||||
"description": "Maintained replacement for ESLint's deprecated SourceCode#getJSDocComment along with other jsdoc utilities",
|
||||
@ -37,36 +37,36 @@
|
||||
"node": "^12 || ^14 || ^16 || ^17"
|
||||
},
|
||||
"dependencies": {
|
||||
"comment-parser": "1.2.4",
|
||||
"comment-parser": "1.3.0",
|
||||
"esquery": "^1.4.0",
|
||||
"jsdoc-type-pratt-parser": "2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.15.8",
|
||||
"@babel/core": "^7.16.0",
|
||||
"@babel/plugin-syntax-class-properties": "^7.12.13",
|
||||
"@babel/preset-env": "^7.15.8",
|
||||
"@brettz9/eslint-plugin": "^1.0.3",
|
||||
"@babel/preset-env": "^7.16.4",
|
||||
"@brettz9/eslint-plugin": "^1.0.4",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"c8": "^7.10.0",
|
||||
"chai": "^4.3.4",
|
||||
"eslint": "^8.0.1",
|
||||
"eslint-config-ash-nazg": "31.2.2",
|
||||
"eslint": "^8.4.1",
|
||||
"eslint-config-ash-nazg": "32.1.0",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"eslint-plugin-array-func": "^3.1.7",
|
||||
"eslint-plugin-compat": "^3.13.0",
|
||||
"eslint-plugin-compat": "^4.0.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-html": "^6.2.0",
|
||||
"eslint-plugin-import": "^2.25.2",
|
||||
"eslint-plugin-jsdoc": "^36.1.1",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"eslint-plugin-jsdoc": "^37.1.0",
|
||||
"eslint-plugin-markdown": "^2.2.1",
|
||||
"eslint-plugin-no-unsanitized": "^3.2.0",
|
||||
"eslint-plugin-no-unsanitized": "^4.0.0",
|
||||
"eslint-plugin-no-use-extend-native": "^0.5.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^5.1.1",
|
||||
"eslint-plugin-sonarjs": "^0.10.0",
|
||||
"eslint-plugin-unicorn": "^37.0.1",
|
||||
"eslint-plugin-promise": "^5.2.0",
|
||||
"eslint-plugin-sonarjs": "^0.11.0",
|
||||
"eslint-plugin-unicorn": "^39.0.0",
|
||||
"mocha": "^9.1.3",
|
||||
"rollup": "^2.58.0"
|
||||
"rollup": "^2.61.0"
|
||||
},
|
||||
"scripts": {
|
||||
"rollup": "rollup -c",
|
||||
|
3
tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/jsdoccomment.js
generated
vendored
3
tools/node_modules/eslint/node_modules/@es-joy/jsdoccomment/src/jsdoccomment.js
generated
vendored
@ -117,7 +117,8 @@ const allowableCommentNode = new Set([
|
||||
'Property',
|
||||
'ObjectProperty',
|
||||
'ClassProperty',
|
||||
'PropertyDefinition'
|
||||
'PropertyDefinition',
|
||||
'ExportDefaultDeclaration'
|
||||
]);
|
||||
|
||||
/**
|
||||
|
7
tools/node_modules/eslint/node_modules/browserslist/cli.js
generated
vendored
7
tools/node_modules/eslint/node_modules/browserslist/cli.js
generated
vendored
@ -39,6 +39,7 @@ if (isArg('--help') || isArg('-h')) {
|
||||
} else if (isArg('--version') || isArg('-v')) {
|
||||
process.stdout.write('browserslist ' + pkg.version + '\n')
|
||||
} else if (isArg('--update-db')) {
|
||||
/* c8 ignore next 3 */
|
||||
updateDb(function (str) {
|
||||
process.stdout.write(str)
|
||||
})
|
||||
@ -76,8 +77,10 @@ if (isArg('--help') || isArg('-h')) {
|
||||
} else if (name === '--json') {
|
||||
mode = 'json'
|
||||
} else if (name === '--mobile-to-desktop') {
|
||||
/* c8 ignore next */
|
||||
opts.mobileToDesktop = true
|
||||
} else if (name === '--ignore-unknown-versions') {
|
||||
/* c8 ignore next */
|
||||
opts.ignoreUnknownVersions = true
|
||||
} else {
|
||||
error('Unknown arguments ' + args[i] + '.\n\n' + USAGE)
|
||||
@ -90,9 +93,9 @@ if (isArg('--help') || isArg('-h')) {
|
||||
} catch (e) {
|
||||
if (e.name === 'BrowserslistError') {
|
||||
error(e.message)
|
||||
} else {
|
||||
} else /* c8 ignore start */ {
|
||||
throw e
|
||||
}
|
||||
} /* c8 ignore end */
|
||||
}
|
||||
|
||||
var coverage
|
||||
|
42
tools/node_modules/eslint/node_modules/browserslist/index.js
generated
vendored
42
tools/node_modules/eslint/node_modules/browserslist/index.js
generated
vendored
@ -397,6 +397,7 @@ var cache = {}
|
||||
* version in direct query.
|
||||
* @param {boolean} [opts.dangerousExtend] Disable security checks
|
||||
* for extend query.
|
||||
* @param {boolean} [opts.throwOnMissing] Throw error on missing env.
|
||||
* @param {boolean} [opts.mobileToDesktop] Alias mobile browsers to the desktop
|
||||
* version when Can I Use doesn't have
|
||||
* data about the specified version.
|
||||
@ -665,7 +666,7 @@ function coverQuery(context, coverage, statMode) {
|
||||
var coveraged = 0
|
||||
var result = []
|
||||
var version
|
||||
for (var i = 0; i <= versions.length; i++) {
|
||||
for (var i = 0; i < versions.length; i++) {
|
||||
version = versions[i]
|
||||
if (usage[version] === 0) break
|
||||
coveraged += usage[version]
|
||||
@ -831,19 +832,24 @@ var QUERIES = [
|
||||
}
|
||||
var usage = context.customUsage
|
||||
return Object.keys(usage).reduce(function (result, version) {
|
||||
var percentage = usage[version]
|
||||
if (percentage == null) {
|
||||
return result
|
||||
}
|
||||
|
||||
if (sign === '>') {
|
||||
if (usage[version] > popularity) {
|
||||
if (percentage > popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
} else if (sign === '<') {
|
||||
if (usage[version] < popularity) {
|
||||
if (percentage < popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
} else if (sign === '<=') {
|
||||
if (usage[version] <= popularity) {
|
||||
if (percentage <= popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
} else if (usage[version] >= popularity) {
|
||||
} else if (percentage >= popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
return result
|
||||
@ -866,19 +872,24 @@ var QUERIES = [
|
||||
}
|
||||
var usage = context.customUsage
|
||||
return Object.keys(usage).reduce(function (result, version) {
|
||||
var percentage = usage[version]
|
||||
if (percentage == null) {
|
||||
return result
|
||||
}
|
||||
|
||||
if (sign === '>') {
|
||||
if (usage[version] > popularity) {
|
||||
if (percentage > popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
} else if (sign === '<') {
|
||||
if (usage[version] < popularity) {
|
||||
if (percentage < popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
} else if (sign === '<=') {
|
||||
if (usage[version] <= popularity) {
|
||||
if (percentage <= popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
} else if (usage[version] >= popularity) {
|
||||
} else if (percentage >= popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
return result
|
||||
@ -897,19 +908,24 @@ var QUERIES = [
|
||||
env.loadCountry(browserslist.usage, place, browserslist.data)
|
||||
var usage = browserslist.usage[place]
|
||||
return Object.keys(usage).reduce(function (result, version) {
|
||||
var percentage = usage[version]
|
||||
if (percentage == null) {
|
||||
return result
|
||||
}
|
||||
|
||||
if (sign === '>') {
|
||||
if (usage[version] > popularity) {
|
||||
if (percentage > popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
} else if (sign === '<') {
|
||||
if (usage[version] < popularity) {
|
||||
if (percentage < popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
} else if (sign === '<=') {
|
||||
if (usage[version] <= popularity) {
|
||||
if (percentage <= popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
} else if (usage[version] >= popularity) {
|
||||
} else if (percentage >= popularity) {
|
||||
result.push(version)
|
||||
}
|
||||
return result
|
||||
|
8
tools/node_modules/eslint/node_modules/browserslist/node.js
generated
vendored
8
tools/node_modules/eslint/node_modules/browserslist/node.js
generated
vendored
@ -82,6 +82,14 @@ function pickEnv(config, opts) {
|
||||
name = 'production'
|
||||
}
|
||||
|
||||
if (opts.throwOnMissing) {
|
||||
if (name && name !== 'defaults' && !config[name]) {
|
||||
throw new BrowserslistError(
|
||||
'Missing config for Browserslist environment `' + name + '`'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return config[name] || config.defaults
|
||||
}
|
||||
|
||||
|
7
tools/node_modules/eslint/node_modules/browserslist/package.json
generated
vendored
7
tools/node_modules/eslint/node_modules/browserslist/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "browserslist",
|
||||
"version": "4.18.1",
|
||||
"version": "4.19.1",
|
||||
"description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
|
||||
"keywords": [
|
||||
"caniuse",
|
||||
@ -15,8 +15,8 @@
|
||||
"license": "MIT",
|
||||
"repository": "browserslist/browserslist",
|
||||
"dependencies": {
|
||||
"caniuse-lite": "^1.0.30001280",
|
||||
"electron-to-chromium": "^1.3.896",
|
||||
"caniuse-lite": "^1.0.30001286",
|
||||
"electron-to-chromium": "^1.4.17",
|
||||
"escalade": "^3.1.1",
|
||||
"node-releases": "^2.0.1",
|
||||
"picocolors": "^1.0.0"
|
||||
@ -24,6 +24,7 @@
|
||||
"engines": {
|
||||
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
|
||||
},
|
||||
"packageManager": "pnpm@6.23.6",
|
||||
"bin": {
|
||||
"browserslist": "cli.js"
|
||||
},
|
||||
|
77
tools/node_modules/eslint/node_modules/browserslist/update-db.js
generated
vendored
77
tools/node_modules/eslint/node_modules/browserslist/update-db.js
generated
vendored
@ -151,12 +151,14 @@ function updateYarnLockfile(lock, latest) {
|
||||
/resolved "[^"]+"/,
|
||||
'resolved "' + latest.dist.tarball + '"'
|
||||
)
|
||||
lines[3] = latest.dist.integrity
|
||||
? lines[3].replace(
|
||||
/integrity .+/,
|
||||
'integrity ' + latest.dist.integrity
|
||||
)
|
||||
: ''
|
||||
if (lines.length === 4) {
|
||||
lines[3] = latest.dist.integrity
|
||||
? lines[3].replace(
|
||||
/integrity .+/,
|
||||
'integrity ' + latest.dist.integrity
|
||||
)
|
||||
: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -179,6 +181,7 @@ function updatePnpmLockfile(lock, latest) {
|
||||
if (lines[i].indexOf('caniuse-lite:') >= 0) {
|
||||
lineParts = lines[i].split(/:\s?/, 2)
|
||||
if (lineParts[1].indexOf('/') >= 0) {
|
||||
/* c8 ignore start */
|
||||
var sublineParts = lineParts[1].split(/([/:])/)
|
||||
for (j = 0; j < sublineParts.length; j++) {
|
||||
if (sublineParts[j].indexOf('caniuse-lite') >= 0) {
|
||||
@ -188,6 +191,7 @@ function updatePnpmLockfile(lock, latest) {
|
||||
}
|
||||
}
|
||||
lineParts[1] = sublineParts.join('')
|
||||
/* c8 ignore stop */
|
||||
} else {
|
||||
versions[lineParts[1]] = true
|
||||
}
|
||||
@ -220,12 +224,13 @@ function updatePnpmLockfile(lock, latest) {
|
||||
function updateLockfile(lock, latest) {
|
||||
if (!lock.content) lock.content = fs.readFileSync(lock.file).toString()
|
||||
|
||||
if (lock.mode === 'npm') {
|
||||
return updateNpmLockfile(lock, latest)
|
||||
} else if (lock.mode === 'yarn') {
|
||||
if (lock.mode === 'yarn') {
|
||||
return updateYarnLockfile(lock, latest)
|
||||
} else if (lock.mode === 'pnpm') {
|
||||
return updatePnpmLockfile(lock, latest)
|
||||
} else {
|
||||
return updateNpmLockfile(lock, latest)
|
||||
}
|
||||
return updatePnpmLockfile(lock, latest)
|
||||
}
|
||||
|
||||
function updatePackageManually(print, lock, latest) {
|
||||
@ -262,7 +267,7 @@ function updatePackageManually(print, lock, latest) {
|
||||
)
|
||||
try {
|
||||
childProcess.execSync(install + ' caniuse-lite')
|
||||
} catch (e) /* istanbul ignore next */ {
|
||||
} catch (e) /* c8 ignore start */ {
|
||||
print(
|
||||
pico.red(
|
||||
'\n' +
|
||||
@ -275,7 +280,7 @@ function updatePackageManually(print, lock, latest) {
|
||||
)
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
} /* c8 ignore end */
|
||||
|
||||
var del = lock.mode === 'yarn' ? 'yarn remove -W' : lock.mode + ' uninstall'
|
||||
print(
|
||||
@ -286,6 +291,27 @@ function updatePackageManually(print, lock, latest) {
|
||||
childProcess.execSync(del + ' caniuse-lite')
|
||||
}
|
||||
|
||||
function updateWith(print, cmd) {
|
||||
print('Updating caniuse-lite version\n' + pico.yellow('$ ' + cmd) + '\n')
|
||||
try {
|
||||
childProcess.execSync(cmd)
|
||||
} catch (e) /* c8 ignore start */ {
|
||||
print(pico.red(e.stdout.toString()))
|
||||
print(
|
||||
pico.red(
|
||||
'\n' +
|
||||
e.stack +
|
||||
'\n\n' +
|
||||
'Problem with `' +
|
||||
cmd +
|
||||
'` call. ' +
|
||||
'Run it manually.\n'
|
||||
)
|
||||
)
|
||||
process.exit(1)
|
||||
} /* c8 ignore end */
|
||||
}
|
||||
|
||||
module.exports = function updateDB(print) {
|
||||
var lock = detectLockfile()
|
||||
var latest = getLatestInfo(lock)
|
||||
@ -301,28 +327,7 @@ module.exports = function updateDB(print) {
|
||||
print('Latest version: ' + pico.bold(pico.green(latest.version)) + '\n')
|
||||
|
||||
if (lock.mode === 'yarn' && lock.version !== 1) {
|
||||
var update = 'yarn up -R'
|
||||
print(
|
||||
'Updating caniuse-lite version\n' +
|
||||
pico.yellow('$ ' + update + ' caniuse-lite') +
|
||||
'\n'
|
||||
)
|
||||
try {
|
||||
childProcess.execSync(update + ' caniuse-lite')
|
||||
} catch (e) /* istanbul ignore next */ {
|
||||
print(
|
||||
pico.red(
|
||||
'\n' +
|
||||
e.stack +
|
||||
'\n\n' +
|
||||
'Problem with `' +
|
||||
update +
|
||||
' caniuse-lite` call. ' +
|
||||
'Run it manually.\n'
|
||||
)
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
updateWith(print, 'yarn up -R caniuse-lite')
|
||||
} else {
|
||||
updatePackageManually(print, lock, latest)
|
||||
}
|
||||
@ -333,9 +338,9 @@ module.exports = function updateDB(print) {
|
||||
if (!browsersListRetrievalError) {
|
||||
try {
|
||||
currentBrowsersList = getBrowsersList()
|
||||
} catch (e) /* istanbul ignore next */ {
|
||||
} catch (e) /* c8 ignore start */ {
|
||||
browsersListRetrievalError = e
|
||||
}
|
||||
} /* c8 ignore end */
|
||||
}
|
||||
|
||||
if (browsersListRetrievalError) {
|
||||
|
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/agents.js
generated
vendored
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/agents.js
generated
vendored
File diff suppressed because one or more lines are too long
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/browserVersions.js
generated
vendored
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/browserVersions.js
generated
vendored
@ -1 +1 @@
|
||||
module.exports={"0":"38","1":"39","2":"40","3":"41","4":"42","5":"43","6":"44","7":"45","8":"46","9":"47",A:"10",B:"11",C:"12",D:"7",E:"8",F:"9",G:"15",H:"96",I:"4",J:"6",K:"13",L:"14",M:"16",N:"17",O:"18",P:"79",Q:"80",R:"81",S:"94",T:"64",U:"83",V:"84",W:"85",X:"86",Y:"87",Z:"88",a:"89",b:"90",c:"91",d:"92",e:"93",f:"95",g:"5",h:"19",i:"20",j:"21",k:"22",l:"23",m:"24",n:"25",o:"26",p:"27",q:"28",r:"29",s:"30",t:"31",u:"32",v:"33",w:"34",x:"35",y:"36",z:"37",AB:"48",BB:"49",CB:"50",DB:"51",EB:"52",FB:"53",GB:"54",HB:"55",IB:"56",JB:"57",KB:"58",LB:"60",MB:"62",NB:"63",OB:"65",PB:"66",QB:"67",RB:"68",SB:"69",TB:"70",UB:"71",VB:"72",WB:"73",XB:"74",YB:"75",ZB:"76",aB:"77",bB:"78",cB:"11.1",dB:"12.1",eB:"3",fB:"59",gB:"61",hB:"82",iB:"3.2",jB:"10.1",kB:"11.5",lB:"4.2-4.3",mB:"5.5",nB:"2",oB:"3.5",pB:"3.6",qB:"97",rB:"98",sB:"99",tB:"3.1",uB:"5.1",vB:"6.1",wB:"7.1",xB:"9.1",yB:"13.1",zB:"14.1","0B":"15.1","1B":"TP","2B":"9.5-9.6","3B":"10.0-10.1","4B":"10.5","5B":"10.6","6B":"11.6","7B":"4.0-4.1","8B":"5.0-5.1","9B":"6.0-6.1",AC:"7.0-7.1",BC:"8.1-8.4",CC:"9.0-9.2",DC:"9.3",EC:"10.0-10.2",FC:"10.3",GC:"11.0-11.2",HC:"11.3-11.4",IC:"12.0-12.1",JC:"12.2-12.5",KC:"13.0-13.1",LC:"13.2",MC:"13.3",NC:"13.4-13.7",OC:"14.0-14.4",PC:"14.5-14.8",QC:"15.0-15.1",RC:"all",SC:"2.1",TC:"2.2",UC:"2.3",VC:"4.1",WC:"4.4",XC:"4.4.3-4.4.4",YC:"12.12",ZC:"5.0-5.4",aC:"6.2-6.4",bC:"7.2-7.4",cC:"8.2",dC:"9.2",eC:"11.1-11.2",fC:"12.0",gC:"13.0",hC:"14.0",iC:"15.0",jC:"10.4",kC:"7.12",lC:"2.5"};
|
||||
module.exports={"0":"38","1":"39","2":"40","3":"41","4":"42","5":"43","6":"44","7":"45","8":"46","9":"47",A:"10",B:"11",C:"12",D:"7",E:"8",F:"9",G:"15",H:"96",I:"4",J:"6",K:"13",L:"14",M:"16",N:"17",O:"18",P:"79",Q:"80",R:"81",S:"94",T:"64",U:"83",V:"84",W:"85",X:"86",Y:"87",Z:"88",a:"89",b:"90",c:"91",d:"92",e:"93",f:"95",g:"5",h:"19",i:"20",j:"21",k:"22",l:"23",m:"24",n:"25",o:"26",p:"27",q:"28",r:"29",s:"30",t:"31",u:"32",v:"33",w:"34",x:"35",y:"36",z:"37",AB:"48",BB:"49",CB:"50",DB:"51",EB:"52",FB:"53",GB:"54",HB:"55",IB:"56",JB:"57",KB:"58",LB:"60",MB:"62",NB:"63",OB:"65",PB:"66",QB:"67",RB:"68",SB:"69",TB:"70",UB:"71",VB:"72",WB:"73",XB:"74",YB:"75",ZB:"76",aB:"77",bB:"78",cB:"11.1",dB:"12.1",eB:"3",fB:"59",gB:"61",hB:"82",iB:"97",jB:"3.2",kB:"10.1",lB:"15.2",mB:"11.5",nB:"4.2-4.3",oB:"5.5",pB:"2",qB:"3.5",rB:"3.6",sB:"98",tB:"99",uB:"3.1",vB:"5.1",wB:"6.1",xB:"7.1",yB:"9.1",zB:"13.1","0B":"14.1","1B":"15.1","2B":"TP","3B":"9.5-9.6","4B":"10.0-10.1","5B":"10.5","6B":"10.6","7B":"11.6","8B":"4.0-4.1","9B":"5.0-5.1",AC:"6.0-6.1",BC:"7.0-7.1",CC:"8.1-8.4",DC:"9.0-9.2",EC:"9.3",FC:"10.0-10.2",GC:"10.3",HC:"11.0-11.2",IC:"11.3-11.4",JC:"12.0-12.1",KC:"12.2-12.5",LC:"13.0-13.1",MC:"13.2",NC:"13.3",OC:"13.4-13.7",PC:"14.0-14.4",QC:"14.5-14.8",RC:"15.0-15.1",SC:"all",TC:"2.1",UC:"2.2",VC:"2.3",WC:"4.1",XC:"4.4",YC:"4.4.3-4.4.4",ZC:"12.12",aC:"5.0-5.4",bC:"6.2-6.4",cC:"7.2-7.4",dC:"8.2",eC:"9.2",fC:"11.1-11.2",gC:"12.0",hC:"13.0",iC:"14.0",jC:"15.0",kC:"10.4",lC:"7.12",mC:"2.5"};
|
||||
|
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/aac.js
generated
vendored
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/aac.js
generated
vendored
@ -1 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","2":"J D E mB"},B:{"1":"C K L G M N O P Q R U V W X Y Z a b c d e S f H"},C:{"2":"nB eB I g J D E F A B C K L G M N O h i j oB pB","132":"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H"},D:{"1":"0 1 2 3 4 5 6 7 8 9 C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H qB rB sB","2":"I g J D E F","16":"A B"},E:{"1":"I g J D E F A B C K L G uB vB wB xB jB cB dB yB zB 0B 1B","2":"tB iB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB","2":"F B C 2B 3B 4B 5B cB kB 6B dB"},G:{"1":"E 7B lB 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC","16":"iB"},H:{"2":"RC"},I:{"1":"eB I H VC lB WC XC","2":"SC TC UC"},J:{"1":"A","2":"D"},K:{"1":"T","2":"A B C cB kB dB"},L:{"1":"H"},M:{"132":"S"},N:{"1":"A","2":"B"},O:{"1":"YC"},P:{"1":"I ZC aC bC cC dC jB eC fC gC hC iC"},Q:{"1":"jC"},R:{"1":"kC"},S:{"132":"lC"}},B:6,C:"AAC audio file format"};
|
||||
module.exports={A:{A:{"1":"F A B","2":"J D E oB"},B:{"1":"C K L G M N O P Q R U V W X Y Z a b c d e S f H"},C:{"2":"pB eB I g J D E F A B C K L G M N O h i j qB rB","132":"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H iB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H iB sB tB","2":"I g J D E F","16":"A B"},E:{"1":"I g J D E F A B C K L G vB wB xB yB kB cB dB zB 0B 1B lB 2B","2":"uB jB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB","2":"F B C 3B 4B 5B 6B cB mB 7B dB"},G:{"1":"E 8B nB 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC RC lB","16":"jB"},H:{"2":"SC"},I:{"1":"eB I H WC nB XC YC","2":"TC UC VC"},J:{"1":"A","2":"D"},K:{"1":"T","2":"A B C cB mB dB"},L:{"1":"H"},M:{"132":"S"},N:{"1":"A","2":"B"},O:{"1":"ZC"},P:{"1":"I aC bC cC dC eC kB fC gC hC iC jC"},Q:{"1":"kC"},R:{"1":"lC"},S:{"132":"mC"}},B:6,C:"AAC audio file format"};
|
||||
|
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/abortcontroller.js
generated
vendored
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/abortcontroller.js
generated
vendored
@ -1 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B mB"},B:{"1":"M N O P Q R U V W X Y Z a b c d e S f H","2":"C K L G"},C:{"1":"JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H","2":"0 1 2 3 4 5 6 7 8 9 nB eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB oB pB"},D:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H qB rB sB","2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB"},E:{"1":"K L G dB yB zB 0B 1B","2":"I g J D E F A B tB iB uB vB wB xB jB","130":"C cB"},F:{"1":"FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB 2B 3B 4B 5B cB kB 6B dB"},G:{"1":"HC IC JC KC LC MC NC OC PC QC","2":"E iB 7B lB 8B 9B AC BC CC DC EC FC GC"},H:{"2":"RC"},I:{"1":"H","2":"eB I SC TC UC VC lB WC XC"},J:{"2":"D A"},K:{"1":"T","2":"A B C cB kB dB"},L:{"1":"H"},M:{"1":"S"},N:{"2":"A B"},O:{"2":"YC"},P:{"1":"dC jB eC fC gC hC iC","2":"I ZC aC bC cC"},Q:{"1":"jC"},R:{"2":"kC"},S:{"2":"lC"}},B:1,C:"AbortController & AbortSignal"};
|
||||
module.exports={A:{A:{"2":"J D E F A B oB"},B:{"1":"M N O P Q R U V W X Y Z a b c d e S f H","2":"C K L G"},C:{"1":"JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H iB","2":"0 1 2 3 4 5 6 7 8 9 pB eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB qB rB"},D:{"1":"PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H iB sB tB","2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB"},E:{"1":"K L G dB zB 0B 1B lB 2B","2":"I g J D E F A B uB jB vB wB xB yB kB","130":"C cB"},F:{"1":"FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB 3B 4B 5B 6B cB mB 7B dB"},G:{"1":"IC JC KC LC MC NC OC PC QC RC lB","2":"E jB 8B nB 9B AC BC CC DC EC FC GC HC"},H:{"2":"SC"},I:{"1":"H","2":"eB I TC UC VC WC nB XC YC"},J:{"2":"D A"},K:{"1":"T","2":"A B C cB mB dB"},L:{"1":"H"},M:{"1":"S"},N:{"2":"A B"},O:{"2":"ZC"},P:{"1":"eC kB fC gC hC iC jC","2":"I aC bC cC dC"},Q:{"1":"kC"},R:{"2":"lC"},S:{"2":"mC"}},B:1,C:"AbortController & AbortSignal"};
|
||||
|
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ac3-ec3.js
generated
vendored
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ac3-ec3.js
generated
vendored
@ -1 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B mB"},B:{"1":"C K L G M N O","2":"P Q R U V W X Y Z a b c d e S f H"},C:{"2":"0 1 2 3 4 5 6 7 8 9 nB eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H oB pB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H qB rB sB"},E:{"2":"I g J D E F A B C K L G tB iB uB vB wB xB jB cB dB yB zB 0B 1B"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB 2B 3B 4B 5B cB kB 6B dB"},G:{"2":"E iB 7B lB 8B 9B AC BC","132":"CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC"},H:{"2":"RC"},I:{"2":"eB I H SC TC UC VC lB WC XC"},J:{"2":"D","132":"A"},K:{"2":"A B C T cB kB","132":"dB"},L:{"2":"H"},M:{"2":"S"},N:{"2":"A B"},O:{"132":"YC"},P:{"2":"I ZC aC bC cC dC jB eC fC gC hC iC"},Q:{"2":"jC"},R:{"2":"kC"},S:{"2":"lC"}},B:6,C:"AC-3 (Dolby Digital) and EC-3 (Dolby Digital Plus) codecs"};
|
||||
module.exports={A:{A:{"2":"J D E F A B oB"},B:{"1":"C K L G M N O","2":"P Q R U V W X Y Z a b c d e S f H"},C:{"2":"0 1 2 3 4 5 6 7 8 9 pB eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H iB qB rB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H iB sB tB"},E:{"2":"I g J D E F A B C K L G uB jB vB wB xB yB kB cB dB zB 0B 1B lB 2B"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB 3B 4B 5B 6B cB mB 7B dB"},G:{"2":"E jB 8B nB 9B AC BC CC","132":"DC EC FC GC HC IC JC KC LC MC NC OC PC QC RC lB"},H:{"2":"SC"},I:{"2":"eB I H TC UC VC WC nB XC YC"},J:{"2":"D","132":"A"},K:{"2":"A B C T cB mB","132":"dB"},L:{"2":"H"},M:{"2":"S"},N:{"2":"A B"},O:{"132":"ZC"},P:{"2":"I aC bC cC dC eC kB fC gC hC iC jC"},Q:{"2":"kC"},R:{"2":"lC"},S:{"2":"mC"}},B:6,C:"AC-3 (Dolby Digital) and EC-3 (Dolby Digital Plus) codecs"};
|
||||
|
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/accelerometer.js
generated
vendored
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/accelerometer.js
generated
vendored
@ -1 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B mB"},B:{"1":"P Q R U V W X Y Z a b c d e S f H","2":"C K L G M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 nB eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H oB pB"},D:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H qB rB sB","2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB","194":"KB fB LB gB MB NB T OB PB"},E:{"2":"I g J D E F A B C K L G tB iB uB vB wB xB jB cB dB yB zB 0B 1B"},F:{"1":"GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB 2B 3B 4B 5B cB kB 6B dB"},G:{"2":"E iB 7B lB 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC"},H:{"2":"RC"},I:{"1":"H","2":"eB I SC TC UC VC lB WC XC"},J:{"2":"D A"},K:{"1":"T","2":"A B C cB kB dB"},L:{"1":"H"},M:{"2":"S"},N:{"2":"A B"},O:{"2":"YC"},P:{"2":"I ZC aC bC cC dC jB eC fC gC hC iC"},Q:{"2":"jC"},R:{"2":"kC"},S:{"2":"lC"}},B:4,C:"Accelerometer"};
|
||||
module.exports={A:{A:{"2":"J D E F A B oB"},B:{"1":"P Q R U V W X Y Z a b c d e S f H","2":"C K L G M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 pB eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H iB qB rB"},D:{"1":"QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H iB sB tB","2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB","194":"KB fB LB gB MB NB T OB PB"},E:{"2":"I g J D E F A B C K L G uB jB vB wB xB yB kB cB dB zB 0B 1B lB 2B"},F:{"1":"GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB 3B 4B 5B 6B cB mB 7B dB"},G:{"2":"E jB 8B nB 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC RC lB"},H:{"2":"SC"},I:{"1":"H","2":"eB I TC UC VC WC nB XC YC"},J:{"2":"D A"},K:{"1":"T","2":"A B C cB mB dB"},L:{"1":"H"},M:{"2":"S"},N:{"2":"A B"},O:{"2":"ZC"},P:{"2":"I aC bC cC dC eC kB fC gC hC iC jC"},Q:{"2":"kC"},R:{"2":"lC"},S:{"2":"mC"}},B:4,C:"Accelerometer"};
|
||||
|
@ -1 +1 @@
|
||||
module.exports={A:{A:{"1":"F A B","130":"J D E mB"},B:{"1":"C K L G M N O P Q R U V W X Y Z a b c d e S f H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H","257":"nB eB I g J oB pB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H qB rB sB"},E:{"1":"I g J D E F A B C K L G tB iB uB vB wB xB jB cB dB yB zB 0B 1B"},F:{"1":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB 2B 3B 4B 5B cB kB 6B dB"},G:{"1":"E iB 7B lB 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC"},H:{"1":"RC"},I:{"1":"eB I H SC TC UC VC lB WC XC"},J:{"1":"D A"},K:{"1":"A B C T cB kB dB"},L:{"1":"H"},M:{"1":"S"},N:{"1":"A B"},O:{"1":"YC"},P:{"1":"I ZC aC bC cC dC jB eC fC gC hC iC"},Q:{"1":"jC"},R:{"1":"kC"},S:{"1":"lC"}},B:1,C:"EventTarget.addEventListener()"};
|
||||
module.exports={A:{A:{"1":"F A B","130":"J D E oB"},B:{"1":"C K L G M N O P Q R U V W X Y Z a b c d e S f H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H iB","257":"pB eB I g J qB rB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H iB sB tB"},E:{"1":"I g J D E F A B C K L G uB jB vB wB xB yB kB cB dB zB 0B 1B lB 2B"},F:{"1":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB 3B 4B 5B 6B cB mB 7B dB"},G:{"1":"E jB 8B nB 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC RC lB"},H:{"1":"SC"},I:{"1":"eB I H TC UC VC WC nB XC YC"},J:{"1":"D A"},K:{"1":"A B C T cB mB dB"},L:{"1":"H"},M:{"1":"S"},N:{"1":"A B"},O:{"1":"ZC"},P:{"1":"I aC bC cC dC eC kB fC gC hC iC jC"},Q:{"1":"kC"},R:{"1":"lC"},S:{"1":"mC"}},B:1,C:"EventTarget.addEventListener()"};
|
||||
|
@ -1 +1 @@
|
||||
module.exports={A:{A:{"1":"E F A B","2":"J D mB"},B:{"2":"C K L G M N O P Q R U V W X Y Z a b c d e S f H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 nB eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H oB pB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H qB rB sB"},E:{"2":"I g J D E F A B C K L G tB iB uB vB wB xB jB cB dB yB zB 0B 1B"},F:{"1":"F B C 2B 3B 4B 5B cB kB 6B dB","16":"0 1 2 3 4 5 6 7 8 9 G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB"},G:{"2":"E iB 7B lB 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC"},H:{"16":"RC"},I:{"2":"eB I H SC TC UC VC lB WC XC"},J:{"16":"D A"},K:{"2":"T","16":"A B C cB kB dB"},L:{"16":"H"},M:{"16":"S"},N:{"16":"A B"},O:{"16":"YC"},P:{"16":"I ZC aC bC cC dC jB eC fC gC hC iC"},Q:{"2":"jC"},R:{"16":"kC"},S:{"1":"lC"}},B:1,C:"Alternate stylesheet"};
|
||||
module.exports={A:{A:{"1":"E F A B","2":"J D oB"},B:{"2":"C K L G M N O P Q R U V W X Y Z a b c d e S f H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 pB eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H iB qB rB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H iB sB tB"},E:{"2":"I g J D E F A B C K L G uB jB vB wB xB yB kB cB dB zB 0B 1B lB 2B"},F:{"1":"F B C 3B 4B 5B 6B cB mB 7B dB","16":"0 1 2 3 4 5 6 7 8 9 G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB"},G:{"2":"E jB 8B nB 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC RC lB"},H:{"16":"SC"},I:{"2":"eB I H TC UC VC WC nB XC YC"},J:{"16":"D A"},K:{"2":"T","16":"A B C cB mB dB"},L:{"16":"H"},M:{"16":"S"},N:{"16":"A B"},O:{"16":"ZC"},P:{"16":"I aC bC cC dC eC kB fC gC hC iC jC"},Q:{"2":"kC"},R:{"16":"lC"},S:{"1":"mC"}},B:1,C:"Alternate stylesheet"};
|
||||
|
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ambient-light.js
generated
vendored
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/ambient-light.js
generated
vendored
@ -1 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B mB"},B:{"2":"C K","132":"L G M N O","322":"P Q R U V W X Y Z a b c d e S f H"},C:{"2":"nB eB I g J D E F A B C K L G M N O h i j oB pB","132":"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB","194":"LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB","322":"KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H qB rB sB"},E:{"2":"I g J D E F A B C K L G tB iB uB vB wB xB jB cB dB yB zB 0B 1B"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB 2B 3B 4B 5B cB kB 6B dB","322":"WB XB YB ZB aB bB P Q R hB"},G:{"2":"E iB 7B lB 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC"},H:{"2":"RC"},I:{"2":"eB I H SC TC UC VC lB WC XC"},J:{"2":"D A"},K:{"2":"A B C T cB kB dB"},L:{"2":"H"},M:{"1":"S"},N:{"2":"A B"},O:{"2":"YC"},P:{"2":"I ZC aC bC cC dC jB eC fC gC hC iC"},Q:{"2":"jC"},R:{"2":"kC"},S:{"132":"lC"}},B:4,C:"Ambient Light Sensor"};
|
||||
module.exports={A:{A:{"2":"J D E F A B oB"},B:{"2":"C K","132":"L G M N O","322":"P Q R U V W X Y Z a b c d e S f H"},C:{"2":"pB eB I g J D E F A B C K L G M N O h i j qB rB","132":"0 1 2 3 4 5 6 7 8 9 k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB","194":"LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H iB"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB","322":"KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H iB sB tB"},E:{"2":"I g J D E F A B C K L G uB jB vB wB xB yB kB cB dB zB 0B 1B lB 2B"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB 3B 4B 5B 6B cB mB 7B dB","322":"WB XB YB ZB aB bB P Q R hB"},G:{"2":"E jB 8B nB 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC RC lB"},H:{"2":"SC"},I:{"2":"eB I H TC UC VC WC nB XC YC"},J:{"2":"D A"},K:{"2":"A B C T cB mB dB"},L:{"2":"H"},M:{"1":"S"},N:{"2":"A B"},O:{"2":"ZC"},P:{"2":"I aC bC cC dC eC kB fC gC hC iC jC"},Q:{"2":"kC"},R:{"2":"lC"},S:{"132":"mC"}},B:4,C:"Ambient Light Sensor"};
|
||||
|
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/apng.js
generated
vendored
2
tools/node_modules/eslint/node_modules/caniuse-lite/data/features/apng.js
generated
vendored
@ -1 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B mB"},B:{"1":"P Q R U V W X Y Z a b c d e S f H","2":"C K L G M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H oB pB","2":"nB"},D:{"1":"fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H qB rB sB","2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"E F A B C K L G xB jB cB dB yB zB 0B 1B","2":"I g J D tB iB uB vB wB"},F:{"1":"8 9 B C AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB 2B 3B 4B 5B cB kB 6B dB","2":"0 1 2 3 4 5 6 7 F G M N O h i j k l m n o p q r s t u v w x y z"},G:{"1":"E BC CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC","2":"iB 7B lB 8B 9B AC"},H:{"2":"RC"},I:{"1":"H","2":"eB I SC TC UC VC lB WC XC"},J:{"2":"D A"},K:{"1":"A B C T cB kB dB"},L:{"1":"H"},M:{"1":"S"},N:{"2":"A B"},O:{"2":"YC"},P:{"1":"bC cC dC jB eC fC gC hC iC","2":"I ZC aC"},Q:{"2":"jC"},R:{"2":"kC"},S:{"1":"lC"}},B:7,C:"Animated PNG (APNG)"};
|
||||
module.exports={A:{A:{"2":"J D E F A B oB"},B:{"1":"P Q R U V W X Y Z a b c d e S f H","2":"C K L G M N O"},C:{"1":"0 1 2 3 4 5 6 7 8 9 eB I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB U V W X Y Z a b c d e S f H iB qB rB","2":"pB"},D:{"1":"fB LB gB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R U V W X Y Z a b c d e S f H iB sB tB","2":"0 1 2 3 4 5 6 7 8 9 I g J D E F A B C K L G M N O h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB"},E:{"1":"E F A B C K L G yB kB cB dB zB 0B 1B lB 2B","2":"I g J D uB jB vB wB xB"},F:{"1":"8 9 B C AB BB CB DB EB FB GB HB IB JB KB LB MB NB T OB PB QB RB SB TB UB VB WB XB YB ZB aB bB P Q R hB 3B 4B 5B 6B cB mB 7B dB","2":"0 1 2 3 4 5 6 7 F G M N O h i j k l m n o p q r s t u v w x y z"},G:{"1":"E CC DC EC FC GC HC IC JC KC LC MC NC OC PC QC RC lB","2":"jB 8B nB 9B AC BC"},H:{"2":"SC"},I:{"1":"H","2":"eB I TC UC VC WC nB XC YC"},J:{"2":"D A"},K:{"1":"A B C T cB mB dB"},L:{"1":"H"},M:{"1":"S"},N:{"2":"A B"},O:{"2":"ZC"},P:{"1":"cC dC eC kB fC gC hC iC jC","2":"I aC bC"},Q:{"2":"kC"},R:{"2":"lC"},S:{"1":"mC"}},B:7,C:"Animated PNG (APNG)"};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user