diff --git a/node_modules/@babel/core/node_modules/@babel/helper-function-name/LICENSE b/node_modules/@babel/core/node_modules/@babel/helper-function-name/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-function-name/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/core/node_modules/@babel/helper-function-name/README.md b/node_modules/@babel/core/node_modules/@babel/helper-function-name/README.md deleted file mode 100644 index 36a65931..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-function-name/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-function-name - -> Helper function to change the property 'name' of every function - -See our website [@babel/helper-function-name](https://babeljs.io/docs/en/babel-helper-function-name) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-function-name -``` - -or using yarn: - -```sh -yarn add @babel/helper-function-name --dev -``` diff --git a/node_modules/@babel/core/node_modules/@babel/helper-function-name/lib/index.js b/node_modules/@babel/core/node_modules/@babel/helper-function-name/lib/index.js deleted file mode 100644 index 59e88e9b..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-function-name/lib/index.js +++ /dev/null @@ -1,188 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; - -var _helperGetFunctionArity = require("@babel/helper-get-function-arity"); - -var _template = require("@babel/template"); - -var _t = require("@babel/types"); - -const { - NOT_LOCAL_BINDING, - cloneNode, - identifier, - isAssignmentExpression, - isFunction, - isIdentifier, - isLiteral, - isNullLiteral, - isObjectMethod, - isObjectProperty, - isRegExpLiteral, - isTemplateLiteral, - isVariableDeclarator, - toBindingIdentifierName -} = _t; -const buildPropertyMethodAssignmentWrapper = (0, _template.default)(` - (function (FUNCTION_KEY) { - function FUNCTION_ID() { - return FUNCTION_KEY.apply(this, arguments); - } - - FUNCTION_ID.toString = function () { - return FUNCTION_KEY.toString(); - } - - return FUNCTION_ID; - })(FUNCTION) -`); -const buildGeneratorPropertyMethodAssignmentWrapper = (0, _template.default)(` - (function (FUNCTION_KEY) { - function* FUNCTION_ID() { - return yield* FUNCTION_KEY.apply(this, arguments); - } - - FUNCTION_ID.toString = function () { - return FUNCTION_KEY.toString(); - }; - - return FUNCTION_ID; - })(FUNCTION) -`); -const visitor = { - "ReferencedIdentifier|BindingIdentifier"(path, state) { - if (path.node.name !== state.name) return; - const localDeclar = path.scope.getBindingIdentifier(state.name); - if (localDeclar !== state.outerDeclar) return; - state.selfReference = true; - path.stop(); - } - -}; - -function getNameFromLiteralId(id) { - if (isNullLiteral(id)) { - return "null"; - } - - if (isRegExpLiteral(id)) { - return `_${id.pattern}_${id.flags}`; - } - - if (isTemplateLiteral(id)) { - return id.quasis.map(quasi => quasi.value.raw).join(""); - } - - if (id.value !== undefined) { - return id.value + ""; - } - - return ""; -} - -function wrap(state, method, id, scope) { - if (state.selfReference) { - if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) { - scope.rename(id.name); - } else { - if (!isFunction(method)) return; - let build = buildPropertyMethodAssignmentWrapper; - - if (method.generator) { - build = buildGeneratorPropertyMethodAssignmentWrapper; - } - - const template = build({ - FUNCTION: method, - FUNCTION_ID: id, - FUNCTION_KEY: scope.generateUidIdentifier(id.name) - }).expression; - const params = template.callee.body.body[0].params; - - for (let i = 0, len = (0, _helperGetFunctionArity.default)(method); i < len; i++) { - params.push(scope.generateUidIdentifier("x")); - } - - return template; - } - } - - method.id = id; - scope.getProgramParent().references[id.name] = true; -} - -function visit(node, name, scope) { - const state = { - selfAssignment: false, - selfReference: false, - outerDeclar: scope.getBindingIdentifier(name), - references: [], - name: name - }; - const binding = scope.getOwnBinding(name); - - if (binding) { - if (binding.kind === "param") { - state.selfReference = true; - } else {} - } else if (state.outerDeclar || scope.hasGlobal(name)) { - scope.traverse(node, visitor, state); - } - - return state; -} - -function _default({ - node, - parent, - scope, - id -}, localBinding = false) { - if (node.id) return; - - if ((isObjectProperty(parent) || isObjectMethod(parent, { - kind: "method" - })) && (!parent.computed || isLiteral(parent.key))) { - id = parent.key; - } else if (isVariableDeclarator(parent)) { - id = parent.id; - - if (isIdentifier(id) && !localBinding) { - const binding = scope.parent.getBinding(id.name); - - if (binding && binding.constant && scope.getBinding(id.name) === binding) { - node.id = cloneNode(id); - node.id[NOT_LOCAL_BINDING] = true; - return; - } - } - } else if (isAssignmentExpression(parent, { - operator: "=" - })) { - id = parent.left; - } else if (!id) { - return; - } - - let name; - - if (id && isLiteral(id)) { - name = getNameFromLiteralId(id); - } else if (id && isIdentifier(id)) { - name = id.name; - } - - if (name === undefined) { - return; - } - - name = toBindingIdentifierName(name); - id = identifier(name); - id[NOT_LOCAL_BINDING] = true; - const state = visit(node, name, scope); - return wrap(state, node, id, scope) || node; -} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-function-name/package.json b/node_modules/@babel/core/node_modules/@babel/helper-function-name/package.json deleted file mode 100644 index 68734a59..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-function-name/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@babel/helper-function-name", - "version": "7.15.4", - "description": "Helper function to change the property 'name' of every function", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-helper-function-name" - }, - "homepage": "https://babel.dev/docs/en/next/babel-helper-function-name", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "dependencies": { - "@babel/helper-get-function-arity": "^7.15.4", - "@babel/template": "^7.15.4", - "@babel/types": "^7.15.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)" -} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/LICENSE b/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/README.md b/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/README.md deleted file mode 100644 index 8fa48c13..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-get-function-arity - -> Helper function to get function arity - -See our website [@babel/helper-get-function-arity](https://babeljs.io/docs/en/babel-helper-get-function-arity) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-get-function-arity -``` - -or using yarn: - -```sh -yarn add @babel/helper-get-function-arity --dev -``` diff --git a/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/lib/index.js b/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/lib/index.js deleted file mode 100644 index 61e22edd..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/lib/index.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; - -var _t = require("@babel/types"); - -const { - isAssignmentPattern, - isRestElement -} = _t; - -function _default(node) { - const params = node.params; - - for (let i = 0; i < params.length; i++) { - const param = params[i]; - - if (isAssignmentPattern(param) || isRestElement(param)) { - return i; - } - } - - return params.length; -} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/package.json b/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/package.json deleted file mode 100644 index 648e8276..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-get-function-arity/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@babel/helper-get-function-arity", - "version": "7.15.4", - "description": "Helper function to get function arity", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-helper-get-function-arity" - }, - "homepage": "https://babel.dev/docs/en/next/babel-helper-get-function-arity", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "dependencies": { - "@babel/types": "^7.15.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)" -} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/LICENSE b/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/README.md b/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/README.md deleted file mode 100644 index a6f54046..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-split-export-declaration - -> - -See our website [@babel/helper-split-export-declaration](https://babeljs.io/docs/en/babel-helper-split-export-declaration) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-split-export-declaration -``` - -or using yarn: - -```sh -yarn add @babel/helper-split-export-declaration --dev -``` diff --git a/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/lib/index.js b/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/lib/index.js deleted file mode 100644 index 6007f89c..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/lib/index.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = splitExportDeclaration; - -var _t = require("@babel/types"); - -const { - cloneNode, - exportNamedDeclaration, - exportSpecifier, - identifier, - variableDeclaration, - variableDeclarator -} = _t; - -function splitExportDeclaration(exportDeclaration) { - if (!exportDeclaration.isExportDeclaration()) { - throw new Error("Only export declarations can be split."); - } - - const isDefault = exportDeclaration.isExportDefaultDeclaration(); - const declaration = exportDeclaration.get("declaration"); - const isClassDeclaration = declaration.isClassDeclaration(); - - if (isDefault) { - const standaloneDeclaration = declaration.isFunctionDeclaration() || isClassDeclaration; - const scope = declaration.isScope() ? declaration.scope.parent : declaration.scope; - let id = declaration.node.id; - let needBindingRegistration = false; - - if (!id) { - needBindingRegistration = true; - id = scope.generateUidIdentifier("default"); - - if (standaloneDeclaration || declaration.isFunctionExpression() || declaration.isClassExpression()) { - declaration.node.id = cloneNode(id); - } - } - - const updatedDeclaration = standaloneDeclaration ? declaration : variableDeclaration("var", [variableDeclarator(cloneNode(id), declaration.node)]); - const updatedExportDeclaration = exportNamedDeclaration(null, [exportSpecifier(cloneNode(id), identifier("default"))]); - exportDeclaration.insertAfter(updatedExportDeclaration); - exportDeclaration.replaceWith(updatedDeclaration); - - if (needBindingRegistration) { - scope.registerDeclaration(exportDeclaration); - } - - return exportDeclaration; - } - - if (exportDeclaration.get("specifiers").length > 0) { - throw new Error("It doesn't make sense to split exported specifiers."); - } - - const bindingIdentifiers = declaration.getOuterBindingIdentifiers(); - const specifiers = Object.keys(bindingIdentifiers).map(name => { - return exportSpecifier(identifier(name), identifier(name)); - }); - const aliasDeclar = exportNamedDeclaration(null, specifiers); - exportDeclaration.insertAfter(aliasDeclar); - exportDeclaration.replaceWith(declaration.node); - return exportDeclaration; -} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/package.json b/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/package.json deleted file mode 100644 index 8c32ea4f..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@babel/helper-split-export-declaration", - "version": "7.15.4", - "description": "", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-helper-split-export-declaration" - }, - "homepage": "https://babel.dev/docs/en/next/babel-helper-split-export-declaration", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "dependencies": { - "@babel/types": "^7.15.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)" -} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/LICENSE b/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/README.md b/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/README.md deleted file mode 100644 index 6733576a..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-validator-identifier - -> Validate identifier/keywords name - -See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-validator-identifier -``` - -or using yarn: - -```sh -yarn add @babel/helper-validator-identifier --dev -``` diff --git a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/identifier.js deleted file mode 100644 index b8a5d9a6..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/identifier.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isIdentifierStart = isIdentifierStart; -exports.isIdentifierChar = isIdentifierChar; -exports.isIdentifierName = isIdentifierName; -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; -const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes); -} - -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -function isIdentifierName(name) { - let isFirst = true; - - for (let i = 0; i < name.length; i++) { - let cp = name.charCodeAt(i); - - if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { - const trail = name.charCodeAt(++i); - - if ((trail & 0xfc00) === 0xdc00) { - cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); - } - } - - if (isFirst) { - isFirst = false; - - if (!isIdentifierStart(cp)) { - return false; - } - } else if (!isIdentifierChar(cp)) { - return false; - } - } - - return !isFirst; -} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/index.js b/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/index.js deleted file mode 100644 index 7b623c90..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/index.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "isIdentifierName", { - enumerable: true, - get: function () { - return _identifier.isIdentifierName; - } -}); -Object.defineProperty(exports, "isIdentifierChar", { - enumerable: true, - get: function () { - return _identifier.isIdentifierChar; - } -}); -Object.defineProperty(exports, "isIdentifierStart", { - enumerable: true, - get: function () { - return _identifier.isIdentifierStart; - } -}); -Object.defineProperty(exports, "isReservedWord", { - enumerable: true, - get: function () { - return _keyword.isReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindOnlyReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindReservedWord; - } -}); -Object.defineProperty(exports, "isStrictReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictReservedWord; - } -}); -Object.defineProperty(exports, "isKeyword", { - enumerable: true, - get: function () { - return _keyword.isKeyword; - } -}); - -var _identifier = require("./identifier"); - -var _keyword = require("./keyword"); \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/keyword.js deleted file mode 100644 index 110cee40..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/lib/keyword.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isReservedWord = isReservedWord; -exports.isStrictReservedWord = isStrictReservedWord; -exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; -exports.isStrictBindReservedWord = isStrictBindReservedWord; -exports.isKeyword = isKeyword; -const reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const keywords = new Set(reservedWords.keyword); -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); - -function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; -} - -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} - -function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); -} - -function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); -} - -function isKeyword(word) { - return keywords.has(word); -} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/package.json deleted file mode 100644 index 0efb119c..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@babel/helper-validator-identifier", - "version": "7.15.7", - "description": "Validate identifier/keywords name", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-helper-validator-identifier" - }, - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "exports": "./lib/index.js", - "devDependencies": { - "@unicode/unicode-14.0.0": "^1.2.1", - "charcodes": "^0.2.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)" -} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js deleted file mode 100644 index f644d77d..00000000 --- a/node_modules/@babel/core/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; - -// Always use the latest available version of Unicode! -// https://tc39.github.io/ecma262/#sec-conformance -const version = "14.0.0"; - -const start = require("@unicode/unicode-" + - version + - "/Binary_Property/ID_Start/code-points.js").filter(function (ch) { - return ch > 0x7f; -}); -let last = -1; -const cont = [0x200c, 0x200d].concat( - require("@unicode/unicode-" + - version + - "/Binary_Property/ID_Continue/code-points.js").filter(function (ch) { - return ch > 0x7f && search(start, ch, last + 1) == -1; - }) -); - -function search(arr, ch, starting) { - for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) { - if (arr[i] === ch) return i; - } - return -1; -} - -function pad(str, width) { - while (str.length < width) str = "0" + str; - return str; -} - -function esc(code) { - const hex = code.toString(16); - if (hex.length <= 2) return "\\x" + pad(hex, 2); - else return "\\u" + pad(hex, 4); -} - -function generate(chars) { - const astral = []; - let re = ""; - for (let i = 0, at = 0x10000; i < chars.length; i++) { - const from = chars[i]; - let to = from; - while (i < chars.length - 1 && chars[i + 1] == to + 1) { - i++; - to++; - } - if (to <= 0xffff) { - if (from == to) re += esc(from); - else if (from + 1 == to) re += esc(from) + esc(to); - else re += esc(from) + "-" + esc(to); - } else { - astral.push(from - at, to - from); - at = to; - } - } - return { nonASCII: re, astral: astral }; -} - -const startData = generate(start); -const contData = generate(cont); - -console.log("/* prettier-ignore */"); -console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";'); -console.log("/* prettier-ignore */"); -console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";'); -console.log("/* prettier-ignore */"); -console.log( - "const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";" -); -console.log("/* prettier-ignore */"); -console.log( - "const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";" -); diff --git a/node_modules/@babel/core/node_modules/@babel/parser/CHANGELOG.md b/node_modules/@babel/core/node_modules/@babel/parser/CHANGELOG.md deleted file mode 100644 index b3840ac8..00000000 --- a/node_modules/@babel/core/node_modules/@babel/parser/CHANGELOG.md +++ /dev/null @@ -1,1073 +0,0 @@ -# Changelog - -> **Tags:** -> - :boom: [Breaking Change] -> - :eyeglasses: [Spec Compliance] -> - :rocket: [New Feature] -> - :bug: [Bug Fix] -> - :memo: [Documentation] -> - :house: [Internal] -> - :nail_care: [Polish] - -> Semver Policy: https://github.com/babel/babel/tree/main/packages/babel-parser#semver - -_Note: Gaps between patch versions are faulty, broken or test releases._ - -See the [Babel Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) for the pre-6.8.0 version Changelog. - -## 6.17.1 (2017-05-10) - -### :bug: Bug Fix - * Fix typo in flow spread operator error (Brian Ng) - * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko) - * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko) - * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng) - * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng) - * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng) - * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng) - -## 6.17.0 (2017-04-20) - -### :bug: Bug Fix - * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie) - * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons) - * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng) - * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons) - * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng) - * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng) - -## 7.0.0-beta.8 (2017-04-04) - -### New Feature -* Add support for flow type spread (#418) (Conrad Buck) -* Allow statics in flow interfaces (#427) (Brian Ng) - -### Bug Fix -* Fix predicate attachment to match flow parser (#428) (Brian Ng) -* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray) -* Fix rest parameters with array and objects (#424) (Brian Ng) -* Fix number parser (#433) (Alex Kuzmenko) - -### Docs -* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko) - -### Internal -* Use babel-register script when running babel smoke tests (#442) (Brian Ng) - -## 7.0.0-beta.7 (2017-03-22) - -### Spec Compliance -* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu) - -### Bug Fix - -* Fix push-pop logic in flow (#405) (Daniel Tschinder) - -## 7.0.0-beta.6 (2017-03-21) - -### New Feature -* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons) - -### Polish -* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal) - -### Docs - -* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning) - -## 7.0.0-beta.5 (2017-03-21) - -### Bug Fix -* Throw error if new.target is used outside of a function (#402) (Brian Ng) -* Fix parsing of class properties (#351) (Kevin Gibbons) - -### Other - * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy) - * Optimize travis builds (#419) (Daniel Tschinder) - * Update codecov to 2.0 (#412) (Daniel Tschinder) - * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy) - * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning) - * Upgrade flow to 0.41 (Daniel Tschinder) - * Fix watch command (#403) (Brian Ng) - * Update yarn lock (Daniel Tschinder) - * Fix watch command (#403) (Brian Ng) - * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot]) - * Add estree test for correct order of directives (Daniel Tschinder) - * Add DoExpression to spec (#364) (Alex Kuzmenko) - * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde) - * Explain how to run only one test (#389) [skip ci] (Aaron Ang) - - ## 7.0.0-beta.4 (2017-03-01) - -* Don't consume async when checking for async func decl (#377) (Brian Ng) -* add `ranges` option [skip ci] (Henry Zhu) -* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine) - -## 7.0.0-beta.3 (2017-02-28) - -- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) -- Merge changes from 6.x - -## 7.0.0-beta.2 (2017-02-20) - -- estree: correctly change literals in all cases (#368) (Daniel Tschinder) - -## 7.0.0-beta.1 (2017-02-20) - -- Fix negative number literal typeannotations (#366) (Daniel Tschinder) -- Update contributing with more test info [skip ci] (#355) (Brian Ng) - -## 7.0.0-beta.0 (2017-02-15) - -- Reintroduce Variance node (#333) (Daniel Tschinder) -- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick) -- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail) -- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot]) -- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot]) -- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder) -- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi) -- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder) -- Remove classConstructorCall plugin (#291) (Brian Ng) -- Update yarn.lock (Daniel Tschinder) -- Update cross-env to 3.x (Daniel Tschinder) -- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov) -- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens) - -## 6.16.1 (2017-02-23) - -### :bug: Regression - -- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375)) - -Need to modify Babel for this AST node change, so moving to 7.0. - -- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376)) - -[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted. - -## 6.16.0 (2017-02-23) - -### :rocket: New Feature - -***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder) - -We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/) - -We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc. - -To enable `estree` mode simply add the plugin in the config: -```json -{ - "plugins": [ "estree" ] -} -``` - -If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned. - -Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew) - -Babylon exports a new function to parse a single expression - -```js -import { parseExpression } from 'babylon'; - -const ast = parseExpression('x || y && z', options); -``` - -The returned AST will only consist of the expression. The options are the same as for `parse()` - -Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu) - -A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`. -Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ... - -Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris) - -Added support for function predicates which flow introduced in version 0.33.0 - -```js -declare function is_number(x: mixed): boolean %checks(typeof x === "number"); -``` - -Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder) - -Added support for imports within module declarations which flow introduced in version 0.37.0 - -```js -declare module "C" { - import type { DT } from "D"; - declare export type CT = { D: DT }; -} -``` - -### :eyeglasses: Spec Compliance - -Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons) - -This example now correctly throws an error when there is a semicolon after the decorator: - -```js -class A { -@a; -foo(){} -} -``` - -Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder) - -Using keywords in imports is not allowed anymore: - -```js -import { default } from "foo"; -import { a as debugger } from "foo"; -``` - -Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder) - -In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration. - -Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder) - -The following code now correctly throws an error - -```js -import type { type a } from "foo"; -``` - -Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine) - -Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour. - -If you enable the flow plugin you can only define the type of the class properties, but not initialize them. - -Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder) - -Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`. - -```js -export default async function bar() {}; -``` - -### :nail_care: Polish - -Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng) - -### :bug: Bug Fix - -Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder) - -Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng) - -ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder) - -Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder) - -Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder) - -Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder) - -Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng) - -Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper) - - -### :house: Internal - -Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray) - -Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray) - -Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder) - -chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot]) - -Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder) - -Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot]) - -Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot]) - -devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo) - -Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder) - -Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder) - -### :memo: Documentation - -Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng) - -Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu) - -Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro) - -AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens) - -## 6.15.0 (2017-01-10) - -### :eyeglasses: Spec Compliance - -Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison) - -This change implements flows new shorthand import syntax -and where previously you had to write this code: - -```js -import {someValue} from "blah"; -import type {someType} from "blah"; -import typeof {someOtherValue} from "blah"; -``` - -you can now write it like this: - -```js -import { - someValue, - type someType, - typeof someOtherValue, -} from "blah"; -``` - -For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request. - -flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin) - -This change now allows a leading pipe everywhere types can be used: -```js -var f = (x): | 1 | 2 => 1; -``` - -Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo) - -Previously babylon parsed the following exports, although they are not valid: -```js -export typeof foo; -export new Foo(); -export function() {}; -export for (;;); -export while(foo); -``` - -### :bug: Bug Fix - -Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin) - -This fixes parsing of this case: - -```js -const map = { - [age <= 17] : 'Too young' -}; -``` - -Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long) - -The following case produced an invalid AST -```js -
{/* foo */}
-``` - -Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy) - -When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST. - -Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant) - -Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray) - -### :house: Internal - -User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder) - -Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo) - -Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine) - -Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder) - -Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine) - -Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU) - -Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot]) - -chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot]) - -chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot]) - -## 6.14.1 (2016-11-17) - -### :bug: Bug Fix - -Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder) - -```js -{ - "plugins": ["*"] -} -``` - -Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer. - -## 6.14.0 (2016-11-16) - -### :eyeglasses: Spec Compliance - -Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo) - -[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words) - -Babylon will throw for more reserved words such as `enum` or `await` (in strict mode). - -``` -class enum {} // throws -class await {} // throws in strict mode (module) -``` - -Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi) - -So where you used to have to write - -```js -type A = (x: string, y: boolean) => number; -type B = (z: string) => number; -type C = { [key: string]: number }; -``` - -you can now write (with flow 0.34.0) - -```js -type A = (string, boolean) => number; -type B = string => number; -type C = { [string]: number }; -``` - -Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner) - -Supports these form now of specifying array types: - -```js -var a: number[][][][]; -var b: string[][]; -``` - -### :bug: Bug Fix - -Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder) - -``` -declare module "foo" { declare module.exports: number } -declare module "foo" { declare module.exports: number; } // also allowed now -``` - -### :house: Internal - - * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman) - * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger) - * Add node 7 (Daniel Tschinder) - * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper) - -## v6.13.1 (2016-10-26) - -### :nail_care: Polish - -- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML)) - -```js -const babylon = require('babylon'); -const ast = babylon.parse('var foo = "lol";'); -``` - -With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph. - -**Without bundling** -![image](https://cloud.githubusercontent.com/assets/5233399/19420264/3133497e-93ad-11e6-9a6a-2da59c4f5c13.png) - -**With bundling** -![image](https://cloud.githubusercontent.com/assets/5233399/19420267/388f556e-93ad-11e6-813e-7c5c396be322.png) - -- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu) -- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu) - -## v6.13.0 (2016-10-21) - -### :eyeglasses: Spec Compliance - -Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman) - -> See https://flowtype.org/docs/variance.html for more information - -```js -type T = { +p: T }; -interface T { -p: T }; -declare class T { +[k:K]: V }; -class T { -[k:K]: V }; -class C2 { +p: T = e }; -``` - -Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman) - -```js -({ __proto__: 1, __proto__: 2 }) // Throws an error now -``` - -### :bug: Bug Fix - -Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman) - -```js -declare class A { - static: T; -} -``` - -Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine) - -```js -var foo = { async, bar }; -``` - -### :nail_care: Polish - -Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder) - -> This improves the performance slightly (because of hidden classes) - -### :house: Internal - -Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman) - -Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman) - -Readd missin .eslinignore for IDEs (Daniel Tschinder) - -Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman) - -Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman) - -Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman) - -## v6.12.0 (2016-10-14) - -### :eyeglasses: Spec Compliance - -Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler) - -#### Dynamic Import - -- Proposal Repo: https://github.com/domenic/proposal-dynamic-import -- Championed by [@domenic](https://github.com/domenic) -- stage-2 -- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import) - -> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript - -```js -import(`./section-modules/${link.dataset.entryModule}.js`) -.then(module => { - module.loadPageInto(main); -}) -``` - -Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman) - -#### EmptyTypeAnnotation - -Just wasn't covered before. - -```js -type T = empty; -``` - -### :bug: Bug Fix - -Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) - -```js -// was failing due to sparse array -export const { foo: [ ,, qux7 ] } = bar; -``` - -Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper) - -```js -declare class X { - foobar(): void; - static foobar(): void; -} -``` - -Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper) - -```js -class Foo { - delete(item: T): T { - return item; - } -} -``` - -Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder) - -```js -function *foo() { - const x = (yield 5: any); -} -``` - -### :nail_care: Polish - -Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman) - -```js -// Unexpected token, expected ; (1:6) -{ set 1 } -``` - -### :house: Internal - -Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder) - -Also run flow, linting, babel tests on separate instances (add back node 0.10) - -## v6.11.6 (2016-10-12) - -### :bug: Bug Fix/Regression - -Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) - -```js -// was failing with `Cannot read property 'type' of null` because of null identifiers -export const { foo: [ ,, qux7 ] } = bar; -``` - -## v6.11.5 (2016-10-12) - -### :eyeglasses: Spec Compliance - -Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo) - -```js -// `foo` has already been exported. Exported identifiers must be unique. (2:20) -export function foo() {}; -export const { a: [{foo}] } = bar; -``` - -Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo) - -```js -// `foo` has already been exported. Exported identifiers must be unique. (2:22) -export const foo = 1; -export const [bar, ...foo] = baz; -``` - -### :bug: Bug Fix - -Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo) - -```js -// this is ok now -const test = ({async = true}) => {}; -``` - -### :nail_care: Polish - -Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder) - -```bash -# So in the case of a missing ending curly (`}`) -Module build failed: SyntaxError: Unexpected token, expected } (30:0) - 28 | } - 29 | -> 30 | - | ^ -``` - -## v6.11.4 (2016-10-03) - -Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu) - -## v6.11.3 (2016-10-01) - -### :eyeglasses: Spec Compliance - -Add static errors for object rest (#149) ([@danez](https://github.com/danez)) - -> https://github.com/sebmarkbage/ecmascript-rest-spread - -Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right. - -```js -let { x, y, ...z } = { x: 1, y: 2, z: 3 }; -// x = 1 -// y = 2 -// z = { z: 3 } -``` - -#### New Syntax Errors: - -**SyntaxError**: The rest element has to be the last element when destructuring (1:10) -```bash -> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3}; - | ^ -# Previous behavior: -# x = { x: 1, y: 2, z: 3 } -# y = 2 -# z = 3 -``` - -Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think. - -**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13) - -```bash -> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3}; - | ^ -# Previous behavior: -# x = 1 -# y = { y: 2, z: 3 } -# z = { y: 2, z: 3 } -``` - -Before y and z would just be the same value anyway so there is no reason to need to have both. - -**SyntaxError**: A trailing comma is not permitted after the rest element (1:16) - -```js -let { x, y, ...z, } = obj; -``` - -The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense. - ---- - -get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell)) - -```js -// valid -function something({ set = null, get = null }) {} -``` - -## v6.11.2 (2016-09-23) - -### Bug Fix - -- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo - -```js -// regression with duplicate export check -SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13) - 20 | - 21 | export const { rhythm } = typography; -> 22 | export const { TypographyStyle } = typography -``` - -Bail out for now, and make a change to account for destructuring in the next release. - -## 6.11.1 (2016-09-22) - -### Bug Fix -- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez - -```javascript -export toString from './toString'; -``` - -```bash -`toString` has already been exported. Exported identifiers must be unique. (1:7) -> 1 | export toString from './toString'; - | ^ - 2 | -``` - -## 6.11.0 (2016-09-22) - -### Spec Compliance (will break CI) - -- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo - -```js -// Only one default export allowed per module. (2:9) -export default function() {}; -export { foo as default }; - -// Only one default export allowed per module. (2:0) -export default {}; -export default function() {}; - -// `Foo` has already been exported. Exported identifiers must be unique. (2:0) -export { Foo }; -export class Foo {}; -``` - -### New Feature (Syntax) - -- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88 - -```js -// AST -interface ClassProperty <: Node { - type: "ClassProperty"; - key: Identifier; - value: Expression; - computed: boolean; // added -} -``` - -```js -// with "plugins": ["classProperties"] -class Foo { - [x] - ['y'] -} - -class Bar { - [p] - [m] () {} -} - ``` - -### Bug Fix - -- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper - -```js -declare class X { - a: number; - static b: number; // static - c: number; // this was being marked as static in the AST as well -} -``` - -### Polish - -- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88 - -```js -// Used to error with: -// SyntaxError: Assigning to rvalue (1:0) - -// Now: -// Invalid left-hand side in assignment expression (1:0) -3 = 4 - -// Invalid left-hand side in for-in statement (1:5) -for (+i in {}); -``` - -### Internal - -- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez -- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo - -## 6.10.0 (2016-09-19) - -> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue. - -### Spec Compliance - -* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) - -> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors - -More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists) - -For example: - -```js -// this errors because it uses destructuring and default parameters -// in a function with a "use strict" directive -function a([ option1, option2 ] = []) { - "use strict"; -} - ``` - -The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to. - -### New Feature - -* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer) - -Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8 - -Looks like: - -```js -var a : {| x: number, y: string |} = { x: 0, y: 'foo' }; -``` - -### Bug Fixes - -* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder) -* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper) -* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper) - -### Misc - -* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder) -* Fix Contributing guidelines [skip ci] (Daniel Tschinder) - -## 6.9.2 (2016-09-09) - -The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller. - -## 6.9.1 (2016-08-23) - -This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops. - -### Bug Fixes - -- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez -- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez -- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper -- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez -- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez - -## 6.9.0 (2016-08-16) - -### New syntax support - -- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer - -(Be aware that React is not going to support this syntax) - -```js -
- {...todos.map(todo => )} -
-``` - -- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez - -```js -declare module "foo" { - declare module.exports: {} -} -``` - -### New Features - -- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain -- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens - -### Bug Fixes - -- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez -- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez -- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi -- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez -- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi -- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez -- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez - -### Internal - -- Add codecoverage to tests @danez -- Fix tests to not save expected output if we expect the test to fail @danez -- Make a shallow clone of babel for testing @danez -- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot -- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot -- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot -- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot - -## 6.8.4 (2016-07-06) - -### Bug Fixes - -- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez - -## 6.8.3 (2016-07-02) - -### Bug Fixes - -- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez - -## 6.8.2 (2016-06-24) - -### Bug Fixes - -- Fix parse error with yielding jsx elements in generators `function* it() { yield ; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal -- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez -- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez -- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez -- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez -- Support negative numeric type literals @kittens -- Remove line terminator restriction after await keyword @kittens -- Remove grouped type arrow restriction as it seems flow no longer has it @kittens -- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin -- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi - -### Documentation - -- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene -- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo - -### Internal - -- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez -- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez -- Upgrade test runner ava @kittens -- Add missing generate-identifier-regex script @kittens -- Rename parser context types @kittens -- Add node v6 to travis testing @hzoo -- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens - -## 6.8.1 (2016-06-06) - -### New Feature - -- Parse type parameter declarations with defaults like `type Foo = T` - -### Bug Fixes -- Type parameter declarations need 1 or more type parameters. -- The existential type `*` is not a valid type parameter. -- The existential type `*` is a primary type - -### Spec Compliance -- The param list for type parameter declarations now consists of `TypeParameter` nodes -- New `TypeParameter` AST Node (replaces using the `Identifier` node before) - -``` -interface TypeParameter <: Node { - bound: TypeAnnotation; - default: TypeAnnotation; - name: string; - variance: "plus" | "minus"; -} -``` - -## 6.8.0 (2016-05-02) - -#### New Feature - -##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12)) - -> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md). - -Examples: - -```js -class Foo { - constructor(@foo() x, @bar({ a: 123 }) @baz() y) {} -} - -export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {} - -var obj = { - method(@foo() x, @bar({ a: 123 }) @baz() y) {} -}; -``` - -##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17)) - -There is also a new node type, `ForAwaitStatement`. - -> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals). - -Example: - -```js -async function f() { - for await (let x of y); -} -``` diff --git a/node_modules/@babel/core/node_modules/@babel/parser/LICENSE b/node_modules/@babel/core/node_modules/@babel/parser/LICENSE deleted file mode 100644 index d4c7fc58..00000000 --- a/node_modules/@babel/core/node_modules/@babel/parser/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2012-2014 by various contributors (see AUTHORS) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/@babel/core/node_modules/@babel/parser/README.md b/node_modules/@babel/core/node_modules/@babel/parser/README.md deleted file mode 100644 index 513748c3..00000000 --- a/node_modules/@babel/core/node_modules/@babel/parser/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/parser - -> A JavaScript parser - -See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/parser -``` - -or using yarn: - -```sh -yarn add @babel/parser --dev -``` diff --git a/node_modules/@babel/core/node_modules/@babel/parser/bin/babel-parser.js b/node_modules/@babel/core/node_modules/@babel/parser/bin/babel-parser.js deleted file mode 100755 index 3aca3145..00000000 --- a/node_modules/@babel/core/node_modules/@babel/parser/bin/babel-parser.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node -/* eslint no-var: 0 */ - -var parser = require(".."); -var fs = require("fs"); - -var filename = process.argv[2]; -if (!filename) { - console.error("no filename specified"); -} else { - var file = fs.readFileSync(filename, "utf8"); - var ast = parser.parse(file); - - console.log(JSON.stringify(ast, null, " ")); -} diff --git a/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js b/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js deleted file mode 100644 index c8610f19..00000000 --- a/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js +++ /dev/null @@ -1,14699 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -const lineBreak = /\r\n?|[\n\u2028\u2029]/; -const lineBreakG = new RegExp(lineBreak.source, "g"); -function isNewLine(code) { - switch (code) { - case 10: - case 13: - case 8232: - case 8233: - return true; - - default: - return false; - } -} -const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y; -const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y"); -function isWhitespace(code) { - switch (code) { - case 0x0009: - case 0x000b: - case 0x000c: - case 32: - case 160: - case 5760: - case 0x2000: - case 0x2001: - case 0x2002: - case 0x2003: - case 0x2004: - case 0x2005: - case 0x2006: - case 0x2007: - case 0x2008: - case 0x2009: - case 0x200a: - case 0x202f: - case 0x205f: - case 0x3000: - case 0xfeff: - return true; - - default: - return false; - } -} - -class Position { - constructor(line, col) { - this.line = void 0; - this.column = void 0; - this.line = line; - this.column = col; - } - -} -class SourceLocation { - constructor(start, end) { - this.start = void 0; - this.end = void 0; - this.filename = void 0; - this.identifierName = void 0; - this.start = start; - this.end = end; - } - -} -function getLineInfo(input, offset) { - let line = 1; - let lineStart = 0; - let match; - lineBreakG.lastIndex = 0; - - while ((match = lineBreakG.exec(input)) && match.index < offset) { - line++; - lineStart = lineBreakG.lastIndex; - } - - return new Position(line, offset - lineStart); -} - -class BaseParser { - constructor() { - this.sawUnambiguousESM = false; - this.ambiguousScriptDifferentAst = false; - } - - hasPlugin(name) { - return this.plugins.has(name); - } - - getPluginOption(plugin, name) { - if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name]; - } - -} - -function setTrailingComments(node, comments) { - if (node.trailingComments === undefined) { - node.trailingComments = comments; - } else { - node.trailingComments.unshift(...comments); - } -} - -function setInnerComments(node, comments) { - if (node.innerComments === undefined) { - node.innerComments = comments; - } else if (comments !== undefined) { - node.innerComments.unshift(...comments); - } -} - -function adjustInnerComments(node, elements, commentWS) { - let lastElement = null; - let i = elements.length; - - while (lastElement === null && i > 0) { - lastElement = elements[--i]; - } - - if (lastElement === null || lastElement.start > commentWS.start) { - setInnerComments(node, commentWS.comments); - } else { - setTrailingComments(lastElement, commentWS.comments); - } -} - -class CommentsParser extends BaseParser { - addComment(comment) { - if (this.filename) comment.loc.filename = this.filename; - this.state.comments.push(comment); - } - - processComment(node) { - const { - commentStack - } = this.state; - const commentStackLength = commentStack.length; - if (commentStackLength === 0) return; - let i = commentStackLength - 1; - const lastCommentWS = commentStack[i]; - - if (lastCommentWS.start === node.end) { - lastCommentWS.leadingNode = node; - i--; - } - - const { - start: nodeStart - } = node; - - for (; i >= 0; i--) { - const commentWS = commentStack[i]; - const commentEnd = commentWS.end; - - if (commentEnd > nodeStart) { - commentWS.containingNode = node; - this.finalizeComment(commentWS); - commentStack.splice(i, 1); - } else { - if (commentEnd === nodeStart) { - commentWS.trailingNode = node; - } - - break; - } - } - } - - finalizeComment(commentWS) { - const { - comments - } = commentWS; - - if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { - if (commentWS.leadingNode !== null) { - setTrailingComments(commentWS.leadingNode, comments); - } - - if (commentWS.trailingNode !== null) { - commentWS.trailingNode.leadingComments = comments; - } - } else { - const { - containingNode: node, - start: commentStart - } = commentWS; - - if (this.input.charCodeAt(commentStart - 1) === 44) { - switch (node.type) { - case "ObjectExpression": - case "ObjectPattern": - case "RecordExpression": - adjustInnerComments(node, node.properties, commentWS); - break; - - case "CallExpression": - case "OptionalCallExpression": - adjustInnerComments(node, node.arguments, commentWS); - break; - - case "FunctionDeclaration": - case "FunctionExpression": - case "ArrowFunctionExpression": - case "ObjectMethod": - case "ClassMethod": - case "ClassPrivateMethod": - adjustInnerComments(node, node.params, commentWS); - break; - - case "ArrayExpression": - case "ArrayPattern": - case "TupleExpression": - adjustInnerComments(node, node.elements, commentWS); - break; - - case "ExportNamedDeclaration": - case "ImportDeclaration": - adjustInnerComments(node, node.specifiers, commentWS); - break; - - default: - { - setInnerComments(node, comments); - } - } - } else { - setInnerComments(node, comments); - } - } - } - - finalizeRemainingComments() { - const { - commentStack - } = this.state; - - for (let i = commentStack.length - 1; i >= 0; i--) { - this.finalizeComment(commentStack[i]); - } - - this.state.commentStack = []; - } - - resetPreviousNodeTrailingComments(node) { - const { - commentStack - } = this.state; - const { - length - } = commentStack; - if (length === 0) return; - const commentWS = commentStack[length - 1]; - - if (commentWS.leadingNode === node) { - commentWS.leadingNode = null; - } - } - -} - -const ErrorCodes = Object.freeze({ - SyntaxError: "BABEL_PARSER_SYNTAX_ERROR", - SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" -}); - -const ErrorMessages = makeErrorTemplates({ - AccessorIsGenerator: "A %0ter cannot be a generator.", - ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", - AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", - AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", - AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", - AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", - AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", - AwaitNotInAsyncFunction: "'await' is only allowed within async functions.", - BadGetterArity: "A 'get' accesor must not have any formal parameters.", - BadSetterArity: "A 'set' accesor must have exactly one formal parameter.", - BadSetterRestParameter: "A 'set' accesor function argument must not be a rest parameter.", - ConstructorClassField: "Classes may not have a field named 'constructor'.", - ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", - ConstructorIsAccessor: "Class constructor may not be an accessor.", - ConstructorIsAsync: "Constructor can't be an async function.", - ConstructorIsGenerator: "Constructor can't be a generator.", - DeclarationMissingInitializer: "'%0' require an initialization value.", - DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.", - DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", - DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.", - DecoratorSemicolon: "Decorators must not be followed by a semicolon.", - DecoratorStaticBlock: "Decorators can't be used with a static block.", - DeletePrivateField: "Deleting a private field is not allowed.", - DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", - DuplicateConstructor: "Duplicate constructor in the same class.", - DuplicateDefaultExport: "Only one default export allowed per module.", - DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.", - DuplicateProto: "Redefinition of __proto__ property.", - DuplicateRegExpFlags: "Duplicate regular expression flag.", - ElementAfterRest: "Rest element must be last element.", - EscapedCharNotAnIdentifier: "Invalid Unicode escape.", - ExportBindingIsString: "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?", - ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", - ForInOfLoopInitializer: "'%0' loop variable declaration may not have an initializer.", - ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", - ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", - GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", - IllegalBreakContinue: "Unsyntactic %0.", - IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", - IllegalReturn: "'return' outside of function.", - ImportBindingIsString: 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?', - ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.", - ImportCallArity: "`import()` requires exactly %0.", - ImportCallNotNewExpression: "Cannot use new with import(...).", - ImportCallSpreadArgument: "`...` is not allowed in `import()`.", - InvalidBigIntLiteral: "Invalid BigIntLiteral.", - InvalidCodePoint: "Code point out of bounds.", - InvalidDecimal: "Invalid decimal.", - InvalidDigit: "Expected number in radix %0.", - InvalidEscapeSequence: "Bad character escape sequence.", - InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", - InvalidEscapedReservedWord: "Escape sequence in keyword %0.", - InvalidIdentifier: "Invalid identifier %0.", - InvalidLhs: "Invalid left-hand side in %0.", - InvalidLhsBinding: "Binding invalid left-hand side in %0.", - InvalidNumber: "Invalid number.", - InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", - InvalidOrUnexpectedToken: "Unexpected character '%0'.", - InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", - InvalidPrivateFieldResolution: "Private name #%0 is not defined.", - InvalidPropertyBindingPattern: "Binding member expression.", - InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", - InvalidRestAssignmentPattern: "Invalid rest operator's argument.", - LabelRedeclaration: "Label '%0' is already declared.", - LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", - LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", - MalformedRegExpFlags: "Invalid regular expression flag.", - MissingClassName: "A class name is required.", - MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", - MissingSemicolon: "Missing semicolon.", - MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", - MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", - ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", - ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", - ModuleAttributesWithDuplicateKeys: 'Duplicate key "%0" is not allowed in module attributes.', - ModuleExportNameHasLoneSurrogate: "An export name cannot include a lone surrogate, found '\\u%0'.", - ModuleExportUndefined: "Export '%0' is not defined.", - MultipleDefaultsInSwitch: "Multiple default clauses.", - NewlineAfterThrow: "Illegal newline after throw.", - NoCatchOrFinally: "Missing catch or finally clause.", - NumberIdentifier: "Identifier directly after number.", - NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", - ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", - OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", - OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", - OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", - ParamDupe: "Argument name clash.", - PatternHasAccessor: "Object pattern can't contain getter or setter.", - PatternHasMethod: "Object pattern can't contain methods.", - PipeBodyIsTighter: "Unexpected %0 after pipeline body; any %0 expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", - PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', - PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.", - PipeTopicUnconfiguredToken: 'Invalid topic token %0. In order to use %0 as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "%0" }.', - PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.", - PipeUnparenthesizedBody: "Hack-style pipe body cannot be an unparenthesized %0 expression; please wrap it in parentheses.", - PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', - PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.", - PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.", - PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.", - PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", - PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', - PrivateInExpectedIn: "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`).", - PrivateNameRedeclaration: "Duplicate private name #%0.", - RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", - RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", - RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", - RecordNoProto: "'__proto__' is not allowed in Record expressions.", - RestTrailingComma: "Unexpected trailing comma after rest element.", - SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", - StaticPrototype: "Classes may not have static property named prototype.", - StrictDelete: "Deleting local variable in strict mode.", - StrictEvalArguments: "Assigning to '%0' in strict mode.", - StrictEvalArgumentsBinding: "Binding '%0' in strict mode.", - StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", - StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", - StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", - StrictWith: "'with' in strict mode.", - SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", - SuperPrivateField: "Private fields can't be accessed on super.", - TrailingDecorator: "Decorators must be attached to a class element.", - TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", - TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", - TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", - UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", - UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', - UnexpectedDigitAfterHash: "Unexpected digit after hash token.", - UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", - UnexpectedKeyword: "Unexpected keyword '%0'.", - UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", - UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", - UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", - UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", - UnexpectedPrivateField: "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).", - UnexpectedReservedWord: "Unexpected reserved word '%0'.", - UnexpectedSuper: "'super' is only allowed in object methods and classes.", - UnexpectedToken: "Unexpected token '%0'.", - UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", - UnsupportedBind: "Binding should be performed on object property.", - UnsupportedDecoratorExport: "A decorated export must export a class declaration.", - UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", - UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", - UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1.", - UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", - UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", - UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", - UnterminatedComment: "Unterminated comment.", - UnterminatedRegExp: "Unterminated regular expression.", - UnterminatedString: "Unterminated string constant.", - UnterminatedTemplate: "Unterminated template.", - VarRedeclaration: "Identifier '%0' has already been declared.", - YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", - YieldInParameter: "Yield expression is not allowed in formal parameters.", - ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." -}, ErrorCodes.SyntaxError); -const SourceTypeModuleErrorMessages = makeErrorTemplates({ - ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`, - ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'` -}, ErrorCodes.SourceTypeModuleError); - -function keepReasonCodeCompat(reasonCode, syntaxPlugin) { - { - if (syntaxPlugin === "flow" && reasonCode === "PatternIsOptional") { - return "OptionalBindingPattern"; - } - } - return reasonCode; -} - -function makeErrorTemplates(messages, code, syntaxPlugin) { - const templates = {}; - Object.keys(messages).forEach(reasonCode => { - templates[reasonCode] = Object.freeze({ - code, - reasonCode: keepReasonCodeCompat(reasonCode, syntaxPlugin), - template: messages[reasonCode] - }); - }); - return Object.freeze(templates); -} -class ParserError extends CommentsParser { - getLocationForPosition(pos) { - let loc; - if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = getLineInfo(this.input, pos); - return loc; - } - - raise(pos, { - code, - reasonCode, - template - }, ...params) { - return this.raiseWithData(pos, { - code, - reasonCode - }, template, ...params); - } - - raiseOverwrite(pos, { - code, - template - }, ...params) { - const loc = this.getLocationForPosition(pos); - const message = template.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`; - - if (this.options.errorRecovery) { - const errors = this.state.errors; - - for (let i = errors.length - 1; i >= 0; i--) { - const error = errors[i]; - - if (error.pos === pos) { - return Object.assign(error, { - message - }); - } else if (error.pos < pos) { - break; - } - } - } - - return this._raise({ - code, - loc, - pos - }, message); - } - - raiseWithData(pos, data, errorTemplate, ...params) { - const loc = this.getLocationForPosition(pos); - const message = errorTemplate.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`; - return this._raise(Object.assign({ - loc, - pos - }, data), message); - } - - _raise(errorContext, message) { - const err = new SyntaxError(message); - Object.assign(err, errorContext); - - if (this.options.errorRecovery) { - if (!this.isLookahead) this.state.errors.push(err); - return err; - } else { - throw err; - } - } - -} - -var estree = (superClass => class extends superClass { - parseRegExpLiteral({ - pattern, - flags - }) { - let regex = null; - - try { - regex = new RegExp(pattern, flags); - } catch (e) {} - - const node = this.estreeParseLiteral(regex); - node.regex = { - pattern, - flags - }; - return node; - } - - parseBigIntLiteral(value) { - let bigInt; - - try { - bigInt = BigInt(value); - } catch (_unused) { - bigInt = null; - } - - const node = this.estreeParseLiteral(bigInt); - node.bigint = String(node.value || value); - return node; - } - - parseDecimalLiteral(value) { - const decimal = null; - const node = this.estreeParseLiteral(decimal); - node.decimal = String(node.value || value); - return node; - } - - estreeParseLiteral(value) { - return this.parseLiteral(value, "Literal"); - } - - parseStringLiteral(value) { - return this.estreeParseLiteral(value); - } - - parseNumericLiteral(value) { - return this.estreeParseLiteral(value); - } - - parseNullLiteral() { - return this.estreeParseLiteral(null); - } - - parseBooleanLiteral(value) { - return this.estreeParseLiteral(value); - } - - directiveToStmt(directive) { - const directiveLiteral = directive.value; - const stmt = this.startNodeAt(directive.start, directive.loc.start); - const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start); - expression.value = directiveLiteral.extra.expressionValue; - expression.raw = directiveLiteral.extra.raw; - stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end); - stmt.directive = directiveLiteral.extra.raw.slice(1, -1); - return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end); - } - - initFunction(node, isAsync) { - super.initFunction(node, isAsync); - node.expression = false; - } - - checkDeclaration(node) { - if (node != null && this.isObjectProperty(node)) { - this.checkDeclaration(node.value); - } else { - super.checkDeclaration(node); - } - } - - getObjectOrClassMethodParams(method) { - return method.value.params; - } - - isValidDirective(stmt) { - var _stmt$expression$extr; - - return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); - } - - stmtToDirective(stmt) { - const value = stmt.expression.value; - const directive = super.stmtToDirective(stmt); - this.addExtra(directive.value, "expressionValue", value); - return directive; - } - - parseBlockBody(node, ...args) { - super.parseBlockBody(node, ...args); - const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); - node.body = directiveStatements.concat(node.body); - delete node.directives; - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); - - if (method.typeParameters) { - method.value.typeParameters = method.typeParameters; - delete method.typeParameters; - } - - classBody.body.push(method); - } - - parsePrivateName() { - const node = super.parsePrivateName(); - - if (!this.getPluginOption("estree", "classFeatures")) { - return node; - } - - return this.convertPrivateNameToPrivateIdentifier(node); - } - - convertPrivateNameToPrivateIdentifier(node) { - const name = super.getPrivateNameSV(node); - node = node; - delete node.id; - node.name = name; - node.type = "PrivateIdentifier"; - return node; - } - - isPrivateName(node) { - if (!this.getPluginOption("estree", "classFeatures")) { - return super.isPrivateName(node); - } - - return node.type === "PrivateIdentifier"; - } - - getPrivateNameSV(node) { - if (!this.getPluginOption("estree", "classFeatures")) { - return super.getPrivateNameSV(node); - } - - return node.name; - } - - parseLiteral(value, type) { - const node = super.parseLiteral(value, type); - node.raw = node.extra.raw; - delete node.extra; - return node; - } - - parseFunctionBody(node, allowExpression, isMethod = false) { - super.parseFunctionBody(node, allowExpression, isMethod); - node.expression = node.body.type !== "BlockStatement"; - } - - parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { - let funcNode = this.startNode(); - funcNode.kind = node.kind; - funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); - funcNode.type = "FunctionExpression"; - delete funcNode.kind; - node.value = funcNode; - - if (type === "ClassPrivateMethod") { - node.computed = false; - } - - type = "MethodDefinition"; - return this.finishNode(node, type); - } - - parseClassProperty(...args) { - const propertyNode = super.parseClassProperty(...args); - - if (this.getPluginOption("estree", "classFeatures")) { - propertyNode.type = "PropertyDefinition"; - } - - return propertyNode; - } - - parseClassPrivateProperty(...args) { - const propertyNode = super.parseClassPrivateProperty(...args); - - if (this.getPluginOption("estree", "classFeatures")) { - propertyNode.type = "PropertyDefinition"; - propertyNode.computed = false; - } - - return propertyNode; - } - - parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { - const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); - - if (node) { - node.type = "Property"; - if (node.kind === "method") node.kind = "init"; - node.shorthand = false; - } - - return node; - } - - parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) { - const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors); - - if (node) { - node.kind = "init"; - node.type = "Property"; - } - - return node; - } - - isAssignable(node, isBinding) { - if (node != null && this.isObjectProperty(node)) { - return this.isAssignable(node.value, isBinding); - } - - return super.isAssignable(node, isBinding); - } - - toAssignable(node, isLHS = false) { - if (node != null && this.isObjectProperty(node)) { - this.toAssignable(node.value, isLHS); - return node; - } - - return super.toAssignable(node, isLHS); - } - - toAssignableObjectExpressionProp(prop, ...args) { - if (prop.kind === "get" || prop.kind === "set") { - this.raise(prop.key.start, ErrorMessages.PatternHasAccessor); - } else if (prop.method) { - this.raise(prop.key.start, ErrorMessages.PatternHasMethod); - } else { - super.toAssignableObjectExpressionProp(prop, ...args); - } - } - - finishCallExpression(node, optional) { - super.finishCallExpression(node, optional); - - if (node.callee.type === "Import") { - node.type = "ImportExpression"; - node.source = node.arguments[0]; - - if (this.hasPlugin("importAssertions")) { - var _node$arguments$; - - node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null; - } - - delete node.arguments; - delete node.callee; - } - - return node; - } - - toReferencedArguments(node) { - if (node.type === "ImportExpression") { - return; - } - - super.toReferencedArguments(node); - } - - parseExport(node) { - super.parseExport(node); - - switch (node.type) { - case "ExportAllDeclaration": - node.exported = null; - break; - - case "ExportNamedDeclaration": - if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { - node.type = "ExportAllDeclaration"; - node.exported = node.specifiers[0].exported; - delete node.specifiers; - } - - break; - } - - return node; - } - - parseSubscript(base, startPos, startLoc, noCalls, state) { - const node = super.parseSubscript(base, startPos, startLoc, noCalls, state); - - if (state.optionalChainMember) { - if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { - node.type = node.type.substring(8); - } - - if (state.stop) { - const chain = this.startNodeAtNode(node); - chain.expression = node; - return this.finishNode(chain, "ChainExpression"); - } - } else if (node.type === "MemberExpression" || node.type === "CallExpression") { - node.optional = false; - } - - return node; - } - - hasPropertyAsPrivateName(node) { - if (node.type === "ChainExpression") { - node = node.expression; - } - - return super.hasPropertyAsPrivateName(node); - } - - isOptionalChain(node) { - return node.type === "ChainExpression"; - } - - isObjectProperty(node) { - return node.type === "Property" && node.kind === "init" && !node.method; - } - - isObjectMethod(node) { - return node.method || node.kind === "get" || node.kind === "set"; - } - -}); - -class TokContext { - constructor(token, preserveSpace) { - this.token = void 0; - this.preserveSpace = void 0; - this.token = token; - this.preserveSpace = !!preserveSpace; - } - -} -const types = { - brace: new TokContext("{"), - template: new TokContext("`", true) -}; - -const beforeExpr = true; -const startsExpr = true; -const isLoop = true; -const isAssign = true; -const prefix = true; -const postfix = true; -class ExportedTokenType { - constructor(label, conf = {}) { - this.label = void 0; - this.keyword = void 0; - this.beforeExpr = void 0; - this.startsExpr = void 0; - this.rightAssociative = void 0; - this.isLoop = void 0; - this.isAssign = void 0; - this.prefix = void 0; - this.postfix = void 0; - this.binop = void 0; - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.rightAssociative = !!conf.rightAssociative; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop != null ? conf.binop : null; - { - this.updateContext = null; - } - } - -} -const keywords$1 = new Map(); - -function createKeyword(name, options = {}) { - options.keyword = name; - const token = createToken(name, options); - keywords$1.set(name, token); - return token; -} - -function createBinop(name, binop) { - return createToken(name, { - beforeExpr, - binop - }); -} - -let tokenTypeCounter = -1; -const tokenTypes = []; -const tokenLabels = []; -const tokenBinops = []; -const tokenBeforeExprs = []; -const tokenStartsExprs = []; -const tokenPrefixes = []; - -function createToken(name, options = {}) { - var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; - - ++tokenTypeCounter; - tokenLabels.push(name); - tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); - tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); - tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); - tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); - tokenTypes.push(new ExportedTokenType(name, options)); - return tokenTypeCounter; -} - -const tt = { - num: createToken("num", { - startsExpr - }), - bigint: createToken("bigint", { - startsExpr - }), - decimal: createToken("decimal", { - startsExpr - }), - regexp: createToken("regexp", { - startsExpr - }), - string: createToken("string", { - startsExpr - }), - name: createToken("name", { - startsExpr - }), - privateName: createToken("#name", { - startsExpr - }), - eof: createToken("eof"), - bracketL: createToken("[", { - beforeExpr, - startsExpr - }), - bracketHashL: createToken("#[", { - beforeExpr, - startsExpr - }), - bracketBarL: createToken("[|", { - beforeExpr, - startsExpr - }), - bracketR: createToken("]"), - bracketBarR: createToken("|]"), - braceL: createToken("{", { - beforeExpr, - startsExpr - }), - braceBarL: createToken("{|", { - beforeExpr, - startsExpr - }), - braceHashL: createToken("#{", { - beforeExpr, - startsExpr - }), - braceR: createToken("}", { - beforeExpr - }), - braceBarR: createToken("|}"), - parenL: createToken("(", { - beforeExpr, - startsExpr - }), - parenR: createToken(")"), - comma: createToken(",", { - beforeExpr - }), - semi: createToken(";", { - beforeExpr - }), - colon: createToken(":", { - beforeExpr - }), - doubleColon: createToken("::", { - beforeExpr - }), - dot: createToken("."), - question: createToken("?", { - beforeExpr - }), - questionDot: createToken("?."), - arrow: createToken("=>", { - beforeExpr - }), - template: createToken("template"), - ellipsis: createToken("...", { - beforeExpr - }), - backQuote: createToken("`", { - startsExpr - }), - dollarBraceL: createToken("${", { - beforeExpr, - startsExpr - }), - at: createToken("@"), - hash: createToken("#", { - startsExpr - }), - interpreterDirective: createToken("#!..."), - eq: createToken("=", { - beforeExpr, - isAssign - }), - assign: createToken("_=", { - beforeExpr, - isAssign - }), - slashAssign: createToken("_=", { - beforeExpr, - isAssign - }), - moduloAssign: createToken("_=", { - beforeExpr, - isAssign - }), - incDec: createToken("++/--", { - prefix, - postfix, - startsExpr - }), - bang: createToken("!", { - beforeExpr, - prefix, - startsExpr - }), - tilde: createToken("~", { - beforeExpr, - prefix, - startsExpr - }), - pipeline: createBinop("|>", 0), - nullishCoalescing: createBinop("??", 1), - logicalOR: createBinop("||", 1), - logicalAND: createBinop("&&", 2), - bitwiseOR: createBinop("|", 3), - bitwiseXOR: createBinop("^", 4), - bitwiseAND: createBinop("&", 5), - equality: createBinop("==/!=/===/!==", 6), - relational: createBinop("/<=/>=", 7), - bitShift: createBinop("<>/>>>", 8), - plusMin: createToken("+/-", { - beforeExpr, - binop: 9, - prefix, - startsExpr - }), - modulo: createToken("%", { - binop: 10, - startsExpr - }), - star: createToken("*", { - binop: 10 - }), - slash: createBinop("/", 10), - exponent: createToken("**", { - beforeExpr, - binop: 11, - rightAssociative: true - }), - _in: createKeyword("in", { - beforeExpr, - binop: 7 - }), - _instanceof: createKeyword("instanceof", { - beforeExpr, - binop: 7 - }), - _break: createKeyword("break"), - _case: createKeyword("case", { - beforeExpr - }), - _catch: createKeyword("catch"), - _continue: createKeyword("continue"), - _debugger: createKeyword("debugger"), - _default: createKeyword("default", { - beforeExpr - }), - _else: createKeyword("else", { - beforeExpr - }), - _finally: createKeyword("finally"), - _function: createKeyword("function", { - startsExpr - }), - _if: createKeyword("if"), - _return: createKeyword("return", { - beforeExpr - }), - _switch: createKeyword("switch"), - _throw: createKeyword("throw", { - beforeExpr, - prefix, - startsExpr - }), - _try: createKeyword("try"), - _var: createKeyword("var"), - _const: createKeyword("const"), - _with: createKeyword("with"), - _new: createKeyword("new", { - beforeExpr, - startsExpr - }), - _this: createKeyword("this", { - startsExpr - }), - _super: createKeyword("super", { - startsExpr - }), - _class: createKeyword("class", { - startsExpr - }), - _extends: createKeyword("extends", { - beforeExpr - }), - _export: createKeyword("export"), - _import: createKeyword("import", { - startsExpr - }), - _null: createKeyword("null", { - startsExpr - }), - _true: createKeyword("true", { - startsExpr - }), - _false: createKeyword("false", { - startsExpr - }), - _typeof: createKeyword("typeof", { - beforeExpr, - prefix, - startsExpr - }), - _void: createKeyword("void", { - beforeExpr, - prefix, - startsExpr - }), - _delete: createKeyword("delete", { - beforeExpr, - prefix, - startsExpr - }), - _do: createKeyword("do", { - isLoop, - beforeExpr - }), - _for: createKeyword("for", { - isLoop - }), - _while: createKeyword("while", { - isLoop - }), - jsxName: createToken("jsxName"), - jsxText: createToken("jsxText", { - beforeExpr: true - }), - jsxTagStart: createToken("jsxTagStart", { - startsExpr: true - }), - jsxTagEnd: createToken("jsxTagEnd"), - placeholder: createToken("%%", { - startsExpr: true - }) -}; -function tokenComesBeforeExpression(token) { - return tokenBeforeExprs[token]; -} -function tokenCanStartExpression(token) { - return tokenStartsExprs[token]; -} -function tokenIsAssignment(token) { - return token >= 35 && token <= 38; -} -function tokenIsLoop(token) { - return token >= 89 && token <= 91; -} -function tokenIsKeyword(token) { - return token >= 57 && token <= 91; -} -function tokenIsOperator(token) { - return token >= 42 && token <= 58; -} -function tokenIsPostfix(token) { - return token === 39; -} -function tokenIsPrefix(token) { - return tokenPrefixes[token]; -} -function tokenLabelName(token) { - return tokenLabels[token]; -} -function tokenOperatorPrecedence(token) { - return tokenBinops[token]; -} -function tokenIsRightAssociative(token) { - return token === 56; -} -function getExportedToken(token) { - return tokenTypes[token]; -} -function isTokenType(obj) { - return typeof obj === "number"; -} -{ - tokenTypes[16].updateContext = context => { - context.pop(); - }; - - tokenTypes[13].updateContext = tokenTypes[15].updateContext = tokenTypes[31].updateContext = context => { - context.push(types.brace); - }; - - tokenTypes[30].updateContext = context => { - if (context[context.length - 1] === types.template) { - context.pop(); - } else { - context.push(types.template); - } - }; - - tokenTypes[94].updateContext = context => { - context.push(types.j_expr, types.j_oTag); - }; -} - -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; -const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - -function isInAstralSet(code, set) { - let pos = 0x10000; - - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - - return false; -} - -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes); -} -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -const reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const keywords = new Set(reservedWords.keyword); -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); -function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; -} -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} -function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); -} -function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); -} -function isKeyword(word) { - return keywords.has(word); -} - -function isIteratorStart(current, next) { - return current === 64 && next === 64; -} -const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]); -function canBeReservedWord(word) { - return reservedWordLikeSet.has(word); -} - -const SCOPE_OTHER = 0b000000000, - SCOPE_PROGRAM = 0b000000001, - SCOPE_FUNCTION = 0b000000010, - SCOPE_ARROW = 0b000000100, - SCOPE_SIMPLE_CATCH = 0b000001000, - SCOPE_SUPER = 0b000010000, - SCOPE_DIRECT_SUPER = 0b000100000, - SCOPE_CLASS = 0b001000000, - SCOPE_STATIC_BLOCK = 0b010000000, - SCOPE_TS_MODULE = 0b100000000, - SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE; -const BIND_KIND_VALUE = 0b000000000001, - BIND_KIND_TYPE = 0b000000000010, - BIND_SCOPE_VAR = 0b000000000100, - BIND_SCOPE_LEXICAL = 0b000000001000, - BIND_SCOPE_FUNCTION = 0b000000010000, - BIND_FLAGS_NONE = 0b000001000000, - BIND_FLAGS_CLASS = 0b000010000000, - BIND_FLAGS_TS_ENUM = 0b000100000000, - BIND_FLAGS_TS_CONST_ENUM = 0b001000000000, - BIND_FLAGS_TS_EXPORT_ONLY = 0b010000000000, - BIND_FLAGS_FLOW_DECLARE_FN = 0b100000000000; -const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS, - BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, - BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, - BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, - BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, - BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, - BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM, - BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, - BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, - BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, - BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; -const CLASS_ELEMENT_FLAG_STATIC = 0b100, - CLASS_ELEMENT_KIND_GETTER = 0b010, - CLASS_ELEMENT_KIND_SETTER = 0b001, - CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; -const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, - CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, - CLASS_ELEMENT_OTHER = 0; - -class Scope { - constructor(flags) { - this.var = new Set(); - this.lexical = new Set(); - this.functions = new Set(); - this.flags = flags; - } - -} -class ScopeHandler { - constructor(raise, inModule) { - this.scopeStack = []; - this.undefinedExports = new Map(); - this.undefinedPrivateNames = new Map(); - this.raise = raise; - this.inModule = inModule; - } - - get inFunction() { - return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0; - } - - get allowSuper() { - return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0; - } - - get allowDirectSuper() { - return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0; - } - - get inClass() { - return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0; - } - - get inClassAndNotInNonArrowFunction() { - const flags = this.currentThisScopeFlags(); - return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0; - } - - get inStaticBlock() { - for (let i = this.scopeStack.length - 1;; i--) { - const { - flags - } = this.scopeStack[i]; - - if (flags & SCOPE_STATIC_BLOCK) { - return true; - } - - if (flags & (SCOPE_VAR | SCOPE_CLASS)) { - return false; - } - } - } - - get inNonArrowFunction() { - return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0; - } - - get treatFunctionsAsVar() { - return this.treatFunctionsAsVarInScope(this.currentScope()); - } - - createScope(flags) { - return new Scope(flags); - } - - enter(flags) { - this.scopeStack.push(this.createScope(flags)); - } - - exit() { - this.scopeStack.pop(); - } - - treatFunctionsAsVarInScope(scope) { - return !!(scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_PROGRAM); - } - - declareName(name, bindingType, pos) { - let scope = this.currentScope(); - - if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) { - this.checkRedeclarationInScope(scope, name, bindingType, pos); - - if (bindingType & BIND_SCOPE_FUNCTION) { - scope.functions.add(name); - } else { - scope.lexical.add(name); - } - - if (bindingType & BIND_SCOPE_LEXICAL) { - this.maybeExportDefined(scope, name); - } - } else if (bindingType & BIND_SCOPE_VAR) { - for (let i = this.scopeStack.length - 1; i >= 0; --i) { - scope = this.scopeStack[i]; - this.checkRedeclarationInScope(scope, name, bindingType, pos); - scope.var.add(name); - this.maybeExportDefined(scope, name); - if (scope.flags & SCOPE_VAR) break; - } - } - - if (this.inModule && scope.flags & SCOPE_PROGRAM) { - this.undefinedExports.delete(name); - } - } - - maybeExportDefined(scope, name) { - if (this.inModule && scope.flags & SCOPE_PROGRAM) { - this.undefinedExports.delete(name); - } - } - - checkRedeclarationInScope(scope, name, bindingType, pos) { - if (this.isRedeclaredInScope(scope, name, bindingType)) { - this.raise(pos, ErrorMessages.VarRedeclaration, name); - } - } - - isRedeclaredInScope(scope, name, bindingType) { - if (!(bindingType & BIND_KIND_VALUE)) return false; - - if (bindingType & BIND_SCOPE_LEXICAL) { - return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name); - } - - if (bindingType & BIND_SCOPE_FUNCTION) { - return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name); - } - - return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name); - } - - checkLocalExport(id) { - const { - name - } = id; - const topLevelScope = this.scopeStack[0]; - - if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) { - this.undefinedExports.set(name, id.start); - } - } - - currentScope() { - return this.scopeStack[this.scopeStack.length - 1]; - } - - currentVarScopeFlags() { - for (let i = this.scopeStack.length - 1;; i--) { - const { - flags - } = this.scopeStack[i]; - - if (flags & SCOPE_VAR) { - return flags; - } - } - } - - currentThisScopeFlags() { - for (let i = this.scopeStack.length - 1;; i--) { - const { - flags - } = this.scopeStack[i]; - - if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) { - return flags; - } - } - } - -} - -class FlowScope extends Scope { - constructor(...args) { - super(...args); - this.declareFunctions = new Set(); - } - -} - -class FlowScopeHandler extends ScopeHandler { - createScope(flags) { - return new FlowScope(flags); - } - - declareName(name, bindingType, pos) { - const scope = this.currentScope(); - - if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { - this.checkRedeclarationInScope(scope, name, bindingType, pos); - this.maybeExportDefined(scope, name); - scope.declareFunctions.add(name); - return; - } - - super.declareName(...arguments); - } - - isRedeclaredInScope(scope, name, bindingType) { - if (super.isRedeclaredInScope(...arguments)) return true; - - if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { - return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name)); - } - - return false; - } - - checkLocalExport(id) { - if (!this.scopeStack[0].declareFunctions.has(id.name)) { - super.checkLocalExport(id); - } - } - -} - -class State { - constructor() { - this.strict = void 0; - this.curLine = void 0; - this.startLoc = void 0; - this.endLoc = void 0; - this.errors = []; - this.potentialArrowAt = -1; - this.noArrowAt = []; - this.noArrowParamsConversionAt = []; - this.maybeInArrowParameters = false; - this.inType = false; - this.noAnonFunctionType = false; - this.inPropertyName = false; - this.hasFlowComment = false; - this.isAmbientContext = false; - this.inAbstractClass = false; - this.topicContext = { - maxNumOfResolvableTopics: 0, - maxTopicIndex: null - }; - this.soloAwait = false; - this.inFSharpPipelineDirectBody = false; - this.labels = []; - this.decoratorStack = [[]]; - this.comments = []; - this.commentStack = []; - this.pos = 0; - this.lineStart = 0; - this.type = 7; - this.value = null; - this.start = 0; - this.end = 0; - this.lastTokEndLoc = null; - this.lastTokStartLoc = null; - this.lastTokStart = 0; - this.lastTokEnd = 0; - this.context = [types.brace]; - this.exprAllowed = true; - this.containsEsc = false; - this.strictErrors = new Map(); - this.tokensLength = 0; - } - - init(options) { - this.strict = options.strictMode === false ? false : options.strictMode === true ? true : options.sourceType === "module"; - this.curLine = options.startLine; - this.startLoc = this.endLoc = this.curPosition(); - } - - curPosition() { - return new Position(this.curLine, this.pos - this.lineStart); - } - - clone(skipArrays) { - const state = new State(); - const keys = Object.keys(this); - - for (let i = 0, length = keys.length; i < length; i++) { - const key = keys[i]; - let val = this[key]; - - if (!skipArrays && Array.isArray(val)) { - val = val.slice(); - } - - state[key] = val; - } - - return state; - } - -} - -var _isDigit = function isDigit(code) { - return code >= 48 && code <= 57; -}; -const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100]); -const forbiddenNumericSeparatorSiblings = { - decBinOct: [46, 66, 69, 79, 95, 98, 101, 111], - hex: [46, 88, 95, 120] -}; -const allowedNumericSeparatorSiblings = {}; -allowedNumericSeparatorSiblings.bin = [48, 49]; -allowedNumericSeparatorSiblings.oct = [...allowedNumericSeparatorSiblings.bin, 50, 51, 52, 53, 54, 55]; -allowedNumericSeparatorSiblings.dec = [...allowedNumericSeparatorSiblings.oct, 56, 57]; -allowedNumericSeparatorSiblings.hex = [...allowedNumericSeparatorSiblings.dec, 65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102]; -class Token { - constructor(state) { - this.type = state.type; - this.value = state.value; - this.start = state.start; - this.end = state.end; - this.loc = new SourceLocation(state.startLoc, state.endLoc); - } - -} -class Tokenizer extends ParserError { - constructor(options, input) { - super(); - this.isLookahead = void 0; - this.tokens = []; - this.state = new State(); - this.state.init(options); - this.input = input; - this.length = input.length; - this.isLookahead = false; - } - - pushToken(token) { - this.tokens.length = this.state.tokensLength; - this.tokens.push(token); - ++this.state.tokensLength; - } - - next() { - this.checkKeywordEscapes(); - - if (this.options.tokens) { - this.pushToken(new Token(this.state)); - } - - this.state.lastTokEnd = this.state.end; - this.state.lastTokStart = this.state.start; - this.state.lastTokEndLoc = this.state.endLoc; - this.state.lastTokStartLoc = this.state.startLoc; - this.nextToken(); - } - - eat(type) { - if (this.match(type)) { - this.next(); - return true; - } else { - return false; - } - } - - match(type) { - return this.state.type === type; - } - - createLookaheadState(state) { - return { - pos: state.pos, - value: null, - type: state.type, - start: state.start, - end: state.end, - lastTokEnd: state.end, - context: [this.curContext()], - inType: state.inType - }; - } - - lookahead() { - const old = this.state; - this.state = this.createLookaheadState(old); - this.isLookahead = true; - this.nextToken(); - this.isLookahead = false; - const curr = this.state; - this.state = old; - return curr; - } - - nextTokenStart() { - return this.nextTokenStartSince(this.state.pos); - } - - nextTokenStartSince(pos) { - skipWhiteSpace.lastIndex = pos; - return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; - } - - lookaheadCharCode() { - return this.input.charCodeAt(this.nextTokenStart()); - } - - codePointAtPos(pos) { - let cp = this.input.charCodeAt(pos); - - if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { - const trail = this.input.charCodeAt(pos); - - if ((trail & 0xfc00) === 0xdc00) { - cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); - } - } - - return cp; - } - - setStrict(strict) { - this.state.strict = strict; - - if (strict) { - this.state.strictErrors.forEach((message, pos) => this.raise(pos, message)); - this.state.strictErrors.clear(); - } - } - - curContext() { - return this.state.context[this.state.context.length - 1]; - } - - nextToken() { - const curContext = this.curContext(); - if (!curContext.preserveSpace) this.skipSpace(); - this.state.start = this.state.pos; - if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); - - if (this.state.pos >= this.length) { - this.finishToken(7); - return; - } - - if (curContext === types.template) { - this.readTmplToken(); - } else { - this.getTokenFromCode(this.codePointAtPos(this.state.pos)); - } - } - - skipBlockComment() { - let startLoc; - if (!this.isLookahead) startLoc = this.state.curPosition(); - const start = this.state.pos; - const end = this.input.indexOf("*/", start + 2); - if (end === -1) throw this.raise(start, ErrorMessages.UnterminatedComment); - this.state.pos = end + 2; - lineBreakG.lastIndex = start + 2; - - while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) { - ++this.state.curLine; - this.state.lineStart = lineBreakG.lastIndex; - } - - if (this.isLookahead) return; - const comment = { - type: "CommentBlock", - value: this.input.slice(start + 2, end), - start, - end: end + 2, - loc: new SourceLocation(startLoc, this.state.curPosition()) - }; - if (this.options.tokens) this.pushToken(comment); - return comment; - } - - skipLineComment(startSkip) { - const start = this.state.pos; - let startLoc; - if (!this.isLookahead) startLoc = this.state.curPosition(); - let ch = this.input.charCodeAt(this.state.pos += startSkip); - - if (this.state.pos < this.length) { - while (!isNewLine(ch) && ++this.state.pos < this.length) { - ch = this.input.charCodeAt(this.state.pos); - } - } - - if (this.isLookahead) return; - const end = this.state.pos; - const value = this.input.slice(start + startSkip, end); - const comment = { - type: "CommentLine", - value, - start, - end, - loc: new SourceLocation(startLoc, this.state.curPosition()) - }; - if (this.options.tokens) this.pushToken(comment); - return comment; - } - - skipSpace() { - const spaceStart = this.state.pos; - const comments = []; - - loop: while (this.state.pos < this.length) { - const ch = this.input.charCodeAt(this.state.pos); - - switch (ch) { - case 32: - case 160: - case 9: - ++this.state.pos; - break; - - case 13: - if (this.input.charCodeAt(this.state.pos + 1) === 10) { - ++this.state.pos; - } - - case 10: - case 8232: - case 8233: - ++this.state.pos; - ++this.state.curLine; - this.state.lineStart = this.state.pos; - break; - - case 47: - switch (this.input.charCodeAt(this.state.pos + 1)) { - case 42: - { - const comment = this.skipBlockComment(); - - if (comment !== undefined) { - this.addComment(comment); - if (this.options.attachComment) comments.push(comment); - } - - break; - } - - case 47: - { - const comment = this.skipLineComment(2); - - if (comment !== undefined) { - this.addComment(comment); - if (this.options.attachComment) comments.push(comment); - } - - break; - } - - default: - break loop; - } - - break; - - default: - if (isWhitespace(ch)) { - ++this.state.pos; - } else if (ch === 45 && !this.inModule) { - const pos = this.state.pos; - - if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { - const comment = this.skipLineComment(3); - - if (comment !== undefined) { - this.addComment(comment); - if (this.options.attachComment) comments.push(comment); - } - } else { - break loop; - } - } else if (ch === 60 && !this.inModule) { - const pos = this.state.pos; - - if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { - const comment = this.skipLineComment(4); - - if (comment !== undefined) { - this.addComment(comment); - if (this.options.attachComment) comments.push(comment); - } - } else { - break loop; - } - } else { - break loop; - } - - } - } - - if (comments.length > 0) { - const end = this.state.pos; - const CommentWhitespace = { - start: spaceStart, - end, - comments, - leadingNode: null, - trailingNode: null, - containingNode: null - }; - this.state.commentStack.push(CommentWhitespace); - } - } - - finishToken(type, val) { - this.state.end = this.state.pos; - const prevType = this.state.type; - this.state.type = type; - this.state.value = val; - - if (!this.isLookahead) { - this.state.endLoc = this.state.curPosition(); - this.updateContext(prevType); - } - } - - readToken_numberSign() { - if (this.state.pos === 0 && this.readToken_interpreter()) { - return; - } - - const nextPos = this.state.pos + 1; - const next = this.codePointAtPos(nextPos); - - if (next >= 48 && next <= 57) { - throw this.raise(this.state.pos, ErrorMessages.UnexpectedDigitAfterHash); - } - - if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { - this.expectPlugin("recordAndTuple"); - - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "hash") { - throw this.raise(this.state.pos, next === 123 ? ErrorMessages.RecordExpressionHashIncorrectStartSyntaxType : ErrorMessages.TupleExpressionHashIncorrectStartSyntaxType); - } - - this.state.pos += 2; - - if (next === 123) { - this.finishToken(15); - } else { - this.finishToken(9); - } - } else if (isIdentifierStart(next)) { - ++this.state.pos; - this.finishToken(6, this.readWord1(next)); - } else if (next === 92) { - ++this.state.pos; - this.finishToken(6, this.readWord1()); - } else { - this.finishOp(33, 1); - } - } - - readToken_dot() { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next >= 48 && next <= 57) { - this.readNumber(true); - return; - } - - if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { - this.state.pos += 3; - this.finishToken(29); - } else { - ++this.state.pos; - this.finishToken(24); - } - } - - readToken_slash() { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(37, 2); - } else { - this.finishOp(55, 1); - } - } - - readToken_interpreter() { - if (this.state.pos !== 0 || this.length < 2) return false; - let ch = this.input.charCodeAt(this.state.pos + 1); - if (ch !== 33) return false; - const start = this.state.pos; - this.state.pos += 1; - - while (!isNewLine(ch) && ++this.state.pos < this.length) { - ch = this.input.charCodeAt(this.state.pos); - } - - const value = this.input.slice(start + 2, this.state.pos); - this.finishToken(34, value); - return true; - } - - readToken_mult_modulo(code) { - let type = code === 42 ? 54 : 53; - let width = 1; - let next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 42 && next === 42) { - width++; - next = this.input.charCodeAt(this.state.pos + 2); - type = 56; - } - - if (next === 61 && !this.state.inType) { - width++; - type = code === 37 ? 38 : 36; - } - - this.finishOp(type, width); - } - - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === code) { - if (this.input.charCodeAt(this.state.pos + 2) === 61) { - this.finishOp(36, 3); - } else { - this.finishOp(code === 124 ? 44 : 45, 2); - } - - return; - } - - if (code === 124) { - if (next === 62) { - this.finishOp(42, 2); - return; - } - - if (this.hasPlugin("recordAndTuple") && next === 125) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectEndSyntaxType); - } - - this.state.pos += 2; - this.finishToken(17); - return; - } - - if (this.hasPlugin("recordAndTuple") && next === 93) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectEndSyntaxType); - } - - this.state.pos += 2; - this.finishToken(12); - return; - } - } - - if (next === 61) { - this.finishOp(36, 2); - return; - } - - this.finishOp(code === 124 ? 46 : 48, 1); - } - - readToken_caret() { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(36, 2); - } else { - this.finishOp(47, 1); - } - } - - readToken_plus_min(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === code) { - this.finishOp(39, 2); - return; - } - - if (next === 61) { - this.finishOp(36, 2); - } else { - this.finishOp(52, 1); - } - } - - readToken_lt_gt(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - let size = 1; - - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; - - if (this.input.charCodeAt(this.state.pos + size) === 61) { - this.finishOp(36, size + 1); - return; - } - - this.finishOp(51, size); - return; - } - - if (next === 61) { - size = 2; - } - - this.finishOp(50, size); - } - - readToken_eq_excl(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 61) { - this.finishOp(49, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); - return; - } - - if (code === 61 && next === 62) { - this.state.pos += 2; - this.finishToken(27); - return; - } - - this.finishOp(code === 61 ? 35 : 40, 1); - } - - readToken_question() { - const next = this.input.charCodeAt(this.state.pos + 1); - const next2 = this.input.charCodeAt(this.state.pos + 2); - - if (next === 63) { - if (next2 === 61) { - this.finishOp(36, 3); - } else { - this.finishOp(43, 2); - } - } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { - this.state.pos += 2; - this.finishToken(26); - } else { - ++this.state.pos; - this.finishToken(25); - } - } - - getTokenFromCode(code) { - switch (code) { - case 46: - this.readToken_dot(); - return; - - case 40: - ++this.state.pos; - this.finishToken(18); - return; - - case 41: - ++this.state.pos; - this.finishToken(19); - return; - - case 59: - ++this.state.pos; - this.finishToken(21); - return; - - case 44: - ++this.state.pos; - this.finishToken(20); - return; - - case 91: - if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(this.state.pos, ErrorMessages.TupleExpressionBarIncorrectStartSyntaxType); - } - - this.state.pos += 2; - this.finishToken(10); - } else { - ++this.state.pos; - this.finishToken(8); - } - - return; - - case 93: - ++this.state.pos; - this.finishToken(11); - return; - - case 123: - if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { - if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { - throw this.raise(this.state.pos, ErrorMessages.RecordExpressionBarIncorrectStartSyntaxType); - } - - this.state.pos += 2; - this.finishToken(14); - } else { - ++this.state.pos; - this.finishToken(13); - } - - return; - - case 125: - ++this.state.pos; - this.finishToken(16); - return; - - case 58: - if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { - this.finishOp(23, 2); - } else { - ++this.state.pos; - this.finishToken(22); - } - - return; - - case 63: - this.readToken_question(); - return; - - case 96: - ++this.state.pos; - this.finishToken(30); - return; - - case 48: - { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 120 || next === 88) { - this.readRadixNumber(16); - return; - } - - if (next === 111 || next === 79) { - this.readRadixNumber(8); - return; - } - - if (next === 98 || next === 66) { - this.readRadixNumber(2); - return; - } - } - - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - this.readNumber(false); - return; - - case 34: - case 39: - this.readString(code); - return; - - case 47: - this.readToken_slash(); - return; - - case 37: - case 42: - this.readToken_mult_modulo(code); - return; - - case 124: - case 38: - this.readToken_pipe_amp(code); - return; - - case 94: - this.readToken_caret(); - return; - - case 43: - case 45: - this.readToken_plus_min(code); - return; - - case 60: - case 62: - this.readToken_lt_gt(code); - return; - - case 61: - case 33: - this.readToken_eq_excl(code); - return; - - case 126: - this.finishOp(41, 1); - return; - - case 64: - ++this.state.pos; - this.finishToken(32); - return; - - case 35: - this.readToken_numberSign(); - return; - - case 92: - this.readWord(); - return; - - default: - if (isIdentifierStart(code)) { - this.readWord(code); - return; - } - - } - - throw this.raise(this.state.pos, ErrorMessages.InvalidOrUnexpectedToken, String.fromCodePoint(code)); - } - - finishOp(type, size) { - const str = this.input.slice(this.state.pos, this.state.pos + size); - this.state.pos += size; - this.finishToken(type, str); - } - - readRegexp() { - const start = this.state.start + 1; - let escaped, inClass; - let { - pos - } = this.state; - - for (;; ++pos) { - if (pos >= this.length) { - throw this.raise(start, ErrorMessages.UnterminatedRegExp); - } - - const ch = this.input.charCodeAt(pos); - - if (isNewLine(ch)) { - throw this.raise(start, ErrorMessages.UnterminatedRegExp); - } - - if (escaped) { - escaped = false; - } else { - if (ch === 91) { - inClass = true; - } else if (ch === 93 && inClass) { - inClass = false; - } else if (ch === 47 && !inClass) { - break; - } - - escaped = ch === 92; - } - } - - const content = this.input.slice(start, pos); - ++pos; - let mods = ""; - - while (pos < this.length) { - const cp = this.codePointAtPos(pos); - const char = String.fromCharCode(cp); - - if (VALID_REGEX_FLAGS.has(cp)) { - if (mods.includes(char)) { - this.raise(pos + 1, ErrorMessages.DuplicateRegExpFlags); - } - } else if (isIdentifierChar(cp) || cp === 92) { - this.raise(pos + 1, ErrorMessages.MalformedRegExpFlags); - } else { - break; - } - - ++pos; - mods += char; - } - - this.state.pos = pos; - this.finishToken(3, { - pattern: content, - flags: mods - }); - } - - readInt(radix, len, forceLen, allowNumSeparator = true) { - const start = this.state.pos; - const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; - const allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings.hex : radix === 10 ? allowedNumericSeparatorSiblings.dec : radix === 8 ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin; - let invalid = false; - let total = 0; - - for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { - const code = this.input.charCodeAt(this.state.pos); - let val; - - if (code === 95) { - const prev = this.input.charCodeAt(this.state.pos - 1); - const next = this.input.charCodeAt(this.state.pos + 1); - - if (allowedSiblings.indexOf(next) === -1) { - this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator); - } else if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) { - this.raise(this.state.pos, ErrorMessages.UnexpectedNumericSeparator); - } - - if (!allowNumSeparator) { - this.raise(this.state.pos, ErrorMessages.NumericSeparatorInEscapeSequence); - } - - ++this.state.pos; - continue; - } - - if (code >= 97) { - val = code - 97 + 10; - } else if (code >= 65) { - val = code - 65 + 10; - } else if (_isDigit(code)) { - val = code - 48; - } else { - val = Infinity; - } - - if (val >= radix) { - if (this.options.errorRecovery && val <= 9) { - val = 0; - this.raise(this.state.start + i + 2, ErrorMessages.InvalidDigit, radix); - } else if (forceLen) { - val = 0; - invalid = true; - } else { - break; - } - } - - ++this.state.pos; - total = total * radix + val; - } - - if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) { - return null; - } - - return total; - } - - readRadixNumber(radix) { - const start = this.state.pos; - let isBigInt = false; - this.state.pos += 2; - const val = this.readInt(radix); - - if (val == null) { - this.raise(this.state.start + 2, ErrorMessages.InvalidDigit, radix); - } - - const next = this.input.charCodeAt(this.state.pos); - - if (next === 110) { - ++this.state.pos; - isBigInt = true; - } else if (next === 109) { - throw this.raise(start, ErrorMessages.InvalidDecimal); - } - - if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { - throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier); - } - - if (isBigInt) { - const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); - this.finishToken(1, str); - return; - } - - this.finishToken(0, val); - } - - readNumber(startsWithDot) { - const start = this.state.pos; - let isFloat = false; - let isBigInt = false; - let isDecimal = false; - let hasExponent = false; - let isOctal = false; - - if (!startsWithDot && this.readInt(10) === null) { - this.raise(start, ErrorMessages.InvalidNumber); - } - - const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; - - if (hasLeadingZero) { - const integer = this.input.slice(start, this.state.pos); - this.recordStrictModeErrors(start, ErrorMessages.StrictOctalLiteral); - - if (!this.state.strict) { - const underscorePos = integer.indexOf("_"); - - if (underscorePos > 0) { - this.raise(underscorePos + start, ErrorMessages.ZeroDigitNumericSeparator); - } - } - - isOctal = hasLeadingZero && !/[89]/.test(integer); - } - - let next = this.input.charCodeAt(this.state.pos); - - if (next === 46 && !isOctal) { - ++this.state.pos; - this.readInt(10); - isFloat = true; - next = this.input.charCodeAt(this.state.pos); - } - - if ((next === 69 || next === 101) && !isOctal) { - next = this.input.charCodeAt(++this.state.pos); - - if (next === 43 || next === 45) { - ++this.state.pos; - } - - if (this.readInt(10) === null) { - this.raise(start, ErrorMessages.InvalidOrMissingExponent); - } - - isFloat = true; - hasExponent = true; - next = this.input.charCodeAt(this.state.pos); - } - - if (next === 110) { - if (isFloat || hasLeadingZero) { - this.raise(start, ErrorMessages.InvalidBigIntLiteral); - } - - ++this.state.pos; - isBigInt = true; - } - - if (next === 109) { - this.expectPlugin("decimal", this.state.pos); - - if (hasExponent || hasLeadingZero) { - this.raise(start, ErrorMessages.InvalidDecimal); - } - - ++this.state.pos; - isDecimal = true; - } - - if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { - throw this.raise(this.state.pos, ErrorMessages.NumberIdentifier); - } - - const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); - - if (isBigInt) { - this.finishToken(1, str); - return; - } - - if (isDecimal) { - this.finishToken(2, str); - return; - } - - const val = isOctal ? parseInt(str, 8) : parseFloat(str); - this.finishToken(0, val); - } - - readCodePoint(throwOnInvalid) { - const ch = this.input.charCodeAt(this.state.pos); - let code; - - if (ch === 123) { - const codePos = ++this.state.pos; - code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, true, throwOnInvalid); - ++this.state.pos; - - if (code !== null && code > 0x10ffff) { - if (throwOnInvalid) { - this.raise(codePos, ErrorMessages.InvalidCodePoint); - } else { - return null; - } - } - } else { - code = this.readHexChar(4, false, throwOnInvalid); - } - - return code; - } - - readString(quote) { - let out = "", - chunkStart = ++this.state.pos; - - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(this.state.start, ErrorMessages.UnterminatedString); - } - - const ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - - if (ch === 92) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.readEscapedChar(false); - chunkStart = this.state.pos; - } else if (ch === 8232 || ch === 8233) { - ++this.state.pos; - ++this.state.curLine; - this.state.lineStart = this.state.pos; - } else if (isNewLine(ch)) { - throw this.raise(this.state.start, ErrorMessages.UnterminatedString); - } else { - ++this.state.pos; - } - } - - out += this.input.slice(chunkStart, this.state.pos++); - this.finishToken(4, out); - } - - readTmplToken() { - let out = "", - chunkStart = this.state.pos, - containsInvalid = false; - - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(this.state.start, ErrorMessages.UnterminatedTemplate); - } - - const ch = this.input.charCodeAt(this.state.pos); - - if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) { - if (this.state.pos === this.state.start && this.match(28)) { - if (ch === 36) { - this.state.pos += 2; - this.finishToken(31); - return; - } else { - ++this.state.pos; - this.finishToken(30); - return; - } - } - - out += this.input.slice(chunkStart, this.state.pos); - this.finishToken(28, containsInvalid ? null : out); - return; - } - - if (ch === 92) { - out += this.input.slice(chunkStart, this.state.pos); - const escaped = this.readEscapedChar(true); - - if (escaped === null) { - containsInvalid = true; - } else { - out += escaped; - } - - chunkStart = this.state.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - ++this.state.pos; - - switch (ch) { - case 13: - if (this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - } - - case 10: - out += "\n"; - break; - - default: - out += String.fromCharCode(ch); - break; - } - - ++this.state.curLine; - this.state.lineStart = this.state.pos; - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - } - - recordStrictModeErrors(pos, message) { - if (this.state.strict && !this.state.strictErrors.has(pos)) { - this.raise(pos, message); - } else { - this.state.strictErrors.set(pos, message); - } - } - - readEscapedChar(inTemplate) { - const throwOnInvalid = !inTemplate; - const ch = this.input.charCodeAt(++this.state.pos); - ++this.state.pos; - - switch (ch) { - case 110: - return "\n"; - - case 114: - return "\r"; - - case 120: - { - const code = this.readHexChar(2, false, throwOnInvalid); - return code === null ? null : String.fromCharCode(code); - } - - case 117: - { - const code = this.readCodePoint(throwOnInvalid); - return code === null ? null : String.fromCodePoint(code); - } - - case 116: - return "\t"; - - case 98: - return "\b"; - - case 118: - return "\u000b"; - - case 102: - return "\f"; - - case 13: - if (this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - } - - case 10: - this.state.lineStart = this.state.pos; - ++this.state.curLine; - - case 8232: - case 8233: - return ""; - - case 56: - case 57: - if (inTemplate) { - return null; - } else { - this.recordStrictModeErrors(this.state.pos - 1, ErrorMessages.StrictNumericEscape); - } - - default: - if (ch >= 48 && ch <= 55) { - const codePos = this.state.pos - 1; - const match = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/); - let octalStr = match[0]; - let octal = parseInt(octalStr, 8); - - if (octal > 255) { - octalStr = octalStr.slice(0, -1); - octal = parseInt(octalStr, 8); - } - - this.state.pos += octalStr.length - 1; - const next = this.input.charCodeAt(this.state.pos); - - if (octalStr !== "0" || next === 56 || next === 57) { - if (inTemplate) { - return null; - } else { - this.recordStrictModeErrors(codePos, ErrorMessages.StrictNumericEscape); - } - } - - return String.fromCharCode(octal); - } - - return String.fromCharCode(ch); - } - } - - readHexChar(len, forceLen, throwOnInvalid) { - const codePos = this.state.pos; - const n = this.readInt(16, len, forceLen, false); - - if (n === null) { - if (throwOnInvalid) { - this.raise(codePos, ErrorMessages.InvalidEscapeSequence); - } else { - this.state.pos = codePos - 1; - } - } - - return n; - } - - readWord1(firstCode) { - this.state.containsEsc = false; - let word = ""; - const start = this.state.pos; - let chunkStart = this.state.pos; - - if (firstCode !== undefined) { - this.state.pos += firstCode <= 0xffff ? 1 : 2; - } - - while (this.state.pos < this.length) { - const ch = this.codePointAtPos(this.state.pos); - - if (isIdentifierChar(ch)) { - this.state.pos += ch <= 0xffff ? 1 : 2; - } else if (ch === 92) { - this.state.containsEsc = true; - word += this.input.slice(chunkStart, this.state.pos); - const escStart = this.state.pos; - const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; - - if (this.input.charCodeAt(++this.state.pos) !== 117) { - this.raise(this.state.pos, ErrorMessages.MissingUnicodeEscape); - chunkStart = this.state.pos - 1; - continue; - } - - ++this.state.pos; - const esc = this.readCodePoint(true); - - if (esc !== null) { - if (!identifierCheck(esc)) { - this.raise(escStart, ErrorMessages.EscapedCharNotAnIdentifier); - } - - word += String.fromCodePoint(esc); - } - - chunkStart = this.state.pos; - } else { - break; - } - } - - return word + this.input.slice(chunkStart, this.state.pos); - } - - readWord(firstCode) { - const word = this.readWord1(firstCode); - const type = keywords$1.get(word) || 5; - this.finishToken(type, word); - } - - checkKeywordEscapes() { - const { - type - } = this.state; - - if (tokenIsKeyword(type) && this.state.containsEsc) { - this.raise(this.state.start, ErrorMessages.InvalidEscapedReservedWord, tokenLabelName(type)); - } - } - - updateContext(prevType) { - const { - context, - type - } = this.state; - - switch (type) { - case 16: - context.pop(); - break; - - case 13: - case 15: - case 31: - context.push(types.brace); - break; - - case 30: - if (context[context.length - 1] === types.template) { - context.pop(); - } else { - context.push(types.template); - } - - break; - } - } - -} - -class ClassScope { - constructor() { - this.privateNames = new Set(); - this.loneAccessors = new Map(); - this.undefinedPrivateNames = new Map(); - } - -} -class ClassScopeHandler { - constructor(raise) { - this.stack = []; - this.undefinedPrivateNames = new Map(); - this.raise = raise; - } - - current() { - return this.stack[this.stack.length - 1]; - } - - enter() { - this.stack.push(new ClassScope()); - } - - exit() { - const oldClassScope = this.stack.pop(); - const current = this.current(); - - for (const [name, pos] of Array.from(oldClassScope.undefinedPrivateNames)) { - if (current) { - if (!current.undefinedPrivateNames.has(name)) { - current.undefinedPrivateNames.set(name, pos); - } - } else { - this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name); - } - } - } - - declarePrivateName(name, elementType, pos) { - const classScope = this.current(); - let redefined = classScope.privateNames.has(name); - - if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) { - const accessor = redefined && classScope.loneAccessors.get(name); - - if (accessor) { - const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC; - const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC; - const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR; - const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR; - redefined = oldKind === newKind || oldStatic !== newStatic; - if (!redefined) classScope.loneAccessors.delete(name); - } else if (!redefined) { - classScope.loneAccessors.set(name, elementType); - } - } - - if (redefined) { - this.raise(pos, ErrorMessages.PrivateNameRedeclaration, name); - } - - classScope.privateNames.add(name); - classScope.undefinedPrivateNames.delete(name); - } - - usePrivateName(name, pos) { - let classScope; - - for (classScope of this.stack) { - if (classScope.privateNames.has(name)) return; - } - - if (classScope) { - classScope.undefinedPrivateNames.set(name, pos); - } else { - this.raise(pos, ErrorMessages.InvalidPrivateFieldResolution, name); - } - } - -} - -const kExpression = 0, - kMaybeArrowParameterDeclaration = 1, - kMaybeAsyncArrowParameterDeclaration = 2, - kParameterDeclaration = 3; - -class ExpressionScope { - constructor(type = kExpression) { - this.type = void 0; - this.type = type; - } - - canBeArrowParameterDeclaration() { - return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration; - } - - isCertainlyParameterDeclaration() { - return this.type === kParameterDeclaration; - } - -} - -class ArrowHeadParsingScope extends ExpressionScope { - constructor(type) { - super(type); - this.errors = new Map(); - } - - recordDeclarationError(pos, template) { - this.errors.set(pos, template); - } - - clearDeclarationError(pos) { - this.errors.delete(pos); - } - - iterateErrors(iterator) { - this.errors.forEach(iterator); - } - -} - -class ExpressionScopeHandler { - constructor(raise) { - this.stack = [new ExpressionScope()]; - this.raise = raise; - } - - enter(scope) { - this.stack.push(scope); - } - - exit() { - this.stack.pop(); - } - - recordParameterInitializerError(pos, template) { - const { - stack - } = this; - let i = stack.length - 1; - let scope = stack[i]; - - while (!scope.isCertainlyParameterDeclaration()) { - if (scope.canBeArrowParameterDeclaration()) { - scope.recordDeclarationError(pos, template); - } else { - return; - } - - scope = stack[--i]; - } - - this.raise(pos, template); - } - - recordParenthesizedIdentifierError(pos, template) { - const { - stack - } = this; - const scope = stack[stack.length - 1]; - - if (scope.isCertainlyParameterDeclaration()) { - this.raise(pos, template); - } else if (scope.canBeArrowParameterDeclaration()) { - scope.recordDeclarationError(pos, template); - } else { - return; - } - } - - recordAsyncArrowParametersError(pos, template) { - const { - stack - } = this; - let i = stack.length - 1; - let scope = stack[i]; - - while (scope.canBeArrowParameterDeclaration()) { - if (scope.type === kMaybeAsyncArrowParameterDeclaration) { - scope.recordDeclarationError(pos, template); - } - - scope = stack[--i]; - } - } - - validateAsPattern() { - const { - stack - } = this; - const currentScope = stack[stack.length - 1]; - if (!currentScope.canBeArrowParameterDeclaration()) return; - currentScope.iterateErrors((template, pos) => { - this.raise(pos, template); - let i = stack.length - 2; - let scope = stack[i]; - - while (scope.canBeArrowParameterDeclaration()) { - scope.clearDeclarationError(pos); - scope = stack[--i]; - } - }); - } - -} -function newParameterDeclarationScope() { - return new ExpressionScope(kParameterDeclaration); -} -function newArrowHeadScope() { - return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration); -} -function newAsyncArrowScope() { - return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration); -} -function newExpressionScope() { - return new ExpressionScope(); -} - -const PARAM = 0b0000, - PARAM_YIELD = 0b0001, - PARAM_AWAIT = 0b0010, - PARAM_RETURN = 0b0100, - PARAM_IN = 0b1000; -class ProductionParameterHandler { - constructor() { - this.stacks = []; - } - - enter(flags) { - this.stacks.push(flags); - } - - exit() { - this.stacks.pop(); - } - - currentFlags() { - return this.stacks[this.stacks.length - 1]; - } - - get hasAwait() { - return (this.currentFlags() & PARAM_AWAIT) > 0; - } - - get hasYield() { - return (this.currentFlags() & PARAM_YIELD) > 0; - } - - get hasReturn() { - return (this.currentFlags() & PARAM_RETURN) > 0; - } - - get hasIn() { - return (this.currentFlags() & PARAM_IN) > 0; - } - -} -function functionFlags(isAsync, isGenerator) { - return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0); -} - -class UtilParser extends Tokenizer { - addExtra(node, key, val) { - if (!node) return; - const extra = node.extra = node.extra || {}; - extra[key] = val; - } - - isRelational(op) { - return this.match(50) && this.state.value === op; - } - - expectRelational(op) { - if (this.isRelational(op)) { - this.next(); - } else { - this.unexpected(null, 50); - } - } - - isContextual(name) { - return this.match(5) && this.state.value === name && !this.state.containsEsc; - } - - isUnparsedContextual(nameStart, name) { - const nameEnd = nameStart + name.length; - - if (this.input.slice(nameStart, nameEnd) === name) { - const nextCh = this.input.charCodeAt(nameEnd); - return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800); - } - - return false; - } - - isLookaheadContextual(name) { - const next = this.nextTokenStart(); - return this.isUnparsedContextual(next, name); - } - - eatContextual(name) { - return this.isContextual(name) && this.eat(5); - } - - expectContextual(name, template) { - if (!this.eatContextual(name)) this.unexpected(null, template); - } - - canInsertSemicolon() { - return this.match(7) || this.match(16) || this.hasPrecedingLineBreak(); - } - - hasPrecedingLineBreak() { - return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); - } - - hasFollowingLineBreak() { - skipWhiteSpaceToLineBreak.lastIndex = this.state.end; - return skipWhiteSpaceToLineBreak.test(this.input); - } - - isLineTerminator() { - return this.eat(21) || this.canInsertSemicolon(); - } - - semicolon(allowAsi = true) { - if (allowAsi ? this.isLineTerminator() : this.eat(21)) return; - this.raise(this.state.lastTokEnd, ErrorMessages.MissingSemicolon); - } - - expect(type, pos) { - this.eat(type) || this.unexpected(pos, type); - } - - assertNoSpace(message = "Unexpected space.") { - if (this.state.start > this.state.lastTokEnd) { - this.raise(this.state.lastTokEnd, { - code: ErrorCodes.SyntaxError, - reasonCode: "UnexpectedSpace", - template: message - }); - } - } - - unexpected(pos, messageOrType = { - code: ErrorCodes.SyntaxError, - reasonCode: "UnexpectedToken", - template: "Unexpected token" - }) { - if (isTokenType(messageOrType)) { - messageOrType = { - code: ErrorCodes.SyntaxError, - reasonCode: "UnexpectedToken", - template: `Unexpected token, expected "${tokenLabelName(messageOrType)}"` - }; - } - - throw this.raise(pos != null ? pos : this.state.start, messageOrType); - } - - expectPlugin(name, pos) { - if (!this.hasPlugin(name)) { - throw this.raiseWithData(pos != null ? pos : this.state.start, { - missingPlugin: [name] - }, `This experimental syntax requires enabling the parser plugin: '${name}'`); - } - - return true; - } - - expectOnePlugin(names, pos) { - if (!names.some(n => this.hasPlugin(n))) { - throw this.raiseWithData(pos != null ? pos : this.state.start, { - missingPlugin: names - }, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`); - } - } - - tryParse(fn, oldState = this.state.clone()) { - const abortSignal = { - node: null - }; - - try { - const node = fn((node = null) => { - abortSignal.node = node; - throw abortSignal; - }); - - if (this.state.errors.length > oldState.errors.length) { - const failState = this.state; - this.state = oldState; - this.state.tokensLength = failState.tokensLength; - return { - node, - error: failState.errors[oldState.errors.length], - thrown: false, - aborted: false, - failState - }; - } - - return { - node, - error: null, - thrown: false, - aborted: false, - failState: null - }; - } catch (error) { - const failState = this.state; - this.state = oldState; - - if (error instanceof SyntaxError) { - return { - node: null, - error, - thrown: true, - aborted: false, - failState - }; - } - - if (error === abortSignal) { - return { - node: abortSignal.node, - error: null, - thrown: false, - aborted: true, - failState - }; - } - - throw error; - } - } - - checkExpressionErrors(refExpressionErrors, andThrow) { - if (!refExpressionErrors) return false; - const { - shorthandAssign, - doubleProto, - optionalParameters - } = refExpressionErrors; - - if (!andThrow) { - return shorthandAssign >= 0 || doubleProto >= 0 || optionalParameters >= 0; - } - - if (shorthandAssign >= 0) { - this.unexpected(shorthandAssign); - } - - if (doubleProto >= 0) { - this.raise(doubleProto, ErrorMessages.DuplicateProto); - } - - if (optionalParameters >= 0) { - this.unexpected(optionalParameters); - } - } - - isLiteralPropertyName() { - return this.match(5) || tokenIsKeyword(this.state.type) || this.match(4) || this.match(0) || this.match(1) || this.match(2); - } - - isPrivateName(node) { - return node.type === "PrivateName"; - } - - getPrivateNameSV(node) { - return node.id.name; - } - - hasPropertyAsPrivateName(node) { - return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); - } - - isOptionalChain(node) { - return node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression"; - } - - isObjectProperty(node) { - return node.type === "ObjectProperty"; - } - - isObjectMethod(node) { - return node.type === "ObjectMethod"; - } - - initializeScopes(inModule = this.options.sourceType === "module") { - const oldLabels = this.state.labels; - this.state.labels = []; - const oldExportedIdentifiers = this.exportedIdentifiers; - this.exportedIdentifiers = new Set(); - const oldInModule = this.inModule; - this.inModule = inModule; - const oldScope = this.scope; - const ScopeHandler = this.getScopeHandler(); - this.scope = new ScopeHandler(this.raise.bind(this), this.inModule); - const oldProdParam = this.prodParam; - this.prodParam = new ProductionParameterHandler(); - const oldClassScope = this.classScope; - this.classScope = new ClassScopeHandler(this.raise.bind(this)); - const oldExpressionScope = this.expressionScope; - this.expressionScope = new ExpressionScopeHandler(this.raise.bind(this)); - return () => { - this.state.labels = oldLabels; - this.exportedIdentifiers = oldExportedIdentifiers; - this.inModule = oldInModule; - this.scope = oldScope; - this.prodParam = oldProdParam; - this.classScope = oldClassScope; - this.expressionScope = oldExpressionScope; - }; - } - - enterInitialScopes() { - let paramFlags = PARAM; - - if (this.inModule) { - paramFlags |= PARAM_AWAIT; - } - - this.scope.enter(SCOPE_PROGRAM); - this.prodParam.enter(paramFlags); - } - -} -class ExpressionErrors { - constructor() { - this.shorthandAssign = -1; - this.doubleProto = -1; - this.optionalParameters = -1; - } - -} - -class Node { - constructor(parser, pos, loc) { - this.type = ""; - this.start = pos; - this.end = 0; - this.loc = new SourceLocation(loc); - if (parser != null && parser.options.ranges) this.range = [pos, 0]; - if (parser != null && parser.filename) this.loc.filename = parser.filename; - } - -} - -const NodePrototype = Node.prototype; -{ - NodePrototype.__clone = function () { - const newNode = new Node(); - const keys = Object.keys(this); - - for (let i = 0, length = keys.length; i < length; i++) { - const key = keys[i]; - - if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { - newNode[key] = this[key]; - } - } - - return newNode; - }; -} - -function clonePlaceholder(node) { - return cloneIdentifier(node); -} - -function cloneIdentifier(node) { - const { - type, - start, - end, - loc, - range, - extra, - name - } = node; - const cloned = Object.create(NodePrototype); - cloned.type = type; - cloned.start = start; - cloned.end = end; - cloned.loc = loc; - cloned.range = range; - cloned.extra = extra; - cloned.name = name; - - if (type === "Placeholder") { - cloned.expectedNode = node.expectedNode; - } - - return cloned; -} -function cloneStringLiteral(node) { - const { - type, - start, - end, - loc, - range, - extra - } = node; - - if (type === "Placeholder") { - return clonePlaceholder(node); - } - - const cloned = Object.create(NodePrototype); - cloned.type = "StringLiteral"; - cloned.start = start; - cloned.end = end; - cloned.loc = loc; - cloned.range = range; - cloned.extra = extra; - cloned.value = node.value; - return cloned; -} -class NodeUtils extends UtilParser { - startNode() { - return new Node(this, this.state.start, this.state.startLoc); - } - - startNodeAt(pos, loc) { - return new Node(this, pos, loc); - } - - startNodeAtNode(type) { - return this.startNodeAt(type.start, type.loc.start); - } - - finishNode(node, type) { - return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); - } - - finishNodeAt(node, type, pos, loc) { - - node.type = type; - node.end = pos; - node.loc.end = loc; - if (this.options.ranges) node.range[1] = pos; - if (this.options.attachComment) this.processComment(node); - return node; - } - - resetStartLocation(node, start, startLoc) { - node.start = start; - node.loc.start = startLoc; - if (this.options.ranges) node.range[0] = start; - } - - resetEndLocation(node, end = this.state.lastTokEnd, endLoc = this.state.lastTokEndLoc) { - node.end = end; - node.loc.end = endLoc; - if (this.options.ranges) node.range[1] = end; - } - - resetStartLocationFromNode(node, locationNode) { - this.resetStartLocation(node, locationNode.start, locationNode.loc.start); - } - -} - -const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); -const FlowErrors = makeErrorTemplates({ - AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", - AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", - AssignReservedType: "Cannot overwrite reserved type %0.", - DeclareClassElement: "The `declare` modifier can only appear on class fields.", - DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", - DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", - EnumBooleanMemberNotInitialized: "Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.", - EnumDuplicateMemberName: "Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.", - EnumInconsistentMemberValues: "Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.", - EnumInvalidExplicitType: "Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.", - EnumInvalidExplicitTypeUnknownSupplied: "Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.", - EnumInvalidMemberInitializerPrimaryType: "Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.", - EnumInvalidMemberInitializerSymbolType: "Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.", - EnumInvalidMemberInitializerUnknownType: "The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.", - EnumInvalidMemberName: "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.", - EnumNumberMemberNotInitialized: "Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.", - EnumStringMemberInconsistentlyInitailized: "String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.", - GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", - ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", - InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", - InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", - InexactVariance: "Explicit inexact syntax cannot have variance.", - InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", - MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", - NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", - NestedFlowComment: "Cannot have a flow comment inside another flow comment.", - PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", - SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", - SpreadVariance: "Spread properties cannot have variance.", - ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", - ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", - ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", - ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", - ThisParamNoDefault: "The `this` parameter may not have a default value.", - TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", - TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", - UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", - UnexpectedReservedType: "Unexpected reserved type %0.", - UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", - UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", - UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", - UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', - UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", - UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.", - UnsupportedDeclareExportKind: "`declare export %0` is not supported. Use `%1` instead.", - UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", - UnterminatedFlowComment: "Unterminated flow-comment." -}, ErrorCodes.SyntaxError, "flow"); - -function isEsModuleType(bodyElement) { - return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); -} - -function hasTypeImportKind(node) { - return node.importKind === "type" || node.importKind === "typeof"; -} - -function isMaybeDefaultImport(state) { - return (state.type === 5 || tokenIsKeyword(state.type)) && state.value !== "from"; -} - -const exportSuggestions = { - const: "declare export var", - let: "declare export var", - type: "export type", - interface: "export interface" -}; - -function partition(list, test) { - const list1 = []; - const list2 = []; - - for (let i = 0; i < list.length; i++) { - (test(list[i], i, list) ? list1 : list2).push(list[i]); - } - - return [list1, list2]; -} - -const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; -var flow = (superClass => class extends superClass { - constructor(...args) { - super(...args); - this.flowPragma = undefined; - } - - getScopeHandler() { - return FlowScopeHandler; - } - - shouldParseTypes() { - return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; - } - - shouldParseEnums() { - return !!this.getPluginOption("flow", "enums"); - } - - finishToken(type, val) { - if (type !== 4 && type !== 21 && type !== 34) { - if (this.flowPragma === undefined) { - this.flowPragma = null; - } - } - - return super.finishToken(type, val); - } - - addComment(comment) { - if (this.flowPragma === undefined) { - const matches = FLOW_PRAGMA_REGEX.exec(comment.value); - - if (!matches) ; else if (matches[1] === "flow") { - this.flowPragma = "flow"; - } else if (matches[1] === "noflow") { - this.flowPragma = "noflow"; - } else { - throw new Error("Unexpected flow pragma"); - } - } - - return super.addComment(comment); - } - - flowParseTypeInitialiser(tok) { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(tok || 22); - const type = this.flowParseType(); - this.state.inType = oldInType; - return type; - } - - flowParsePredicate() { - const node = this.startNode(); - const moduloPos = this.state.start; - this.next(); - this.expectContextual("checks"); - - if (this.state.lastTokStart > moduloPos + 1) { - this.raise(moduloPos, FlowErrors.UnexpectedSpaceBetweenModuloChecks); - } - - if (this.eat(18)) { - node.value = this.parseExpression(); - this.expect(19); - return this.finishNode(node, "DeclaredPredicate"); - } else { - return this.finishNode(node, "InferredPredicate"); - } - } - - flowParseTypeAndPredicateInitialiser() { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(22); - let type = null; - let predicate = null; - - if (this.match(53)) { - this.state.inType = oldInType; - predicate = this.flowParsePredicate(); - } else { - type = this.flowParseType(); - this.state.inType = oldInType; - - if (this.match(53)) { - predicate = this.flowParsePredicate(); - } - } - - return [type, predicate]; - } - - flowParseDeclareClass(node) { - this.next(); - this.flowParseInterfaceish(node, true); - return this.finishNode(node, "DeclareClass"); - } - - flowParseDeclareFunction(node) { - this.next(); - const id = node.id = this.parseIdentifier(); - const typeNode = this.startNode(); - const typeContainer = this.startNode(); - - if (this.isRelational("<")) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } - - this.expect(18); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - typeNode.this = tmp._this; - this.expect(19); - [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); - this.resetEndLocation(id); - this.semicolon(); - this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.start); - return this.finishNode(node, "DeclareFunction"); - } - - flowParseDeclare(node, insideModule) { - if (this.match(79)) { - return this.flowParseDeclareClass(node); - } else if (this.match(67)) { - return this.flowParseDeclareFunction(node); - } else if (this.match(73)) { - return this.flowParseDeclareVariable(node); - } else if (this.eatContextual("module")) { - if (this.match(24)) { - return this.flowParseDeclareModuleExports(node); - } else { - if (insideModule) { - this.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule); - } - - return this.flowParseDeclareModule(node); - } - } else if (this.isContextual("type")) { - return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual("opaque")) { - return this.flowParseDeclareOpaqueType(node); - } else if (this.isContextual("interface")) { - return this.flowParseDeclareInterface(node); - } else if (this.match(81)) { - return this.flowParseDeclareExportDeclaration(node, insideModule); - } else { - throw this.unexpected(); - } - } - - flowParseDeclareVariable(node) { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(true); - this.scope.declareName(node.id.name, BIND_VAR, node.id.start); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); - } - - flowParseDeclareModule(node) { - this.scope.enter(SCOPE_OTHER); - - if (this.match(4)) { - node.id = this.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); - } - - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(13); - - while (!this.match(16)) { - let bodyNode = this.startNode(); - - if (this.match(82)) { - this.next(); - - if (!this.isContextual("type") && !this.match(86)) { - this.raise(this.state.lastTokStart, FlowErrors.InvalidNonTypeImportInDeclareModule); - } - - this.parseImport(bodyNode); - } else { - this.expectContextual("declare", FlowErrors.UnsupportedStatementInDeclareModule); - bodyNode = this.flowParseDeclare(bodyNode, true); - } - - body.push(bodyNode); - } - - this.scope.exit(); - this.expect(16); - this.finishNode(bodyNode, "BlockStatement"); - let kind = null; - let hasModuleExport = false; - body.forEach(bodyElement => { - if (isEsModuleType(bodyElement)) { - if (kind === "CommonJS") { - this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind); - } - - kind = "ES"; - } else if (bodyElement.type === "DeclareModuleExports") { - if (hasModuleExport) { - this.raise(bodyElement.start, FlowErrors.DuplicateDeclareModuleExports); - } - - if (kind === "ES") { - this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind); - } - - kind = "CommonJS"; - hasModuleExport = true; - } - }); - node.kind = kind || "CommonJS"; - return this.finishNode(node, "DeclareModule"); - } - - flowParseDeclareExportDeclaration(node, insideModule) { - this.expect(81); - - if (this.eat(64)) { - if (this.match(67) || this.match(79)) { - node.declaration = this.flowParseDeclare(this.startNode()); - } else { - node.declaration = this.flowParseType(); - this.semicolon(); - } - - node.default = true; - return this.finishNode(node, "DeclareExportDeclaration"); - } else { - if (this.match(74) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) { - const label = this.state.value; - const suggestion = exportSuggestions[label]; - throw this.raise(this.state.start, FlowErrors.UnsupportedDeclareExportKind, label, suggestion); - } - - if (this.match(73) || this.match(67) || this.match(79) || this.isContextual("opaque")) { - node.declaration = this.flowParseDeclare(this.startNode()); - node.default = false; - return this.finishNode(node, "DeclareExportDeclaration"); - } else if (this.match(54) || this.match(13) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) { - node = this.parseExport(node); - - if (node.type === "ExportNamedDeclaration") { - node.type = "ExportDeclaration"; - node.default = false; - delete node.exportKind; - } - - node.type = "Declare" + node.type; - return node; - } - } - - throw this.unexpected(); - } - - flowParseDeclareModuleExports(node) { - this.next(); - this.expectContextual("exports"); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); - return this.finishNode(node, "DeclareModuleExports"); - } - - flowParseDeclareTypeAlias(node) { - this.next(); - this.flowParseTypeAlias(node); - node.type = "DeclareTypeAlias"; - return node; - } - - flowParseDeclareOpaqueType(node) { - this.next(); - this.flowParseOpaqueType(node, true); - node.type = "DeclareOpaqueType"; - return node; - } - - flowParseDeclareInterface(node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); - } - - flowParseInterfaceish(node, isClass = false) { - node.id = this.flowParseRestrictedIdentifier(!isClass, true); - this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.extends = []; - node.implements = []; - node.mixins = []; - - if (this.eat(80)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (!isClass && this.eat(20)); - } - - if (this.isContextual("mixins")) { - this.next(); - - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(20)); - } - - if (this.isContextual("implements")) { - this.next(); - - do { - node.implements.push(this.flowParseInterfaceExtends()); - } while (this.eat(20)); - } - - node.body = this.flowParseObjectType({ - allowStatic: isClass, - allowExact: false, - allowSpread: false, - allowProto: isClass, - allowInexact: false - }); - } - - flowParseInterfaceExtends() { - const node = this.startNode(); - node.id = this.flowParseQualifiedTypeIdentifier(); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - - return this.finishNode(node, "InterfaceExtends"); - } - - flowParseInterface(node) { - this.flowParseInterfaceish(node); - return this.finishNode(node, "InterfaceDeclaration"); - } - - checkNotUnderscore(word) { - if (word === "_") { - this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore); - } - } - - checkReservedType(word, startLoc, declaration) { - if (!reservedTypes.has(word)) return; - this.raise(startLoc, declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, word); - } - - flowParseRestrictedIdentifier(liberal, declaration) { - this.checkReservedType(this.state.value, this.state.start, declaration); - return this.parseIdentifier(liberal); - } - - flowParseTypeAlias(node) { - node.id = this.flowParseRestrictedIdentifier(false, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.right = this.flowParseTypeInitialiser(35); - this.semicolon(); - return this.finishNode(node, "TypeAlias"); - } - - flowParseOpaqueType(node, declare) { - this.expectContextual("type"); - node.id = this.flowParseRestrictedIdentifier(true, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.supertype = null; - - if (this.match(22)) { - node.supertype = this.flowParseTypeInitialiser(22); - } - - node.impltype = null; - - if (!declare) { - node.impltype = this.flowParseTypeInitialiser(35); - } - - this.semicolon(); - return this.finishNode(node, "OpaqueType"); - } - - flowParseTypeParameter(requireDefault = false) { - const nodeStart = this.state.start; - const node = this.startNode(); - const variance = this.flowParseVariance(); - const ident = this.flowParseTypeAnnotatableIdentifier(); - node.name = ident.name; - node.variance = variance; - node.bound = ident.typeAnnotation; - - if (this.match(35)) { - this.eat(35); - node.default = this.flowParseType(); - } else { - if (requireDefault) { - this.raise(nodeStart, FlowErrors.MissingTypeParamDefault); - } - } - - return this.finishNode(node, "TypeParameter"); - } - - flowParseTypeParameterDeclaration() { - const oldInType = this.state.inType; - const node = this.startNode(); - node.params = []; - this.state.inType = true; - - if (this.isRelational("<") || this.match(94)) { - this.next(); - } else { - this.unexpected(); - } - - let defaultRequired = false; - - do { - const typeParameter = this.flowParseTypeParameter(defaultRequired); - node.params.push(typeParameter); - - if (typeParameter.default) { - defaultRequired = true; - } - - if (!this.isRelational(">")) { - this.expect(20); - } - } while (!this.isRelational(">")); - - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterDeclaration"); - } - - flowParseTypeParameterInstantiation() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expectRelational("<"); - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = false; - - while (!this.isRelational(">")) { - node.params.push(this.flowParseType()); - - if (!this.isRelational(">")) { - this.expect(20); - } - } - - this.state.noAnonFunctionType = oldNoAnonFunctionType; - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - - flowParseTypeParameterInstantiationCallOrNew() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expectRelational("<"); - - while (!this.isRelational(">")) { - node.params.push(this.flowParseTypeOrImplicitInstantiation()); - - if (!this.isRelational(">")) { - this.expect(20); - } - } - - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - - flowParseInterfaceType() { - const node = this.startNode(); - this.expectContextual("interface"); - node.extends = []; - - if (this.eat(80)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (this.eat(20)); - } - - node.body = this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: false, - allowProto: false, - allowInexact: false - }); - return this.finishNode(node, "InterfaceTypeAnnotation"); - } - - flowParseObjectPropertyKey() { - return this.match(0) || this.match(4) ? this.parseExprAtom() : this.parseIdentifier(true); - } - - flowParseObjectTypeIndexer(node, isStatic, variance) { - node.static = isStatic; - - if (this.lookahead().type === 22) { - node.id = this.flowParseObjectPropertyKey(); - node.key = this.flowParseTypeInitialiser(); - } else { - node.id = null; - node.key = this.flowParseType(); - } - - this.expect(11); - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - return this.finishNode(node, "ObjectTypeIndexer"); - } - - flowParseObjectTypeInternalSlot(node, isStatic) { - node.static = isStatic; - node.id = this.flowParseObjectPropertyKey(); - this.expect(11); - this.expect(11); - - if (this.isRelational("<") || this.match(18)) { - node.method = true; - node.optional = false; - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - } else { - node.method = false; - - if (this.eat(25)) { - node.optional = true; - } - - node.value = this.flowParseTypeInitialiser(); - } - - return this.finishNode(node, "ObjectTypeInternalSlot"); - } - - flowParseObjectTypeMethodish(node) { - node.params = []; - node.rest = null; - node.typeParameters = null; - node.this = null; - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - this.expect(18); - - if (this.match(77)) { - node.this = this.flowParseFunctionTypeParam(true); - node.this.name = null; - - if (!this.match(19)) { - this.expect(20); - } - } - - while (!this.match(19) && !this.match(29)) { - node.params.push(this.flowParseFunctionTypeParam(false)); - - if (!this.match(19)) { - this.expect(20); - } - } - - if (this.eat(29)) { - node.rest = this.flowParseFunctionTypeParam(false); - } - - this.expect(19); - node.returnType = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - flowParseObjectTypeCallProperty(node, isStatic) { - const valueNode = this.startNode(); - node.static = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - return this.finishNode(node, "ObjectTypeCallProperty"); - } - - flowParseObjectType({ - allowStatic, - allowExact, - allowSpread, - allowProto, - allowInexact - }) { - const oldInType = this.state.inType; - this.state.inType = true; - const nodeStart = this.startNode(); - nodeStart.callProperties = []; - nodeStart.properties = []; - nodeStart.indexers = []; - nodeStart.internalSlots = []; - let endDelim; - let exact; - let inexact = false; - - if (allowExact && this.match(14)) { - this.expect(14); - endDelim = 17; - exact = true; - } else { - this.expect(13); - endDelim = 16; - exact = false; - } - - nodeStart.exact = exact; - - while (!this.match(endDelim)) { - let isStatic = false; - let protoStart = null; - let inexactStart = null; - const node = this.startNode(); - - if (allowProto && this.isContextual("proto")) { - const lookahead = this.lookahead(); - - if (lookahead.type !== 22 && lookahead.type !== 25) { - this.next(); - protoStart = this.state.start; - allowStatic = false; - } - } - - if (allowStatic && this.isContextual("static")) { - const lookahead = this.lookahead(); - - if (lookahead.type !== 22 && lookahead.type !== 25) { - this.next(); - isStatic = true; - } - } - - const variance = this.flowParseVariance(); - - if (this.eat(8)) { - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (this.eat(8)) { - if (variance) { - this.unexpected(variance.start); - } - - nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); - } else { - nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); - } - } else if (this.match(18) || this.isRelational("<")) { - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.unexpected(variance.start); - } - - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); - } else { - let kind = "init"; - - if (this.isContextual("get") || this.isContextual("set")) { - const lookahead = this.lookahead(); - - if (lookahead.type === 5 || lookahead.type === 4 || lookahead.type === 0) { - kind = this.state.value; - this.next(); - } - } - - const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); - - if (propOrInexact === null) { - inexact = true; - inexactStart = this.state.lastTokStart; - } else { - nodeStart.properties.push(propOrInexact); - } - } - - this.flowObjectTypeSemicolon(); - - if (inexactStart && !this.match(16) && !this.match(17)) { - this.raise(inexactStart, FlowErrors.UnexpectedExplicitInexactInObject); - } - } - - this.expect(endDelim); - - if (allowSpread) { - nodeStart.inexact = inexact; - } - - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); - this.state.inType = oldInType; - return out; - } - - flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) { - if (this.eat(29)) { - const isInexactToken = this.match(20) || this.match(21) || this.match(16) || this.match(17); - - if (isInexactToken) { - if (!allowSpread) { - this.raise(this.state.lastTokStart, FlowErrors.InexactInsideNonObject); - } else if (!allowInexact) { - this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact); - } - - if (variance) { - this.raise(variance.start, FlowErrors.InexactVariance); - } - - return null; - } - - if (!allowSpread) { - this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType); - } - - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.raise(variance.start, FlowErrors.SpreadVariance); - } - - node.argument = this.flowParseType(); - return this.finishNode(node, "ObjectTypeSpreadProperty"); - } else { - node.key = this.flowParseObjectPropertyKey(); - node.static = isStatic; - node.proto = protoStart != null; - node.kind = kind; - let optional = false; - - if (this.isRelational("<") || this.match(18)) { - node.method = true; - - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.unexpected(variance.start); - } - - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - - if (kind === "get" || kind === "set") { - this.flowCheckGetterSetterParams(node); - } - - if (!allowSpread && node.key.name === "constructor" && node.value.this) { - this.raise(node.value.this.start, FlowErrors.ThisParamBannedInConstructor); - } - } else { - if (kind !== "init") this.unexpected(); - node.method = false; - - if (this.eat(25)) { - optional = true; - } - - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - } - - node.optional = optional; - return this.finishNode(node, "ObjectTypeProperty"); - } - } - - flowCheckGetterSetterParams(property) { - const paramCount = property.kind === "get" ? 0 : 1; - const start = property.start; - const length = property.value.params.length + (property.value.rest ? 1 : 0); - - if (property.value.this) { - this.raise(property.value.this.start, property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam); - } - - if (length !== paramCount) { - if (property.kind === "get") { - this.raise(start, ErrorMessages.BadGetterArity); - } else { - this.raise(start, ErrorMessages.BadSetterArity); - } - } - - if (property.kind === "set" && property.value.rest) { - this.raise(start, ErrorMessages.BadSetterRestParameter); - } - } - - flowObjectTypeSemicolon() { - if (!this.eat(21) && !this.eat(20) && !this.match(16) && !this.match(17)) { - this.unexpected(); - } - } - - flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - let node = id || this.flowParseRestrictedIdentifier(true); - - while (this.eat(24)) { - const node2 = this.startNodeAt(startPos, startLoc); - node2.qualification = node; - node2.id = this.flowParseRestrictedIdentifier(true); - node = this.finishNode(node2, "QualifiedTypeIdentifier"); - } - - return node; - } - - flowParseGenericType(startPos, startLoc, id) { - const node = this.startNodeAt(startPos, startLoc); - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } - - return this.finishNode(node, "GenericTypeAnnotation"); - } - - flowParseTypeofType() { - const node = this.startNode(); - this.expect(86); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); - } - - flowParseTupleType() { - const node = this.startNode(); - node.types = []; - this.expect(8); - - while (this.state.pos < this.length && !this.match(11)) { - node.types.push(this.flowParseType()); - if (this.match(11)) break; - this.expect(20); - } - - this.expect(11); - return this.finishNode(node, "TupleTypeAnnotation"); - } - - flowParseFunctionTypeParam(first) { - let name = null; - let optional = false; - let typeAnnotation = null; - const node = this.startNode(); - const lh = this.lookahead(); - const isThis = this.state.type === 77; - - if (lh.type === 22 || lh.type === 25) { - if (isThis && !first) { - this.raise(node.start, FlowErrors.ThisParamMustBeFirst); - } - - name = this.parseIdentifier(isThis); - - if (this.eat(25)) { - optional = true; - - if (isThis) { - this.raise(node.start, FlowErrors.ThisParamMayNotBeOptional); - } - } - - typeAnnotation = this.flowParseTypeInitialiser(); - } else { - typeAnnotation = this.flowParseType(); - } - - node.name = name; - node.optional = optional; - node.typeAnnotation = typeAnnotation; - return this.finishNode(node, "FunctionTypeParam"); - } - - reinterpretTypeAsFunctionTypeParam(type) { - const node = this.startNodeAt(type.start, type.loc.start); - node.name = null; - node.optional = false; - node.typeAnnotation = type; - return this.finishNode(node, "FunctionTypeParam"); - } - - flowParseFunctionTypeParams(params = []) { - let rest = null; - let _this = null; - - if (this.match(77)) { - _this = this.flowParseFunctionTypeParam(true); - _this.name = null; - - if (!this.match(19)) { - this.expect(20); - } - } - - while (!this.match(19) && !this.match(29)) { - params.push(this.flowParseFunctionTypeParam(false)); - - if (!this.match(19)) { - this.expect(20); - } - } - - if (this.eat(29)) { - rest = this.flowParseFunctionTypeParam(false); - } - - return { - params, - rest, - _this - }; - } - - flowIdentToTypeAnnotation(startPos, startLoc, node, id) { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); - - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); - - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); - - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); - - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); - - case "string": - return this.finishNode(node, "StringTypeAnnotation"); - - case "symbol": - return this.finishNode(node, "SymbolTypeAnnotation"); - - default: - this.checkNotUnderscore(id.name); - return this.flowParseGenericType(startPos, startLoc, id); - } - } - - flowParsePrimaryType() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const node = this.startNode(); - let tmp; - let type; - let isGroupedType = false; - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - - switch (this.state.type) { - case 5: - if (this.isContextual("interface")) { - return this.flowParseInterfaceType(); - } - - return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); - - case 13: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: true, - allowProto: false, - allowInexact: true - }); - - case 14: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: true, - allowSpread: true, - allowProto: false, - allowInexact: false - }); - - case 8: - this.state.noAnonFunctionType = false; - type = this.flowParseTupleType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - return type; - - case 50: - if (this.state.value === "<") { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - this.expect(18); - tmp = this.flowParseFunctionTypeParams(); - node.params = tmp.params; - node.rest = tmp.rest; - node.this = tmp._this; - this.expect(19); - this.expect(27); - node.returnType = this.flowParseType(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - break; - - case 18: - this.next(); - - if (!this.match(19) && !this.match(29)) { - if (this.match(5) || this.match(77)) { - const token = this.lookahead().type; - isGroupedType = token !== 25 && token !== 22; - } else { - isGroupedType = true; - } - } - - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - - if (this.state.noAnonFunctionType || !(this.match(20) || this.match(19) && this.lookahead().type === 27)) { - this.expect(19); - return type; - } else { - this.eat(20); - } - } - - if (type) { - tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); - } else { - tmp = this.flowParseFunctionTypeParams(); - } - - node.params = tmp.params; - node.rest = tmp.rest; - node.this = tmp._this; - this.expect(19); - this.expect(27); - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - - case 4: - return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); - - case 84: - case 85: - node.value = this.match(84); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - - case 52: - if (this.state.value === "-") { - this.next(); - - if (this.match(0)) { - return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); - } - - if (this.match(1)) { - return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); - } - - throw this.raise(this.state.start, FlowErrors.UnexpectedSubtractionOperand); - } - - throw this.unexpected(); - - case 0: - return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - - case 1: - return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); - - case 87: - this.next(); - return this.finishNode(node, "VoidTypeAnnotation"); - - case 83: - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); - - case 77: - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); - - case 54: - this.next(); - return this.finishNode(node, "ExistsTypeAnnotation"); - - case 86: - return this.flowParseTypeofType(); - - default: - if (tokenIsKeyword(this.state.type)) { - const label = tokenLabelName(this.state.type); - this.next(); - return super.createIdentifier(node, label); - } - - } - - throw this.unexpected(); - } - - flowParsePostfixType() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let type = this.flowParsePrimaryType(); - let seenOptionalIndexedAccess = false; - - while ((this.match(8) || this.match(26)) && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startPos, startLoc); - const optional = this.eat(26); - seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; - this.expect(8); - - if (!optional && this.match(11)) { - node.elementType = type; - this.next(); - type = this.finishNode(node, "ArrayTypeAnnotation"); - } else { - node.objectType = type; - node.indexType = this.flowParseType(); - this.expect(11); - - if (seenOptionalIndexedAccess) { - node.optional = optional; - type = this.finishNode(node, "OptionalIndexedAccessType"); - } else { - type = this.finishNode(node, "IndexedAccessType"); - } - } - } - - return type; - } - - flowParsePrefixType() { - const node = this.startNode(); - - if (this.eat(25)) { - node.typeAnnotation = this.flowParsePrefixType(); - return this.finishNode(node, "NullableTypeAnnotation"); - } else { - return this.flowParsePostfixType(); - } - } - - flowParseAnonFunctionWithoutParens() { - const param = this.flowParsePrefixType(); - - if (!this.state.noAnonFunctionType && this.eat(27)) { - const node = this.startNodeAt(param.start, param.loc.start); - node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; - node.rest = null; - node.this = null; - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - return param; - } - - flowParseIntersectionType() { - const node = this.startNode(); - this.eat(48); - const type = this.flowParseAnonFunctionWithoutParens(); - node.types = [type]; - - while (this.eat(48)) { - node.types.push(this.flowParseAnonFunctionWithoutParens()); - } - - return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); - } - - flowParseUnionType() { - const node = this.startNode(); - this.eat(46); - const type = this.flowParseIntersectionType(); - node.types = [type]; - - while (this.eat(46)) { - node.types.push(this.flowParseIntersectionType()); - } - - return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); - } - - flowParseType() { - const oldInType = this.state.inType; - this.state.inType = true; - const type = this.flowParseUnionType(); - this.state.inType = oldInType; - return type; - } - - flowParseTypeOrImplicitInstantiation() { - if (this.state.type === 5 && this.state.value === "_") { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const node = this.parseIdentifier(); - return this.flowParseGenericType(startPos, startLoc, node); - } else { - return this.flowParseType(); - } - } - - flowParseTypeAnnotation() { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); - } - - flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { - const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); - - if (this.match(22)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(ident); - } - - return ident; - } - - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); - return node.expression; - } - - flowParseVariance() { - let variance = null; - - if (this.match(52)) { - variance = this.startNode(); - - if (this.state.value === "+") { - variance.kind = "plus"; - } else { - variance.kind = "minus"; - } - - this.next(); - this.finishNode(variance, "Variance"); - } - - return variance; - } - - parseFunctionBody(node, allowExpressionBody, isMethod = false) { - if (allowExpressionBody) { - return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); - } - - return super.parseFunctionBody(node, false, isMethod); - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(22)) { - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; - } - - super.parseFunctionBodyAndFinish(node, type, isMethod); - } - - parseStatement(context, topLevel) { - if (this.state.strict && this.match(5) && this.state.value === "interface") { - const lookahead = this.lookahead(); - - if (lookahead.type === 5 || isKeyword(lookahead.value)) { - const node = this.startNode(); - this.next(); - return this.flowParseInterface(node); - } - } else if (this.shouldParseEnums() && this.isContextual("enum")) { - const node = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(node); - } - - const stmt = super.parseStatement(context, topLevel); - - if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { - this.flowPragma = null; - } - - return stmt; - } - - parseExpressionStatement(node, expr) { - if (expr.type === "Identifier") { - if (expr.name === "declare") { - if (this.match(79) || this.match(5) || this.match(67) || this.match(73) || this.match(81)) { - return this.flowParseDeclare(node); - } - } else if (this.match(5)) { - if (expr.name === "interface") { - return this.flowParseInterface(node); - } else if (expr.name === "type") { - return this.flowParseTypeAlias(node); - } else if (expr.name === "opaque") { - return this.flowParseOpaqueType(node, false); - } - } - } - - return super.parseExpressionStatement(node, expr); - } - - shouldParseExportDeclaration() { - return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration(); - } - - isExportDefaultSpecifier() { - if (this.match(5) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) { - return false; - } - - return super.isExportDefaultSpecifier(); - } - - parseExportDefaultExpression() { - if (this.shouldParseEnums() && this.isContextual("enum")) { - const node = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(node); - } - - return super.parseExportDefaultExpression(); - } - - parseConditional(expr, startPos, startLoc, refExpressionErrors) { - if (!this.match(25)) return expr; - - if (this.state.maybeInArrowParameters) { - const nextCh = this.lookaheadCharCode(); - - if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { - this.setOptionalParametersError(refExpressionErrors); - return expr; - } - } - - this.expect(25); - const state = this.state.clone(); - const originalNoArrowAt = this.state.noArrowAt; - const node = this.startNodeAt(startPos, startLoc); - let { - consequent, - failed - } = this.tryParseConditionalConsequent(); - let [valid, invalid] = this.getArrowLikeExpressions(consequent); - - if (failed || invalid.length > 0) { - const noArrowAt = [...originalNoArrowAt]; - - if (invalid.length > 0) { - this.state = state; - this.state.noArrowAt = noArrowAt; - - for (let i = 0; i < invalid.length; i++) { - noArrowAt.push(invalid[i].start); - } - - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - [valid, invalid] = this.getArrowLikeExpressions(consequent); - } - - if (failed && valid.length > 1) { - this.raise(state.start, FlowErrors.AmbiguousConditionalArrow); - } - - if (failed && valid.length === 1) { - this.state = state; - noArrowAt.push(valid[0].start); - this.state.noArrowAt = noArrowAt; - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - } - } - - this.getArrowLikeExpressions(consequent, true); - this.state.noArrowAt = originalNoArrowAt; - this.expect(22); - node.test = expr; - node.consequent = consequent; - node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); - return this.finishNode(node, "ConditionalExpression"); - } - - tryParseConditionalConsequent() { - this.state.noArrowParamsConversionAt.push(this.state.start); - const consequent = this.parseMaybeAssignAllowIn(); - const failed = !this.match(22); - this.state.noArrowParamsConversionAt.pop(); - return { - consequent, - failed - }; - } - - getArrowLikeExpressions(node, disallowInvalid) { - const stack = [node]; - const arrows = []; - - while (stack.length !== 0) { - const node = stack.pop(); - - if (node.type === "ArrowFunctionExpression") { - if (node.typeParameters || !node.returnType) { - this.finishArrowValidation(node); - } else { - arrows.push(node); - } - - stack.push(node.body); - } else if (node.type === "ConditionalExpression") { - stack.push(node.consequent); - stack.push(node.alternate); - } - } - - if (disallowInvalid) { - arrows.forEach(node => this.finishArrowValidation(node)); - return [arrows, []]; - } - - return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); - } - - finishArrowValidation(node) { - var _node$extra; - - this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma, false); - this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); - super.checkParams(node, false, true); - this.scope.exit(); - } - - forwardNoArrowParamsConversionAt(node, parse) { - let result; - - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - this.state.noArrowParamsConversionAt.push(this.state.start); - result = parse(); - this.state.noArrowParamsConversionAt.pop(); - } else { - result = parse(); - } - - return result; - } - - parseParenItem(node, startPos, startLoc) { - node = super.parseParenItem(node, startPos, startLoc); - - if (this.eat(25)) { - node.optional = true; - this.resetEndLocation(node); - } - - if (this.match(22)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TypeCastExpression"); - } - - return node; - } - - assertModuleNodeAllowed(node) { - if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { - return; - } - - super.assertModuleNodeAllowed(node); - } - - parseExport(node) { - const decl = super.parseExport(node); - - if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { - decl.exportKind = decl.exportKind || "value"; - } - - return decl; - } - - parseExportDeclaration(node) { - if (this.isContextual("type")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - - if (this.match(13)) { - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - return null; - } else { - return this.flowParseTypeAlias(declarationNode); - } - } else if (this.isContextual("opaque")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseOpaqueType(declarationNode, false); - } else if (this.isContextual("interface")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseInterface(declarationNode); - } else if (this.shouldParseEnums() && this.isContextual("enum")) { - node.exportKind = "value"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(declarationNode); - } else { - return super.parseExportDeclaration(node); - } - } - - eatExportStar(node) { - if (super.eatExportStar(...arguments)) return true; - - if (this.isContextual("type") && this.lookahead().type === 54) { - node.exportKind = "type"; - this.next(); - this.next(); - return true; - } - - return false; - } - - maybeParseExportNamespaceSpecifier(node) { - const pos = this.state.start; - const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); - - if (hasNamespace && node.exportKind === "type") { - this.unexpected(pos); - } - - return hasNamespace; - } - - parseClassId(node, isStatement, optionalId) { - super.parseClassId(node, isStatement, optionalId); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - } - - parseClassMember(classBody, member, state) { - const pos = this.state.start; - - if (this.isContextual("declare")) { - if (this.parseClassMemberFromModifier(classBody, member)) { - return; - } - - member.declare = true; - } - - super.parseClassMember(classBody, member, state); - - if (member.declare) { - if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { - this.raise(pos, FlowErrors.DeclareClassElement); - } else if (member.value) { - this.raise(member.value.start, FlowErrors.DeclareClassFieldInitializer); - } - } - } - - isIterator(word) { - return word === "iterator" || word === "asyncIterator"; - } - - readIterator() { - const word = super.readWord1(); - const fullWord = "@@" + word; - - if (!this.isIterator(word) || !this.state.inType) { - this.raise(this.state.pos, ErrorMessages.InvalidIdentifier, fullWord); - } - - this.finishToken(5, fullWord); - } - - getTokenFromCode(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 123 && next === 124) { - return this.finishOp(14, 2); - } else if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(50, 1); - } else if (this.state.inType && code === 63) { - if (next === 46) { - return this.finishOp(26, 2); - } - - return this.finishOp(25, 1); - } else if (isIteratorStart(code, next)) { - this.state.pos += 2; - return this.readIterator(); - } else { - return super.getTokenFromCode(code); - } - } - - isAssignable(node, isBinding) { - if (node.type === "TypeCastExpression") { - return this.isAssignable(node.expression, isBinding); - } else { - return super.isAssignable(node, isBinding); - } - } - - toAssignable(node, isLHS = false) { - if (node.type === "TypeCastExpression") { - return super.toAssignable(this.typeCastToParameter(node), isLHS); - } else { - return super.toAssignable(node, isLHS); - } - } - - toAssignableList(exprList, trailingCommaPos, isLHS) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - - if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } - } - - return super.toAssignableList(exprList, trailingCommaPos, isLHS); - } - - toReferencedList(exprList, isParenthesizedExpr) { - for (let i = 0; i < exprList.length; i++) { - var _expr$extra; - - const expr = exprList[i]; - - if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { - this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern); - } - } - - return exprList; - } - - parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { - const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); - - if (canBePattern && !this.state.maybeInArrowParameters) { - this.toReferencedList(node.elements); - } - - return node; - } - - checkLVal(expr, ...args) { - if (expr.type !== "TypeCastExpression") { - return super.checkLVal(expr, ...args); - } - } - - parseClassProperty(node) { - if (this.match(22)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - - return super.parseClassProperty(node); - } - - parseClassPrivateProperty(node) { - if (this.match(22)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - - return super.parseClassPrivateProperty(node); - } - - isClassMethod() { - return this.isRelational("<") || super.isClassMethod(); - } - - isClassProperty() { - return this.match(22) || super.isClassProperty(); - } - - isNonstaticConstructor(method) { - return !this.match(22) && super.isNonstaticConstructor(method); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - if (method.variance) { - this.unexpected(method.variance.start); - } - - delete method.variance; - - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - - if (method.params && isConstructor) { - const params = method.params; - - if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(method.start, FlowErrors.ThisParamBannedInConstructor); - } - } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { - const params = method.value.params; - - if (params.length > 0 && this.isThisParam(params[0])) { - this.raise(method.start, FlowErrors.ThisParamBannedInConstructor); - } - } - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - if (method.variance) { - this.unexpected(method.variance.start); - } - - delete method.variance; - - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - - parseClassSuper(node) { - super.parseClassSuper(node); - - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.flowParseTypeParameterInstantiation(); - } - - if (this.isContextual("implements")) { - this.next(); - const implemented = node.implements = []; - - do { - const node = this.startNode(); - node.id = this.flowParseRestrictedIdentifier(true); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - - implemented.push(this.finishNode(node, "ClassImplements")); - } while (this.eat(20)); - } - } - - checkGetterSetterParams(method) { - super.checkGetterSetterParams(method); - const params = this.getObjectOrClassMethodParams(method); - - if (params.length > 0) { - const param = params[0]; - - if (this.isThisParam(param) && method.kind === "get") { - this.raise(param.start, FlowErrors.GetterMayNotHaveThisParam); - } else if (this.isThisParam(param)) { - this.raise(param.start, FlowErrors.SetterMayNotHaveThisParam); - } - } - } - - parsePropertyName(node, isPrivateNameAllowed) { - const variance = this.flowParseVariance(); - const key = super.parsePropertyName(node, isPrivateNameAllowed); - node.variance = variance; - return key; - } - - parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { - if (prop.variance) { - this.unexpected(prop.variance.start); - } - - delete prop.variance; - let typeParameters; - - if (this.isRelational("<") && !isAccessor) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(18)) this.unexpected(); - } - - super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); - - if (typeParameters) { - (prop.value || prop).typeParameters = typeParameters; - } - } - - parseAssignableListItemTypes(param) { - if (this.eat(25)) { - if (param.type !== "Identifier") { - this.raise(param.start, FlowErrors.PatternIsOptional); - } - - if (this.isThisParam(param)) { - this.raise(param.start, FlowErrors.ThisParamMayNotBeOptional); - } - - param.optional = true; - } - - if (this.match(22)) { - param.typeAnnotation = this.flowParseTypeAnnotation(); - } else if (this.isThisParam(param)) { - this.raise(param.start, FlowErrors.ThisParamAnnotationRequired); - } - - if (this.match(35) && this.isThisParam(param)) { - this.raise(param.start, FlowErrors.ThisParamNoDefault); - } - - this.resetEndLocation(param); - return param; - } - - parseMaybeDefault(startPos, startLoc, left) { - const node = super.parseMaybeDefault(startPos, startLoc, left); - - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, FlowErrors.TypeBeforeInitializer); - } - - return node; - } - - shouldParseDefaultImport(node) { - if (!hasTypeImportKind(node)) { - return super.shouldParseDefaultImport(node); - } - - return isMaybeDefaultImport(this.state); - } - - parseImportSpecifierLocal(node, specifier, type, contextDescription) { - specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); - this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, type)); - } - - maybeParseDefaultImportSpecifier(node) { - node.importKind = "value"; - let kind = null; - - if (this.match(86)) { - kind = "typeof"; - } else if (this.isContextual("type")) { - kind = "type"; - } - - if (kind) { - const lh = this.lookahead(); - - if (kind === "type" && lh.type === 54) { - this.unexpected(lh.start); - } - - if (isMaybeDefaultImport(lh) || lh.type === 13 || lh.type === 54) { - this.next(); - node.importKind = kind; - } - } - - return super.maybeParseDefaultImportSpecifier(node); - } - - parseImportSpecifier(node) { - const specifier = this.startNode(); - const firstIdentIsString = this.match(4); - const firstIdent = this.parseModuleExportName(); - let specifierTypeKind = null; - - if (firstIdent.type === "Identifier") { - if (firstIdent.name === "type") { - specifierTypeKind = "type"; - } else if (firstIdent.name === "typeof") { - specifierTypeKind = "typeof"; - } - } - - let isBinding = false; - - if (this.isContextual("as") && !this.isLookaheadContextual("as")) { - const as_ident = this.parseIdentifier(true); - - if (specifierTypeKind !== null && !this.match(5) && !tokenIsKeyword(this.state.type)) { - specifier.imported = as_ident; - specifier.importKind = specifierTypeKind; - specifier.local = cloneIdentifier(as_ident); - } else { - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = this.parseIdentifier(); - } - } else { - if (specifierTypeKind !== null && (this.match(5) || tokenIsKeyword(this.state.type))) { - specifier.imported = this.parseIdentifier(true); - specifier.importKind = specifierTypeKind; - } else { - if (firstIdentIsString) { - throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, firstIdent.value); - } - - specifier.imported = firstIdent; - specifier.importKind = null; - } - - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); - } else { - isBinding = true; - specifier.local = cloneIdentifier(specifier.imported); - } - } - - const nodeIsTypeImport = hasTypeImportKind(node); - const specifierIsTypeImport = hasTypeImportKind(specifier); - - if (nodeIsTypeImport && specifierIsTypeImport) { - this.raise(specifier.start, FlowErrors.ImportTypeShorthandOnlyInPureImport); - } - - if (nodeIsTypeImport || specifierIsTypeImport) { - this.checkReservedType(specifier.local.name, specifier.local.start, true); - } - - if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) { - this.checkReservedWord(specifier.local.name, specifier.start, true, true); - } - - this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - } - - parseBindingAtom() { - switch (this.state.type) { - case 77: - return this.parseIdentifier(true); - - default: - return super.parseBindingAtom(); - } - } - - parseFunctionParams(node, allowModifiers) { - const kind = node.kind; - - if (kind !== "get" && kind !== "set" && this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.parseFunctionParams(node, allowModifiers); - } - - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - - if (this.match(22)) { - decl.id.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(decl.id); - } - } - - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(22)) { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - node.returnType = this.flowParseTypeAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - } - - return super.parseAsyncArrowFromCallExpression(node, call); - } - - shouldParseAsyncArrow() { - return this.match(22) || super.shouldParseAsyncArrow(); - } - - parseMaybeAssign(refExpressionErrors, afterLeftParse) { - var _jsx; - - let state = null; - let jsx; - - if (this.hasPlugin("jsx") && (this.match(94) || this.isRelational("<"))) { - state = this.state.clone(); - jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); - if (!jsx.error) return jsx.node; - const { - context - } = this.state; - const curContext = context[context.length - 1]; - - if (curContext === types.j_oTag) { - context.length -= 2; - } else if (curContext === types.j_expr) { - context.length -= 1; - } - } - - if ((_jsx = jsx) != null && _jsx.error || this.isRelational("<")) { - var _jsx2, _jsx3; - - state = state || this.state.clone(); - let typeParameters; - const arrow = this.tryParse(abort => { - var _arrowExpression$extr; - - typeParameters = this.flowParseTypeParameterDeclaration(); - const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { - const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); - this.resetStartLocationFromNode(result, typeParameters); - return result; - }); - if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); - const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); - if (expr.type !== "ArrowFunctionExpression") abort(); - expr.typeParameters = typeParameters; - this.resetStartLocationFromNode(expr, typeParameters); - return arrowExpression; - }, state); - let arrowExpression = null; - - if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { - if (!arrow.error && !arrow.aborted) { - if (arrow.node.async) { - this.raise(typeParameters.start, FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction); - } - - return arrow.node; - } - - arrowExpression = arrow.node; - } - - if ((_jsx2 = jsx) != null && _jsx2.node) { - this.state = jsx.failState; - return jsx.node; - } - - if (arrowExpression) { - this.state = arrow.failState; - return arrowExpression; - } - - if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - throw this.raise(typeParameters.start, FlowErrors.UnexpectedTokenAfterTypeParameter); - } - - return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); - } - - parseArrow(node) { - if (this.match(22)) { - const result = this.tryParse(() => { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - if (this.canInsertSemicolon()) this.unexpected(); - if (!this.match(27)) this.unexpected(); - return typeNode; - }); - if (result.thrown) return null; - if (result.error) this.state = result.failState; - node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; - } - - return super.parseArrow(node); - } - - shouldParseArrow(params) { - return this.match(22) || super.shouldParseArrow(params); - } - - setArrowFunctionParameters(node, params) { - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - node.params = params; - } else { - super.setArrowFunctionParameters(node, params); - } - } - - checkParams(node, allowDuplicates, isArrowFunction) { - if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - return; - } - - for (let i = 0; i < node.params.length; i++) { - if (this.isThisParam(node.params[i]) && i > 0) { - this.raise(node.params[i].start, FlowErrors.ThisParamMustBeFirst); - } - } - - return super.checkParams(...arguments); - } - - parseParenAndDistinguishExpression(canBeArrow) { - return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); - } - - parseSubscripts(base, startPos, startLoc, noCalls) { - if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) { - this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseCallExpressionArguments(19, false); - base = this.finishNode(node, "CallExpression"); - } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) { - const state = this.state.clone(); - const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state); - if (!arrow.error && !arrow.aborted) return arrow.node; - const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state); - if (result.node && !result.error) return result.node; - - if (arrow.node) { - this.state = arrow.failState; - return arrow.node; - } - - if (result.node) { - this.state = result.failState; - return result.node; - } - - throw arrow.error || result.error; - } - - return super.parseSubscripts(base, startPos, startLoc, noCalls); - } - - parseSubscript(base, startPos, startLoc, noCalls, subscriptState) { - if (this.match(26) && this.isLookaheadToken_lt()) { - subscriptState.optionalChainMember = true; - - if (noCalls) { - subscriptState.stop = true; - return base; - } - - this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.typeArguments = this.flowParseTypeParameterInstantiation(); - this.expect(18); - node.arguments = this.parseCallExpressionArguments(19, false); - node.optional = true; - return this.finishCallExpression(node, true); - } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) { - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const result = this.tryParse(() => { - node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); - this.expect(18); - node.arguments = this.parseCallExpressionArguments(19, false); - if (subscriptState.optionalChainMember) node.optional = false; - return this.finishCallExpression(node, subscriptState.optionalChainMember); - }); - - if (result.node) { - if (result.error) this.state = result.failState; - return result.node; - } - } - - return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState); - } - - parseNewArguments(node) { - let targs = null; - - if (this.shouldParseTypes() && this.isRelational("<")) { - targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; - } - - node.typeArguments = targs; - super.parseNewArguments(node); - } - - parseAsyncArrowWithTypeParameters(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - this.parseFunctionParams(node); - if (!this.parseArrow(node)) return; - return this.parseArrowExpression(node, undefined, true); - } - - readToken_mult_modulo(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 42 && next === 47 && this.state.hasFlowComment) { - this.state.hasFlowComment = false; - this.state.pos += 2; - this.nextToken(); - return; - } - - super.readToken_mult_modulo(code); - } - - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 124 && next === 125) { - this.finishOp(17, 2); - return; - } - - super.readToken_pipe_amp(code); - } - - parseTopLevel(file, program) { - const fileNode = super.parseTopLevel(file, program); - - if (this.state.hasFlowComment) { - this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment); - } - - return fileNode; - } - - skipBlockComment() { - if (this.hasPlugin("flowComments") && this.skipFlowComment()) { - if (this.state.hasFlowComment) { - this.unexpected(null, FlowErrors.NestedFlowComment); - } - - this.hasFlowCommentCompletion(); - this.state.pos += this.skipFlowComment(); - this.state.hasFlowComment = true; - return; - } - - if (this.state.hasFlowComment) { - const end = this.input.indexOf("*-/", this.state.pos += 2); - - if (end === -1) { - throw this.raise(this.state.pos - 2, ErrorMessages.UnterminatedComment); - } - - this.state.pos = end + 3; - return; - } - - return super.skipBlockComment(); - } - - skipFlowComment() { - const { - pos - } = this.state; - let shiftToFirstNonWhiteSpace = 2; - - while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { - shiftToFirstNonWhiteSpace++; - } - - const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); - const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); - - if (ch2 === 58 && ch3 === 58) { - return shiftToFirstNonWhiteSpace + 2; - } - - if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { - return shiftToFirstNonWhiteSpace + 12; - } - - if (ch2 === 58 && ch3 !== 58) { - return shiftToFirstNonWhiteSpace; - } - - return false; - } - - hasFlowCommentCompletion() { - const end = this.input.indexOf("*/", this.state.pos); - - if (end === -1) { - throw this.raise(this.state.pos, ErrorMessages.UnterminatedComment); - } - } - - flowEnumErrorBooleanMemberNotInitialized(pos, { - enumName, - memberName - }) { - this.raise(pos, FlowErrors.EnumBooleanMemberNotInitialized, memberName, enumName); - } - - flowEnumErrorInvalidMemberName(pos, { - enumName, - memberName - }) { - const suggestion = memberName[0].toUpperCase() + memberName.slice(1); - this.raise(pos, FlowErrors.EnumInvalidMemberName, memberName, suggestion, enumName); - } - - flowEnumErrorDuplicateMemberName(pos, { - enumName, - memberName - }) { - this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName); - } - - flowEnumErrorInconsistentMemberValues(pos, { - enumName - }) { - this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName); - } - - flowEnumErrorInvalidExplicitType(pos, { - enumName, - suppliedType - }) { - return this.raise(pos, suppliedType === null ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors.EnumInvalidExplicitType, enumName, suppliedType); - } - - flowEnumErrorInvalidMemberInitializer(pos, { - enumName, - explicitType, - memberName - }) { - let message = null; - - switch (explicitType) { - case "boolean": - case "number": - case "string": - message = FlowErrors.EnumInvalidMemberInitializerPrimaryType; - break; - - case "symbol": - message = FlowErrors.EnumInvalidMemberInitializerSymbolType; - break; - - default: - message = FlowErrors.EnumInvalidMemberInitializerUnknownType; - } - - return this.raise(pos, message, enumName, memberName, explicitType); - } - - flowEnumErrorNumberMemberNotInitialized(pos, { - enumName, - memberName - }) { - this.raise(pos, FlowErrors.EnumNumberMemberNotInitialized, enumName, memberName); - } - - flowEnumErrorStringMemberInconsistentlyInitailized(pos, { - enumName - }) { - this.raise(pos, FlowErrors.EnumStringMemberInconsistentlyInitailized, enumName); - } - - flowEnumMemberInit() { - const startPos = this.state.start; - - const endOfInit = () => this.match(20) || this.match(16); - - switch (this.state.type) { - case 0: - { - const literal = this.parseNumericLiteral(this.state.value); - - if (endOfInit()) { - return { - type: "number", - pos: literal.start, - value: literal - }; - } - - return { - type: "invalid", - pos: startPos - }; - } - - case 4: - { - const literal = this.parseStringLiteral(this.state.value); - - if (endOfInit()) { - return { - type: "string", - pos: literal.start, - value: literal - }; - } - - return { - type: "invalid", - pos: startPos - }; - } - - case 84: - case 85: - { - const literal = this.parseBooleanLiteral(this.match(84)); - - if (endOfInit()) { - return { - type: "boolean", - pos: literal.start, - value: literal - }; - } - - return { - type: "invalid", - pos: startPos - }; - } - - default: - return { - type: "invalid", - pos: startPos - }; - } - } - - flowEnumMemberRaw() { - const pos = this.state.start; - const id = this.parseIdentifier(true); - const init = this.eat(35) ? this.flowEnumMemberInit() : { - type: "none", - pos - }; - return { - id, - init - }; - } - - flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) { - const { - explicitType - } = context; - - if (explicitType === null) { - return; - } - - if (explicitType !== expectedType) { - this.flowEnumErrorInvalidMemberInitializer(pos, context); - } - } - - flowEnumMembers({ - enumName, - explicitType - }) { - const seenNames = new Set(); - const members = { - booleanMembers: [], - numberMembers: [], - stringMembers: [], - defaultedMembers: [] - }; - let hasUnknownMembers = false; - - while (!this.match(16)) { - if (this.eat(29)) { - hasUnknownMembers = true; - break; - } - - const memberNode = this.startNode(); - const { - id, - init - } = this.flowEnumMemberRaw(); - const memberName = id.name; - - if (memberName === "") { - continue; - } - - if (/^[a-z]/.test(memberName)) { - this.flowEnumErrorInvalidMemberName(id.start, { - enumName, - memberName - }); - } - - if (seenNames.has(memberName)) { - this.flowEnumErrorDuplicateMemberName(id.start, { - enumName, - memberName - }); - } - - seenNames.add(memberName); - const context = { - enumName, - explicitType, - memberName - }; - memberNode.id = id; - - switch (init.type) { - case "boolean": - { - this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean"); - memberNode.init = init.value; - members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); - break; - } - - case "number": - { - this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number"); - memberNode.init = init.value; - members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); - break; - } - - case "string": - { - this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string"); - memberNode.init = init.value; - members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); - break; - } - - case "invalid": - { - throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context); - } - - case "none": - { - switch (explicitType) { - case "boolean": - this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context); - break; - - case "number": - this.flowEnumErrorNumberMemberNotInitialized(init.pos, context); - break; - - default: - members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); - } - } - } - - if (!this.match(16)) { - this.expect(20); - } - } - - return { - members, - hasUnknownMembers - }; - } - - flowEnumStringMembers(initializedMembers, defaultedMembers, { - enumName - }) { - if (initializedMembers.length === 0) { - return defaultedMembers; - } else if (defaultedMembers.length === 0) { - return initializedMembers; - } else if (defaultedMembers.length > initializedMembers.length) { - for (const member of initializedMembers) { - this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, { - enumName - }); - } - - return defaultedMembers; - } else { - for (const member of defaultedMembers) { - this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, { - enumName - }); - } - - return initializedMembers; - } - } - - flowEnumParseExplicitType({ - enumName - }) { - if (this.eatContextual("of")) { - if (!this.match(5)) { - throw this.flowEnumErrorInvalidExplicitType(this.state.start, { - enumName, - suppliedType: null - }); - } - - const { - value - } = this.state; - this.next(); - - if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { - this.flowEnumErrorInvalidExplicitType(this.state.start, { - enumName, - suppliedType: value - }); - } - - return value; - } - - return null; - } - - flowEnumBody(node, { - enumName, - nameLoc - }) { - const explicitType = this.flowEnumParseExplicitType({ - enumName - }); - this.expect(13); - const { - members, - hasUnknownMembers - } = this.flowEnumMembers({ - enumName, - explicitType - }); - node.hasUnknownMembers = hasUnknownMembers; - - switch (explicitType) { - case "boolean": - node.explicitType = true; - node.members = members.booleanMembers; - this.expect(16); - return this.finishNode(node, "EnumBooleanBody"); - - case "number": - node.explicitType = true; - node.members = members.numberMembers; - this.expect(16); - return this.finishNode(node, "EnumNumberBody"); - - case "string": - node.explicitType = true; - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(16); - return this.finishNode(node, "EnumStringBody"); - - case "symbol": - node.members = members.defaultedMembers; - this.expect(16); - return this.finishNode(node, "EnumSymbolBody"); - - default: - { - const empty = () => { - node.members = []; - this.expect(16); - return this.finishNode(node, "EnumStringBody"); - }; - - node.explicitType = false; - const boolsLen = members.booleanMembers.length; - const numsLen = members.numberMembers.length; - const strsLen = members.stringMembers.length; - const defaultedLen = members.defaultedMembers.length; - - if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { - return empty(); - } else if (!boolsLen && !numsLen) { - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(16); - return this.finishNode(node, "EnumStringBody"); - } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { - for (const member of members.defaultedMembers) { - this.flowEnumErrorBooleanMemberNotInitialized(member.start, { - enumName, - memberName: member.id.name - }); - } - - node.members = members.booleanMembers; - this.expect(16); - return this.finishNode(node, "EnumBooleanBody"); - } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { - for (const member of members.defaultedMembers) { - this.flowEnumErrorNumberMemberNotInitialized(member.start, { - enumName, - memberName: member.id.name - }); - } - - node.members = members.numberMembers; - this.expect(16); - return this.finishNode(node, "EnumNumberBody"); - } else { - this.flowEnumErrorInconsistentMemberValues(nameLoc, { - enumName - }); - return empty(); - } - } - } - } - - flowParseEnumDeclaration(node) { - const id = this.parseIdentifier(); - node.id = id; - node.body = this.flowEnumBody(this.startNode(), { - enumName: id.name, - nameLoc: id.start - }); - return this.finishNode(node, "EnumDeclaration"); - } - - isLookaheadToken_lt() { - const next = this.nextTokenStart(); - - if (this.input.charCodeAt(next) === 60) { - const afterNext = this.input.charCodeAt(next + 1); - return afterNext !== 60 && afterNext !== 61; - } - - return false; - } - - maybeUnwrapTypeCastExpression(node) { - return node.type === "TypeCastExpression" ? node.expression : node; - } - -}); - -const entities = { - quot: "\u0022", - amp: "&", - apos: "\u0027", - lt: "<", - gt: ">", - nbsp: "\u00A0", - iexcl: "\u00A1", - cent: "\u00A2", - pound: "\u00A3", - curren: "\u00A4", - yen: "\u00A5", - brvbar: "\u00A6", - sect: "\u00A7", - uml: "\u00A8", - copy: "\u00A9", - ordf: "\u00AA", - laquo: "\u00AB", - not: "\u00AC", - shy: "\u00AD", - reg: "\u00AE", - macr: "\u00AF", - deg: "\u00B0", - plusmn: "\u00B1", - sup2: "\u00B2", - sup3: "\u00B3", - acute: "\u00B4", - micro: "\u00B5", - para: "\u00B6", - middot: "\u00B7", - cedil: "\u00B8", - sup1: "\u00B9", - ordm: "\u00BA", - raquo: "\u00BB", - frac14: "\u00BC", - frac12: "\u00BD", - frac34: "\u00BE", - iquest: "\u00BF", - Agrave: "\u00C0", - Aacute: "\u00C1", - Acirc: "\u00C2", - Atilde: "\u00C3", - Auml: "\u00C4", - Aring: "\u00C5", - AElig: "\u00C6", - Ccedil: "\u00C7", - Egrave: "\u00C8", - Eacute: "\u00C9", - Ecirc: "\u00CA", - Euml: "\u00CB", - Igrave: "\u00CC", - Iacute: "\u00CD", - Icirc: "\u00CE", - Iuml: "\u00CF", - ETH: "\u00D0", - Ntilde: "\u00D1", - Ograve: "\u00D2", - Oacute: "\u00D3", - Ocirc: "\u00D4", - Otilde: "\u00D5", - Ouml: "\u00D6", - times: "\u00D7", - Oslash: "\u00D8", - Ugrave: "\u00D9", - Uacute: "\u00DA", - Ucirc: "\u00DB", - Uuml: "\u00DC", - Yacute: "\u00DD", - THORN: "\u00DE", - szlig: "\u00DF", - agrave: "\u00E0", - aacute: "\u00E1", - acirc: "\u00E2", - atilde: "\u00E3", - auml: "\u00E4", - aring: "\u00E5", - aelig: "\u00E6", - ccedil: "\u00E7", - egrave: "\u00E8", - eacute: "\u00E9", - ecirc: "\u00EA", - euml: "\u00EB", - igrave: "\u00EC", - iacute: "\u00ED", - icirc: "\u00EE", - iuml: "\u00EF", - eth: "\u00F0", - ntilde: "\u00F1", - ograve: "\u00F2", - oacute: "\u00F3", - ocirc: "\u00F4", - otilde: "\u00F5", - ouml: "\u00F6", - divide: "\u00F7", - oslash: "\u00F8", - ugrave: "\u00F9", - uacute: "\u00FA", - ucirc: "\u00FB", - uuml: "\u00FC", - yacute: "\u00FD", - thorn: "\u00FE", - yuml: "\u00FF", - OElig: "\u0152", - oelig: "\u0153", - Scaron: "\u0160", - scaron: "\u0161", - Yuml: "\u0178", - fnof: "\u0192", - circ: "\u02C6", - tilde: "\u02DC", - Alpha: "\u0391", - Beta: "\u0392", - Gamma: "\u0393", - Delta: "\u0394", - Epsilon: "\u0395", - Zeta: "\u0396", - Eta: "\u0397", - Theta: "\u0398", - Iota: "\u0399", - Kappa: "\u039A", - Lambda: "\u039B", - Mu: "\u039C", - Nu: "\u039D", - Xi: "\u039E", - Omicron: "\u039F", - Pi: "\u03A0", - Rho: "\u03A1", - Sigma: "\u03A3", - Tau: "\u03A4", - Upsilon: "\u03A5", - Phi: "\u03A6", - Chi: "\u03A7", - Psi: "\u03A8", - Omega: "\u03A9", - alpha: "\u03B1", - beta: "\u03B2", - gamma: "\u03B3", - delta: "\u03B4", - epsilon: "\u03B5", - zeta: "\u03B6", - eta: "\u03B7", - theta: "\u03B8", - iota: "\u03B9", - kappa: "\u03BA", - lambda: "\u03BB", - mu: "\u03BC", - nu: "\u03BD", - xi: "\u03BE", - omicron: "\u03BF", - pi: "\u03C0", - rho: "\u03C1", - sigmaf: "\u03C2", - sigma: "\u03C3", - tau: "\u03C4", - upsilon: "\u03C5", - phi: "\u03C6", - chi: "\u03C7", - psi: "\u03C8", - omega: "\u03C9", - thetasym: "\u03D1", - upsih: "\u03D2", - piv: "\u03D6", - ensp: "\u2002", - emsp: "\u2003", - thinsp: "\u2009", - zwnj: "\u200C", - zwj: "\u200D", - lrm: "\u200E", - rlm: "\u200F", - ndash: "\u2013", - mdash: "\u2014", - lsquo: "\u2018", - rsquo: "\u2019", - sbquo: "\u201A", - ldquo: "\u201C", - rdquo: "\u201D", - bdquo: "\u201E", - dagger: "\u2020", - Dagger: "\u2021", - bull: "\u2022", - hellip: "\u2026", - permil: "\u2030", - prime: "\u2032", - Prime: "\u2033", - lsaquo: "\u2039", - rsaquo: "\u203A", - oline: "\u203E", - frasl: "\u2044", - euro: "\u20AC", - image: "\u2111", - weierp: "\u2118", - real: "\u211C", - trade: "\u2122", - alefsym: "\u2135", - larr: "\u2190", - uarr: "\u2191", - rarr: "\u2192", - darr: "\u2193", - harr: "\u2194", - crarr: "\u21B5", - lArr: "\u21D0", - uArr: "\u21D1", - rArr: "\u21D2", - dArr: "\u21D3", - hArr: "\u21D4", - forall: "\u2200", - part: "\u2202", - exist: "\u2203", - empty: "\u2205", - nabla: "\u2207", - isin: "\u2208", - notin: "\u2209", - ni: "\u220B", - prod: "\u220F", - sum: "\u2211", - minus: "\u2212", - lowast: "\u2217", - radic: "\u221A", - prop: "\u221D", - infin: "\u221E", - ang: "\u2220", - and: "\u2227", - or: "\u2228", - cap: "\u2229", - cup: "\u222A", - int: "\u222B", - there4: "\u2234", - sim: "\u223C", - cong: "\u2245", - asymp: "\u2248", - ne: "\u2260", - equiv: "\u2261", - le: "\u2264", - ge: "\u2265", - sub: "\u2282", - sup: "\u2283", - nsub: "\u2284", - sube: "\u2286", - supe: "\u2287", - oplus: "\u2295", - otimes: "\u2297", - perp: "\u22A5", - sdot: "\u22C5", - lceil: "\u2308", - rceil: "\u2309", - lfloor: "\u230A", - rfloor: "\u230B", - lang: "\u2329", - rang: "\u232A", - loz: "\u25CA", - spades: "\u2660", - clubs: "\u2663", - hearts: "\u2665", - diams: "\u2666" -}; - -const HEX_NUMBER = /^[\da-fA-F]+$/; -const DECIMAL_NUMBER = /^\d+$/; -const JsxErrors = makeErrorTemplates({ - AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", - MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>.", - MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", - UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", - UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", - UnterminatedJsxContent: "Unterminated JSX contents.", - UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?" -}, ErrorCodes.SyntaxError, "jsx"); -types.j_oTag = new TokContext("...", true); - -function isFragment(object) { - return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; -} - -function getQualifiedJSXName(object) { - if (object.type === "JSXIdentifier") { - return object.name; - } - - if (object.type === "JSXNamespacedName") { - return object.namespace.name + ":" + object.name.name; - } - - if (object.type === "JSXMemberExpression") { - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); - } - - throw new Error("Node had unexpected type: " + object.type); -} - -var jsx = (superClass => class extends superClass { - jsxReadToken() { - let out = ""; - let chunkStart = this.state.pos; - - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent); - } - - const ch = this.input.charCodeAt(this.state.pos); - - switch (ch) { - case 60: - case 123: - if (this.state.pos === this.state.start) { - if (ch === 60 && this.state.exprAllowed) { - ++this.state.pos; - return this.finishToken(94); - } - - return super.getTokenFromCode(ch); - } - - out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(93, out); - - case 38: - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - break; - - case 62: - case 125: - - default: - if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(true); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - - } - } - } - - jsxReadNewLine(normalizeCRLF) { - const ch = this.input.charCodeAt(this.state.pos); - let out; - ++this.state.pos; - - if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); - } - - ++this.state.curLine; - this.state.lineStart = this.state.pos; - return out; - } - - jsxReadString(quote) { - let out = ""; - let chunkStart = ++this.state.pos; - - for (;;) { - if (this.state.pos >= this.length) { - throw this.raise(this.state.start, ErrorMessages.UnterminatedString); - } - - const ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - - if (ch === 38) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(false); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - - out += this.input.slice(chunkStart, this.state.pos++); - return this.finishToken(4, out); - } - - jsxReadEntity() { - let str = ""; - let count = 0; - let entity; - let ch = this.input[this.state.pos]; - const startPos = ++this.state.pos; - - while (this.state.pos < this.length && count++ < 10) { - ch = this.input[this.state.pos++]; - - if (ch === ";") { - if (str[0] === "#") { - if (str[1] === "x") { - str = str.substr(2); - - if (HEX_NUMBER.test(str)) { - entity = String.fromCodePoint(parseInt(str, 16)); - } - } else { - str = str.substr(1); - - if (DECIMAL_NUMBER.test(str)) { - entity = String.fromCodePoint(parseInt(str, 10)); - } - } - } else { - entity = entities[str]; - } - - break; - } - - str += ch; - } - - if (!entity) { - this.state.pos = startPos; - return "&"; - } - - return entity; - } - - jsxReadWord() { - let ch; - const start = this.state.pos; - - do { - ch = this.input.charCodeAt(++this.state.pos); - } while (isIdentifierChar(ch) || ch === 45); - - return this.finishToken(92, this.input.slice(start, this.state.pos)); - } - - jsxParseIdentifier() { - const node = this.startNode(); - - if (this.match(92)) { - node.name = this.state.value; - } else if (tokenIsKeyword(this.state.type)) { - node.name = tokenLabelName(this.state.type); - } else { - this.unexpected(); - } - - this.next(); - return this.finishNode(node, "JSXIdentifier"); - } - - jsxParseNamespacedName() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const name = this.jsxParseIdentifier(); - if (!this.eat(22)) return name; - const node = this.startNodeAt(startPos, startLoc); - node.namespace = name; - node.name = this.jsxParseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); - } - - jsxParseElementName() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let node = this.jsxParseNamespacedName(); - - if (node.type === "JSXNamespacedName") { - return node; - } - - while (this.eat(24)) { - const newNode = this.startNodeAt(startPos, startLoc); - newNode.object = node; - newNode.property = this.jsxParseIdentifier(); - node = this.finishNode(newNode, "JSXMemberExpression"); - } - - return node; - } - - jsxParseAttributeValue() { - let node; - - switch (this.state.type) { - case 13: - node = this.startNode(); - this.next(); - node = this.jsxParseExpressionContainer(node); - - if (node.expression.type === "JSXEmptyExpression") { - this.raise(node.start, JsxErrors.AttributeIsEmpty); - } - - return node; - - case 94: - case 4: - return this.parseExprAtom(); - - default: - throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue); - } - } - - jsxParseEmptyExpression() { - const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); - return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); - } - - jsxParseSpreadChild(node) { - this.next(); - node.expression = this.parseExpression(); - this.expect(16); - return this.finishNode(node, "JSXSpreadChild"); - } - - jsxParseExpressionContainer(node) { - if (this.match(16)) { - node.expression = this.jsxParseEmptyExpression(); - } else { - const expression = this.parseExpression(); - node.expression = expression; - } - - this.expect(16); - return this.finishNode(node, "JSXExpressionContainer"); - } - - jsxParseAttribute() { - const node = this.startNode(); - - if (this.eat(13)) { - this.expect(29); - node.argument = this.parseMaybeAssignAllowIn(); - this.expect(16); - return this.finishNode(node, "JSXSpreadAttribute"); - } - - node.name = this.jsxParseNamespacedName(); - node.value = this.eat(35) ? this.jsxParseAttributeValue() : null; - return this.finishNode(node, "JSXAttribute"); - } - - jsxParseOpeningElementAt(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - - if (this.match(95)) { - this.expect(95); - return this.finishNode(node, "JSXOpeningFragment"); - } - - node.name = this.jsxParseElementName(); - return this.jsxParseOpeningElementAfterName(node); - } - - jsxParseOpeningElementAfterName(node) { - const attributes = []; - - while (!this.match(55) && !this.match(95)) { - attributes.push(this.jsxParseAttribute()); - } - - node.attributes = attributes; - node.selfClosing = this.eat(55); - this.expect(95); - return this.finishNode(node, "JSXOpeningElement"); - } - - jsxParseClosingElementAt(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - - if (this.match(95)) { - this.expect(95); - return this.finishNode(node, "JSXClosingFragment"); - } - - node.name = this.jsxParseElementName(); - this.expect(95); - return this.finishNode(node, "JSXClosingElement"); - } - - jsxParseElementAt(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - const children = []; - const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc); - let closingElement = null; - - if (!openingElement.selfClosing) { - contents: for (;;) { - switch (this.state.type) { - case 94: - startPos = this.state.start; - startLoc = this.state.startLoc; - this.next(); - - if (this.eat(55)) { - closingElement = this.jsxParseClosingElementAt(startPos, startLoc); - break contents; - } - - children.push(this.jsxParseElementAt(startPos, startLoc)); - break; - - case 93: - children.push(this.parseExprAtom()); - break; - - case 13: - { - const node = this.startNode(); - this.next(); - - if (this.match(29)) { - children.push(this.jsxParseSpreadChild(node)); - } else { - children.push(this.jsxParseExpressionContainer(node)); - } - - break; - } - - default: - throw this.unexpected(); - } - } - - if (isFragment(openingElement) && !isFragment(closingElement)) { - this.raise(closingElement.start, JsxErrors.MissingClosingTagFragment); - } else if (!isFragment(openingElement) && isFragment(closingElement)) { - this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name)); - } else if (!isFragment(openingElement) && !isFragment(closingElement)) { - if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { - this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name)); - } - } - } - - if (isFragment(openingElement)) { - node.openingFragment = openingElement; - node.closingFragment = closingElement; - } else { - node.openingElement = openingElement; - node.closingElement = closingElement; - } - - node.children = children; - - if (this.isRelational("<")) { - throw this.raise(this.state.start, JsxErrors.UnwrappedAdjacentJSXElements); - } - - return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); - } - - jsxParseElement() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - this.next(); - return this.jsxParseElementAt(startPos, startLoc); - } - - parseExprAtom(refExpressionErrors) { - if (this.match(93)) { - return this.parseLiteral(this.state.value, "JSXText"); - } else if (this.match(94)) { - return this.jsxParseElement(); - } else if (this.isRelational("<") && this.input.charCodeAt(this.state.pos) !== 33) { - this.finishToken(94); - return this.jsxParseElement(); - } else { - return super.parseExprAtom(refExpressionErrors); - } - } - - createLookaheadState(state) { - const lookaheadState = super.createLookaheadState(state); - lookaheadState.inPropertyName = state.inPropertyName; - return lookaheadState; - } - - getTokenFromCode(code) { - if (this.state.inPropertyName) return super.getTokenFromCode(code); - const context = this.curContext(); - - if (context === types.j_expr) { - return this.jsxReadToken(); - } - - if (context === types.j_oTag || context === types.j_cTag) { - if (isIdentifierStart(code)) { - return this.jsxReadWord(); - } - - if (code === 62) { - ++this.state.pos; - return this.finishToken(95); - } - - if ((code === 34 || code === 39) && context === types.j_oTag) { - return this.jsxReadString(code); - } - } - - if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) { - ++this.state.pos; - return this.finishToken(94); - } - - return super.getTokenFromCode(code); - } - - updateContext(prevType) { - super.updateContext(prevType); - const { - context, - type - } = this.state; - - if (type === 55 && prevType === 94) { - context.splice(-2, 2, types.j_cTag); - this.state.exprAllowed = false; - } else if (type === 94) { - context.push(types.j_expr, types.j_oTag); - } else if (type === 95) { - const out = context.pop(); - - if (out === types.j_oTag && prevType === 55 || out === types.j_cTag) { - context.pop(); - this.state.exprAllowed = context[context.length - 1] === types.j_expr; - } else { - this.state.exprAllowed = true; - } - } else if (tokenIsKeyword(type) && (prevType === 24 || prevType === 26)) { - this.state.exprAllowed = false; - } else { - this.state.exprAllowed = tokenComesBeforeExpression(type); - } - } - -}); - -class TypeScriptScope extends Scope { - constructor(...args) { - super(...args); - this.types = new Set(); - this.enums = new Set(); - this.constEnums = new Set(); - this.classes = new Set(); - this.exportOnlyBindings = new Set(); - } - -} - -class TypeScriptScopeHandler extends ScopeHandler { - createScope(flags) { - return new TypeScriptScope(flags); - } - - declareName(name, bindingType, pos) { - const scope = this.currentScope(); - - if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) { - this.maybeExportDefined(scope, name); - scope.exportOnlyBindings.add(name); - return; - } - - super.declareName(...arguments); - - if (bindingType & BIND_KIND_TYPE) { - if (!(bindingType & BIND_KIND_VALUE)) { - this.checkRedeclarationInScope(scope, name, bindingType, pos); - this.maybeExportDefined(scope, name); - } - - scope.types.add(name); - } - - if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name); - if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name); - if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name); - } - - isRedeclaredInScope(scope, name, bindingType) { - if (scope.enums.has(name)) { - if (bindingType & BIND_FLAGS_TS_ENUM) { - const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM); - const wasConst = scope.constEnums.has(name); - return isConst !== wasConst; - } - - return true; - } - - if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) { - if (scope.lexical.has(name)) { - return !!(bindingType & BIND_KIND_VALUE); - } else { - return false; - } - } - - if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) { - return true; - } - - return super.isRedeclaredInScope(...arguments); - } - - checkLocalExport(id) { - const topLevelScope = this.scopeStack[0]; - const { - name - } = id; - - if (!topLevelScope.types.has(name) && !topLevelScope.exportOnlyBindings.has(name)) { - super.checkLocalExport(id); - } - } - -} - -function nonNull(x) { - if (x == null) { - throw new Error(`Unexpected ${x} value.`); - } - - return x; -} - -function assert(x) { - if (!x) { - throw new Error("Assert fail"); - } -} - -const TSErrors = makeErrorTemplates({ - AbstractMethodHasImplementation: "Method '%0' cannot have an implementation because it is marked abstract.", - AbstractPropertyHasInitializer: "Property '%0' cannot have an initializer because it is marked abstract.", - AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", - AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.", - ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", - ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", - ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", - DeclareAccessor: "'declare' is not allowed in %0ters.", - DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", - DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", - DuplicateAccessibilityModifier: "Accessibility modifier already seen.", - DuplicateModifier: "Duplicate modifier: '%0'.", - EmptyHeritageClauseType: "'%0' list cannot be empty.", - EmptyTypeArguments: "Type argument list cannot be empty.", - EmptyTypeParameters: "Type parameter list cannot be empty.", - ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", - ImportAliasHasImportType: "An import alias can not use 'import type'.", - IncompatibleModifiers: "'%0' modifier cannot be used with '%1' modifier.", - IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", - IndexSignatureHasAccessibility: "Index signatures cannot have an accessibility modifier ('%0').", - IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", - IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", - IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", - InvalidModifierOnTypeMember: "'%0' modifier cannot appear on a type member.", - InvalidModifiersOrder: "'%0' modifier must precede '%1' modifier.", - InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", - MissingInterfaceName: "'interface' declarations must be followed by an identifier.", - MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.", - NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", - NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", - OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", - OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", - PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", - PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", - PrivateElementHasAccessibility: "Private elements cannot have an accessibility modifier ('%0').", - ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", - SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", - SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", - SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", - StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", - TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", - TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", - UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", - UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", - UnexpectedTypeAnnotation: "Did not expect a type annotation here.", - UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", - UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", - UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", - UnsupportedSignatureParameterKind: "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0." -}, ErrorCodes.SyntaxError, "typescript"); - -function keywordTypeFromName(value) { - switch (value) { - case "any": - return "TSAnyKeyword"; - - case "boolean": - return "TSBooleanKeyword"; - - case "bigint": - return "TSBigIntKeyword"; - - case "never": - return "TSNeverKeyword"; - - case "number": - return "TSNumberKeyword"; - - case "object": - return "TSObjectKeyword"; - - case "string": - return "TSStringKeyword"; - - case "symbol": - return "TSSymbolKeyword"; - - case "undefined": - return "TSUndefinedKeyword"; - - case "unknown": - return "TSUnknownKeyword"; - - default: - return undefined; - } -} - -function tsIsAccessModifier(modifier) { - return modifier === "private" || modifier === "public" || modifier === "protected"; -} - -var typescript = (superClass => class extends superClass { - getScopeHandler() { - return TypeScriptScopeHandler; - } - - tsIsIdentifier() { - return this.match(5); - } - - tsTokenCanFollowModifier() { - return (this.match(8) || this.match(13) || this.match(54) || this.match(29) || this.match(6) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); - } - - tsNextTokenCanFollowModifier() { - this.next(); - return this.tsTokenCanFollowModifier(); - } - - tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { - if (!this.match(5)) { - return undefined; - } - - const modifier = this.state.value; - - if (allowedModifiers.indexOf(modifier) !== -1) { - if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { - return undefined; - } - - if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { - return modifier; - } - } - - return undefined; - } - - tsParseModifiers(modified, allowedModifiers, disallowedModifiers, errorTemplate, stopOnStartOfClassStaticBlock) { - const enforceOrder = (pos, modifier, before, after) => { - if (modifier === before && modified[after]) { - this.raise(pos, TSErrors.InvalidModifiersOrder, before, after); - } - }; - - const incompatible = (pos, modifier, mod1, mod2) => { - if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { - this.raise(pos, TSErrors.IncompatibleModifiers, mod1, mod2); - } - }; - - for (;;) { - const startPos = this.state.start; - const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock); - if (!modifier) break; - - if (tsIsAccessModifier(modifier)) { - if (modified.accessibility) { - this.raise(startPos, TSErrors.DuplicateAccessibilityModifier); - } else { - enforceOrder(startPos, modifier, modifier, "override"); - enforceOrder(startPos, modifier, modifier, "static"); - enforceOrder(startPos, modifier, modifier, "readonly"); - modified.accessibility = modifier; - } - } else { - if (Object.hasOwnProperty.call(modified, modifier)) { - this.raise(startPos, TSErrors.DuplicateModifier, modifier); - } else { - enforceOrder(startPos, modifier, "static", "readonly"); - enforceOrder(startPos, modifier, "static", "override"); - enforceOrder(startPos, modifier, "override", "readonly"); - enforceOrder(startPos, modifier, "abstract", "override"); - incompatible(startPos, modifier, "declare", "override"); - incompatible(startPos, modifier, "static", "abstract"); - } - - modified[modifier] = true; - } - - if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { - this.raise(startPos, errorTemplate, modifier); - } - } - } - - tsIsListTerminator(kind) { - switch (kind) { - case "EnumMembers": - case "TypeMembers": - return this.match(16); - - case "HeritageClauseElement": - return this.match(13); - - case "TupleElementTypes": - return this.match(11); - - case "TypeParametersOrArguments": - return this.isRelational(">"); - } - - throw new Error("Unreachable"); - } - - tsParseList(kind, parseElement) { - const result = []; - - while (!this.tsIsListTerminator(kind)) { - result.push(parseElement()); - } - - return result; - } - - tsParseDelimitedList(kind, parseElement) { - return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true)); - } - - tsParseDelimitedListWorker(kind, parseElement, expectSuccess) { - const result = []; - - for (;;) { - if (this.tsIsListTerminator(kind)) { - break; - } - - const element = parseElement(); - - if (element == null) { - return undefined; - } - - result.push(element); - - if (this.eat(20)) { - continue; - } - - if (this.tsIsListTerminator(kind)) { - break; - } - - if (expectSuccess) { - this.expect(20); - } - - return undefined; - } - - return result; - } - - tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) { - if (!skipFirstToken) { - if (bracket) { - this.expect(8); - } else { - this.expectRelational("<"); - } - } - - const result = this.tsParseDelimitedList(kind, parseElement); - - if (bracket) { - this.expect(11); - } else { - this.expectRelational(">"); - } - - return result; - } - - tsParseImportType() { - const node = this.startNode(); - this.expect(82); - this.expect(18); - - if (!this.match(4)) { - this.raise(this.state.start, TSErrors.UnsupportedImportTypeArgument); - } - - node.argument = this.parseExprAtom(); - this.expect(19); - - if (this.eat(24)) { - node.qualifier = this.tsParseEntityName(true); - } - - if (this.isRelational("<")) { - node.typeParameters = this.tsParseTypeArguments(); - } - - return this.finishNode(node, "TSImportType"); - } - - tsParseEntityName(allowReservedWords) { - let entity = this.parseIdentifier(); - - while (this.eat(24)) { - const node = this.startNodeAtNode(entity); - node.left = entity; - node.right = this.parseIdentifier(allowReservedWords); - entity = this.finishNode(node, "TSQualifiedName"); - } - - return entity; - } - - tsParseTypeReference() { - const node = this.startNode(); - node.typeName = this.tsParseEntityName(false); - - if (!this.hasPrecedingLineBreak() && this.isRelational("<")) { - node.typeParameters = this.tsParseTypeArguments(); - } - - return this.finishNode(node, "TSTypeReference"); - } - - tsParseThisTypePredicate(lhs) { - this.next(); - const node = this.startNodeAtNode(lhs); - node.parameterName = lhs; - node.typeAnnotation = this.tsParseTypeAnnotation(false); - node.asserts = false; - return this.finishNode(node, "TSTypePredicate"); - } - - tsParseThisTypeNode() { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "TSThisType"); - } - - tsParseTypeQuery() { - const node = this.startNode(); - this.expect(86); - - if (this.match(82)) { - node.exprName = this.tsParseImportType(); - } else { - node.exprName = this.tsParseEntityName(true); - } - - return this.finishNode(node, "TSTypeQuery"); - } - - tsParseTypeParameter() { - const node = this.startNode(); - node.name = this.tsParseTypeParameterName(); - node.constraint = this.tsEatThenParseType(80); - node.default = this.tsEatThenParseType(35); - return this.finishNode(node, "TSTypeParameter"); - } - - tsTryParseTypeParameters() { - if (this.isRelational("<")) { - return this.tsParseTypeParameters(); - } - } - - tsParseTypeParameters() { - const node = this.startNode(); - - if (this.isRelational("<") || this.match(94)) { - this.next(); - } else { - this.unexpected(); - } - - node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true); - - if (node.params.length === 0) { - this.raise(node.start, TSErrors.EmptyTypeParameters); - } - - return this.finishNode(node, "TSTypeParameterDeclaration"); - } - - tsTryNextParseConstantContext() { - if (this.lookahead().type === 74) { - this.next(); - return this.tsParseTypeReference(); - } - - return null; - } - - tsFillSignature(returnToken, signature) { - const returnTokenRequired = returnToken === 27; - signature.typeParameters = this.tsTryParseTypeParameters(); - this.expect(18); - signature.parameters = this.tsParseBindingListForSignature(); - - if (returnTokenRequired) { - signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } else if (this.match(returnToken)) { - signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken); - } - } - - tsParseBindingListForSignature() { - return this.parseBindingList(19, 41).map(pattern => { - if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") { - this.raise(pattern.start, TSErrors.UnsupportedSignatureParameterKind, pattern.type); - } - - return pattern; - }); - } - - tsParseTypeMemberSemicolon() { - if (!this.eat(20) && !this.isLineTerminator()) { - this.expect(21); - } - } - - tsParseSignatureMember(kind, node) { - this.tsFillSignature(22, node); - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, kind); - } - - tsIsUnambiguouslyIndexSignature() { - this.next(); - return this.eat(5) && this.match(22); - } - - tsTryParseIndexSignature(node) { - if (!(this.match(8) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { - return undefined; - } - - this.expect(8); - const id = this.parseIdentifier(); - id.typeAnnotation = this.tsParseTypeAnnotation(); - this.resetEndLocation(id); - this.expect(11); - node.parameters = [id]; - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(node, "TSIndexSignature"); - } - - tsParsePropertyOrMethodSignature(node, readonly) { - if (this.eat(25)) node.optional = true; - const nodeAny = node; - - if (this.match(18) || this.isRelational("<")) { - if (readonly) { - this.raise(node.start, TSErrors.ReadonlyForMethodSignature); - } - - const method = nodeAny; - - if (method.kind && this.isRelational("<")) { - this.raise(this.state.pos, TSErrors.AccesorCannotHaveTypeParameters); - } - - this.tsFillSignature(22, method); - this.tsParseTypeMemberSemicolon(); - - if (method.kind === "get") { - if (method.parameters.length > 0) { - this.raise(this.state.pos, ErrorMessages.BadGetterArity); - - if (this.isThisParam(method.parameters[0])) { - this.raise(this.state.pos, TSErrors.AccesorCannotDeclareThisParameter); - } - } - } else if (method.kind === "set") { - if (method.parameters.length !== 1) { - this.raise(this.state.pos, ErrorMessages.BadSetterArity); - } else { - const firstParameter = method.parameters[0]; - - if (this.isThisParam(firstParameter)) { - this.raise(this.state.pos, TSErrors.AccesorCannotDeclareThisParameter); - } - - if (firstParameter.type === "Identifier" && firstParameter.optional) { - this.raise(this.state.pos, TSErrors.SetAccesorCannotHaveOptionalParameter); - } - - if (firstParameter.type === "RestElement") { - this.raise(this.state.pos, TSErrors.SetAccesorCannotHaveRestParameter); - } - } - - if (method.typeAnnotation) { - this.raise(method.typeAnnotation.start, TSErrors.SetAccesorCannotHaveReturnType); - } - } else { - method.kind = "method"; - } - - return this.finishNode(method, "TSMethodSignature"); - } else { - const property = nodeAny; - if (readonly) property.readonly = true; - const type = this.tsTryParseTypeAnnotation(); - if (type) property.typeAnnotation = type; - this.tsParseTypeMemberSemicolon(); - return this.finishNode(property, "TSPropertySignature"); - } - } - - tsParseTypeMember() { - const node = this.startNode(); - - if (this.match(18) || this.isRelational("<")) { - return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); - } - - if (this.match(76)) { - const id = this.startNode(); - this.next(); - - if (this.match(18) || this.isRelational("<")) { - return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); - } else { - node.key = this.createIdentifier(id, "new"); - return this.tsParsePropertyOrMethodSignature(node, false); - } - } - - this.tsParseModifiers(node, ["readonly"], ["declare", "abstract", "private", "protected", "public", "static", "override"], TSErrors.InvalidModifierOnTypeMember); - const idx = this.tsTryParseIndexSignature(node); - - if (idx) { - return idx; - } - - this.parsePropertyName(node, false); - - if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { - node.kind = node.key.name; - this.parsePropertyName(node, false); - } - - return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); - } - - tsParseTypeLiteral() { - const node = this.startNode(); - node.members = this.tsParseObjectTypeMembers(); - return this.finishNode(node, "TSTypeLiteral"); - } - - tsParseObjectTypeMembers() { - this.expect(13); - const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); - this.expect(16); - return members; - } - - tsIsStartOfMappedType() { - this.next(); - - if (this.eat(52)) { - return this.isContextual("readonly"); - } - - if (this.isContextual("readonly")) { - this.next(); - } - - if (!this.match(8)) { - return false; - } - - this.next(); - - if (!this.tsIsIdentifier()) { - return false; - } - - this.next(); - return this.match(57); - } - - tsParseMappedTypeParameter() { - const node = this.startNode(); - node.name = this.tsParseTypeParameterName(); - node.constraint = this.tsExpectThenParseType(57); - return this.finishNode(node, "TSTypeParameter"); - } - - tsParseMappedType() { - const node = this.startNode(); - this.expect(13); - - if (this.match(52)) { - node.readonly = this.state.value; - this.next(); - this.expectContextual("readonly"); - } else if (this.eatContextual("readonly")) { - node.readonly = true; - } - - this.expect(8); - node.typeParameter = this.tsParseMappedTypeParameter(); - node.nameType = this.eatContextual("as") ? this.tsParseType() : null; - this.expect(11); - - if (this.match(52)) { - node.optional = this.state.value; - this.next(); - this.expect(25); - } else if (this.eat(25)) { - node.optional = true; - } - - node.typeAnnotation = this.tsTryParseType(); - this.semicolon(); - this.expect(16); - return this.finishNode(node, "TSMappedType"); - } - - tsParseTupleType() { - const node = this.startNode(); - node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); - let seenOptionalElement = false; - let labeledElements = null; - node.elementTypes.forEach(elementNode => { - var _labeledElements; - - let { - type - } = elementNode; - - if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { - this.raise(elementNode.start, TSErrors.OptionalTypeBeforeRequired); - } - - seenOptionalElement = seenOptionalElement || type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"; - - if (type === "TSRestType") { - elementNode = elementNode.typeAnnotation; - type = elementNode.type; - } - - const isLabeled = type === "TSNamedTupleMember"; - labeledElements = (_labeledElements = labeledElements) != null ? _labeledElements : isLabeled; - - if (labeledElements !== isLabeled) { - this.raise(elementNode.start, TSErrors.MixedLabeledAndUnlabeledElements); - } - }); - return this.finishNode(node, "TSTupleType"); - } - - tsParseTupleElementType() { - const { - start: startPos, - startLoc - } = this.state; - const rest = this.eat(29); - let type = this.tsParseType(); - const optional = this.eat(25); - const labeled = this.eat(22); - - if (labeled) { - const labeledNode = this.startNodeAtNode(type); - labeledNode.optional = optional; - - if (type.type === "TSTypeReference" && !type.typeParameters && type.typeName.type === "Identifier") { - labeledNode.label = type.typeName; - } else { - this.raise(type.start, TSErrors.InvalidTupleMemberLabel); - labeledNode.label = type; - } - - labeledNode.elementType = this.tsParseType(); - type = this.finishNode(labeledNode, "TSNamedTupleMember"); - } else if (optional) { - const optionalTypeNode = this.startNodeAtNode(type); - optionalTypeNode.typeAnnotation = type; - type = this.finishNode(optionalTypeNode, "TSOptionalType"); - } - - if (rest) { - const restNode = this.startNodeAt(startPos, startLoc); - restNode.typeAnnotation = type; - type = this.finishNode(restNode, "TSRestType"); - } - - return type; - } - - tsParseParenthesizedType() { - const node = this.startNode(); - this.expect(18); - node.typeAnnotation = this.tsParseType(); - this.expect(19); - return this.finishNode(node, "TSParenthesizedType"); - } - - tsParseFunctionOrConstructorType(type, abstract) { - const node = this.startNode(); - - if (type === "TSConstructorType") { - node.abstract = !!abstract; - if (abstract) this.next(); - this.next(); - } - - this.tsFillSignature(27, node); - return this.finishNode(node, type); - } - - tsParseLiteralTypeNode() { - const node = this.startNode(); - - node.literal = (() => { - switch (this.state.type) { - case 0: - case 1: - case 4: - case 84: - case 85: - return this.parseExprAtom(); - - default: - throw this.unexpected(); - } - })(); - - return this.finishNode(node, "TSLiteralType"); - } - - tsParseTemplateLiteralType() { - const node = this.startNode(); - node.literal = this.parseTemplate(false); - return this.finishNode(node, "TSLiteralType"); - } - - parseTemplateSubstitution() { - if (this.state.inType) return this.tsParseType(); - return super.parseTemplateSubstitution(); - } - - tsParseThisTypeOrThisTypePredicate() { - const thisKeyword = this.tsParseThisTypeNode(); - - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - return this.tsParseThisTypePredicate(thisKeyword); - } else { - return thisKeyword; - } - } - - tsParseNonArrayType() { - switch (this.state.type) { - case 5: - case 87: - case 83: - { - const type = this.match(87) ? "TSVoidKeyword" : this.match(83) ? "TSNullKeyword" : keywordTypeFromName(this.state.value); - - if (type !== undefined && this.lookaheadCharCode() !== 46) { - const node = this.startNode(); - this.next(); - return this.finishNode(node, type); - } - - return this.tsParseTypeReference(); - } - - case 4: - case 0: - case 1: - case 84: - case 85: - return this.tsParseLiteralTypeNode(); - - case 52: - if (this.state.value === "-") { - const node = this.startNode(); - const nextToken = this.lookahead(); - - if (nextToken.type !== 0 && nextToken.type !== 1) { - throw this.unexpected(); - } - - node.literal = this.parseMaybeUnary(); - return this.finishNode(node, "TSLiteralType"); - } - - break; - - case 77: - return this.tsParseThisTypeOrThisTypePredicate(); - - case 86: - return this.tsParseTypeQuery(); - - case 82: - return this.tsParseImportType(); - - case 13: - return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); - - case 8: - return this.tsParseTupleType(); - - case 18: - return this.tsParseParenthesizedType(); - - case 30: - return this.tsParseTemplateLiteralType(); - } - - throw this.unexpected(); - } - - tsParseArrayTypeOrHigher() { - let type = this.tsParseNonArrayType(); - - while (!this.hasPrecedingLineBreak() && this.eat(8)) { - if (this.match(11)) { - const node = this.startNodeAtNode(type); - node.elementType = type; - this.expect(11); - type = this.finishNode(node, "TSArrayType"); - } else { - const node = this.startNodeAtNode(type); - node.objectType = type; - node.indexType = this.tsParseType(); - this.expect(11); - type = this.finishNode(node, "TSIndexedAccessType"); - } - } - - return type; - } - - tsParseTypeOperator(operator) { - const node = this.startNode(); - this.expectContextual(operator); - node.operator = operator; - node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); - - if (operator === "readonly") { - this.tsCheckTypeAnnotationForReadOnly(node); - } - - return this.finishNode(node, "TSTypeOperator"); - } - - tsCheckTypeAnnotationForReadOnly(node) { - switch (node.typeAnnotation.type) { - case "TSTupleType": - case "TSArrayType": - return; - - default: - this.raise(node.start, TSErrors.UnexpectedReadonly); - } - } - - tsParseInferType() { - const node = this.startNode(); - this.expectContextual("infer"); - const typeParameter = this.startNode(); - typeParameter.name = this.tsParseTypeParameterName(); - node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); - return this.finishNode(node, "TSInferType"); - } - - tsParseTypeOperatorOrHigher() { - const operator = ["keyof", "unique", "readonly"].find(kw => this.isContextual(kw)); - return operator ? this.tsParseTypeOperator(operator) : this.isContextual("infer") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher(); - } - - tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { - const node = this.startNode(); - const hasLeadingOperator = this.eat(operator); - const types = []; - - do { - types.push(parseConstituentType()); - } while (this.eat(operator)); - - if (types.length === 1 && !hasLeadingOperator) { - return types[0]; - } - - node.types = types; - return this.finishNode(node, kind); - } - - tsParseIntersectionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 48); - } - - tsParseUnionTypeOrHigher() { - return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 46); - } - - tsIsStartOfFunctionType() { - if (this.isRelational("<")) { - return true; - } - - return this.match(18) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); - } - - tsSkipParameterStart() { - if (this.match(5) || this.match(77)) { - this.next(); - return true; - } - - if (this.match(13)) { - let braceStackCounter = 1; - this.next(); - - while (braceStackCounter > 0) { - if (this.match(13)) { - ++braceStackCounter; - } else if (this.match(16)) { - --braceStackCounter; - } - - this.next(); - } - - return true; - } - - if (this.match(8)) { - let braceStackCounter = 1; - this.next(); - - while (braceStackCounter > 0) { - if (this.match(8)) { - ++braceStackCounter; - } else if (this.match(11)) { - --braceStackCounter; - } - - this.next(); - } - - return true; - } - - return false; - } - - tsIsUnambiguouslyStartOfFunctionType() { - this.next(); - - if (this.match(19) || this.match(29)) { - return true; - } - - if (this.tsSkipParameterStart()) { - if (this.match(22) || this.match(20) || this.match(25) || this.match(35)) { - return true; - } - - if (this.match(19)) { - this.next(); - - if (this.match(27)) { - return true; - } - } - } - - return false; - } - - tsParseTypeOrTypePredicateAnnotation(returnToken) { - return this.tsInType(() => { - const t = this.startNode(); - this.expect(returnToken); - const node = this.startNode(); - const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); - - if (asserts && this.match(77)) { - let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); - - if (thisTypePredicate.type === "TSThisType") { - node.parameterName = thisTypePredicate; - node.asserts = true; - node.typeAnnotation = null; - thisTypePredicate = this.finishNode(node, "TSTypePredicate"); - } else { - this.resetStartLocationFromNode(thisTypePredicate, node); - thisTypePredicate.asserts = true; - } - - t.typeAnnotation = thisTypePredicate; - return this.finishNode(t, "TSTypeAnnotation"); - } - - const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); - - if (!typePredicateVariable) { - if (!asserts) { - return this.tsParseTypeAnnotation(false, t); - } - - node.parameterName = this.parseIdentifier(); - node.asserts = asserts; - node.typeAnnotation = null; - t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TSTypeAnnotation"); - } - - const type = this.tsParseTypeAnnotation(false); - node.parameterName = typePredicateVariable; - node.typeAnnotation = type; - node.asserts = asserts; - t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TSTypeAnnotation"); - }); - } - - tsTryParseTypeOrTypePredicateAnnotation() { - return this.match(22) ? this.tsParseTypeOrTypePredicateAnnotation(22) : undefined; - } - - tsTryParseTypeAnnotation() { - return this.match(22) ? this.tsParseTypeAnnotation() : undefined; - } - - tsTryParseType() { - return this.tsEatThenParseType(22); - } - - tsParseTypePredicatePrefix() { - const id = this.parseIdentifier(); - - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - this.next(); - return id; - } - } - - tsParseTypePredicateAsserts() { - if (!this.match(5) || this.state.value !== "asserts") { - return false; - } - - const containsEsc = this.state.containsEsc; - this.next(); - - if (!this.match(5) && !this.match(77)) { - return false; - } - - if (containsEsc) { - this.raise(this.state.lastTokStart, ErrorMessages.InvalidEscapedReservedWord, "asserts"); - } - - return true; - } - - tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { - this.tsInType(() => { - if (eatColon) this.expect(22); - t.typeAnnotation = this.tsParseType(); - }); - return this.finishNode(t, "TSTypeAnnotation"); - } - - tsParseType() { - assert(this.state.inType); - const type = this.tsParseNonConditionalType(); - - if (this.hasPrecedingLineBreak() || !this.eat(80)) { - return type; - } - - const node = this.startNodeAtNode(type); - node.checkType = type; - node.extendsType = this.tsParseNonConditionalType(); - this.expect(25); - node.trueType = this.tsParseType(); - this.expect(22); - node.falseType = this.tsParseType(); - return this.finishNode(node, "TSConditionalType"); - } - - isAbstractConstructorSignature() { - return this.isContextual("abstract") && this.lookahead().type === 76; - } - - tsParseNonConditionalType() { - if (this.tsIsStartOfFunctionType()) { - return this.tsParseFunctionOrConstructorType("TSFunctionType"); - } - - if (this.match(76)) { - return this.tsParseFunctionOrConstructorType("TSConstructorType"); - } else if (this.isAbstractConstructorSignature()) { - return this.tsParseFunctionOrConstructorType("TSConstructorType", true); - } - - return this.tsParseUnionTypeOrHigher(); - } - - tsParseTypeAssertion() { - const node = this.startNode(); - - const _const = this.tsTryNextParseConstantContext(); - - node.typeAnnotation = _const || this.tsNextThenParseType(); - this.expectRelational(">"); - node.expression = this.parseMaybeUnary(); - return this.finishNode(node, "TSTypeAssertion"); - } - - tsParseHeritageClause(descriptor) { - const originalStart = this.state.start; - const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this)); - - if (!delimitedList.length) { - this.raise(originalStart, TSErrors.EmptyHeritageClauseType, descriptor); - } - - return delimitedList; - } - - tsParseExpressionWithTypeArguments() { - const node = this.startNode(); - node.expression = this.tsParseEntityName(false); - - if (this.isRelational("<")) { - node.typeParameters = this.tsParseTypeArguments(); - } - - return this.finishNode(node, "TSExpressionWithTypeArguments"); - } - - tsParseInterfaceDeclaration(node) { - if (this.match(5)) { - node.id = this.parseIdentifier(); - this.checkLVal(node.id, "typescript interface declaration", BIND_TS_INTERFACE); - } else { - node.id = null; - this.raise(this.state.start, TSErrors.MissingInterfaceName); - } - - node.typeParameters = this.tsTryParseTypeParameters(); - - if (this.eat(80)) { - node.extends = this.tsParseHeritageClause("extends"); - } - - const body = this.startNode(); - body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); - node.body = this.finishNode(body, "TSInterfaceBody"); - return this.finishNode(node, "TSInterfaceDeclaration"); - } - - tsParseTypeAliasDeclaration(node) { - node.id = this.parseIdentifier(); - this.checkLVal(node.id, "typescript type alias", BIND_TS_TYPE); - node.typeParameters = this.tsTryParseTypeParameters(); - node.typeAnnotation = this.tsInType(() => { - this.expect(35); - - if (this.isContextual("intrinsic") && this.lookahead().type !== 24) { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "TSIntrinsicKeyword"); - } - - return this.tsParseType(); - }); - this.semicolon(); - return this.finishNode(node, "TSTypeAliasDeclaration"); - } - - tsInNoContext(cb) { - const oldContext = this.state.context; - this.state.context = [oldContext[0]]; - - try { - return cb(); - } finally { - this.state.context = oldContext; - } - } - - tsInType(cb) { - const oldInType = this.state.inType; - this.state.inType = true; - - try { - return cb(); - } finally { - this.state.inType = oldInType; - } - } - - tsEatThenParseType(token) { - return !this.match(token) ? undefined : this.tsNextThenParseType(); - } - - tsExpectThenParseType(token) { - return this.tsDoThenParseType(() => this.expect(token)); - } - - tsNextThenParseType() { - return this.tsDoThenParseType(() => this.next()); - } - - tsDoThenParseType(cb) { - return this.tsInType(() => { - cb(); - return this.tsParseType(); - }); - } - - tsParseEnumMember() { - const node = this.startNode(); - node.id = this.match(4) ? this.parseExprAtom() : this.parseIdentifier(true); - - if (this.eat(35)) { - node.initializer = this.parseMaybeAssignAllowIn(); - } - - return this.finishNode(node, "TSEnumMember"); - } - - tsParseEnumDeclaration(node, isConst) { - if (isConst) node.const = true; - node.id = this.parseIdentifier(); - this.checkLVal(node.id, "typescript enum declaration", isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM); - this.expect(13); - node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); - this.expect(16); - return this.finishNode(node, "TSEnumDeclaration"); - } - - tsParseModuleBlock() { - const node = this.startNode(); - this.scope.enter(SCOPE_OTHER); - this.expect(13); - this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 16); - this.scope.exit(); - return this.finishNode(node, "TSModuleBlock"); - } - - tsParseModuleOrNamespaceDeclaration(node, nested = false) { - node.id = this.parseIdentifier(); - - if (!nested) { - this.checkLVal(node.id, "module or namespace declaration", BIND_TS_NAMESPACE); - } - - if (this.eat(24)) { - const inner = this.startNode(); - this.tsParseModuleOrNamespaceDeclaration(inner, true); - node.body = inner; - } else { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); - node.body = this.tsParseModuleBlock(); - this.prodParam.exit(); - this.scope.exit(); - } - - return this.finishNode(node, "TSModuleDeclaration"); - } - - tsParseAmbientExternalModuleDeclaration(node) { - if (this.isContextual("global")) { - node.global = true; - node.id = this.parseIdentifier(); - } else if (this.match(4)) { - node.id = this.parseExprAtom(); - } else { - this.unexpected(); - } - - if (this.match(13)) { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); - node.body = this.tsParseModuleBlock(); - this.prodParam.exit(); - this.scope.exit(); - } else { - this.semicolon(); - } - - return this.finishNode(node, "TSModuleDeclaration"); - } - - tsParseImportEqualsDeclaration(node, isExport) { - node.isExport = isExport || false; - node.id = this.parseIdentifier(); - this.checkLVal(node.id, "import equals declaration", BIND_LEXICAL); - this.expect(35); - const moduleReference = this.tsParseModuleReference(); - - if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { - this.raise(moduleReference.start, TSErrors.ImportAliasHasImportType); - } - - node.moduleReference = moduleReference; - this.semicolon(); - return this.finishNode(node, "TSImportEqualsDeclaration"); - } - - tsIsExternalModuleReference() { - return this.isContextual("require") && this.lookaheadCharCode() === 40; - } - - tsParseModuleReference() { - return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); - } - - tsParseExternalModuleReference() { - const node = this.startNode(); - this.expectContextual("require"); - this.expect(18); - - if (!this.match(4)) { - throw this.unexpected(); - } - - node.expression = this.parseExprAtom(); - this.expect(19); - return this.finishNode(node, "TSExternalModuleReference"); - } - - tsLookAhead(f) { - const state = this.state.clone(); - const res = f(); - this.state = state; - return res; - } - - tsTryParseAndCatch(f) { - const result = this.tryParse(abort => f() || abort()); - if (result.aborted || !result.node) return undefined; - if (result.error) this.state = result.failState; - return result.node; - } - - tsTryParse(f) { - const state = this.state.clone(); - const result = f(); - - if (result !== undefined && result !== false) { - return result; - } else { - this.state = state; - return undefined; - } - } - - tsTryParseDeclare(nany) { - if (this.isLineTerminator()) { - return; - } - - let starttype = this.state.type; - let kind; - - if (this.isContextual("let")) { - starttype = 73; - kind = "let"; - } - - return this.tsInAmbientContext(() => { - switch (starttype) { - case 67: - nany.declare = true; - return this.parseFunctionStatement(nany, false, true); - - case 79: - nany.declare = true; - return this.parseClass(nany, true, false); - - case 74: - if (this.match(74) && this.isLookaheadContextual("enum")) { - this.expect(74); - this.expectContextual("enum"); - return this.tsParseEnumDeclaration(nany, true); - } - - case 73: - kind = kind || this.state.value; - return this.parseVarStatement(nany, kind); - - case 5: - { - const value = this.state.value; - - if (value === "global") { - return this.tsParseAmbientExternalModuleDeclaration(nany); - } else { - return this.tsParseDeclaration(nany, value, true); - } - } - } - }); - } - - tsTryParseExportDeclaration() { - return this.tsParseDeclaration(this.startNode(), this.state.value, true); - } - - tsParseExpressionStatement(node, expr) { - switch (expr.name) { - case "declare": - { - const declaration = this.tsTryParseDeclare(node); - - if (declaration) { - declaration.declare = true; - return declaration; - } - - break; - } - - case "global": - if (this.match(13)) { - this.scope.enter(SCOPE_TS_MODULE); - this.prodParam.enter(PARAM); - const mod = node; - mod.global = true; - mod.id = expr; - mod.body = this.tsParseModuleBlock(); - this.scope.exit(); - this.prodParam.exit(); - return this.finishNode(mod, "TSModuleDeclaration"); - } - - break; - - default: - return this.tsParseDeclaration(node, expr.name, false); - } - } - - tsParseDeclaration(node, value, next) { - switch (value) { - case "abstract": - if (this.tsCheckLineTerminator(next) && (this.match(79) || this.match(5))) { - return this.tsParseAbstractDeclaration(node); - } - - break; - - case "enum": - if (next || this.match(5)) { - if (next) this.next(); - return this.tsParseEnumDeclaration(node, false); - } - - break; - - case "interface": - if (this.tsCheckLineTerminator(next) && this.match(5)) { - return this.tsParseInterfaceDeclaration(node); - } - - break; - - case "module": - if (this.tsCheckLineTerminator(next)) { - if (this.match(4)) { - return this.tsParseAmbientExternalModuleDeclaration(node); - } else if (this.match(5)) { - return this.tsParseModuleOrNamespaceDeclaration(node); - } - } - - break; - - case "namespace": - if (this.tsCheckLineTerminator(next) && this.match(5)) { - return this.tsParseModuleOrNamespaceDeclaration(node); - } - - break; - - case "type": - if (this.tsCheckLineTerminator(next) && this.match(5)) { - return this.tsParseTypeAliasDeclaration(node); - } - - break; - } - } - - tsCheckLineTerminator(next) { - if (next) { - if (this.hasFollowingLineBreak()) return false; - this.next(); - return true; - } - - return !this.isLineTerminator(); - } - - tsTryParseGenericAsyncArrowFunction(startPos, startLoc) { - if (!this.isRelational("<")) { - return undefined; - } - - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - this.state.maybeInArrowParameters = true; - const res = this.tsTryParseAndCatch(() => { - const node = this.startNodeAt(startPos, startLoc); - node.typeParameters = this.tsParseTypeParameters(); - super.parseFunctionParams(node); - node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); - this.expect(27); - return node; - }); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - - if (!res) { - return undefined; - } - - return this.parseArrowExpression(res, null, true); - } - - tsParseTypeArguments() { - const node = this.startNode(); - node.params = this.tsInType(() => this.tsInNoContext(() => { - this.expectRelational("<"); - return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); - })); - - if (node.params.length === 0) { - this.raise(node.start, TSErrors.EmptyTypeArguments); - } - - this.expectRelational(">"); - return this.finishNode(node, "TSTypeParameterInstantiation"); - } - - tsIsDeclarationStart() { - if (this.match(5)) { - switch (this.state.value) { - case "abstract": - case "declare": - case "enum": - case "interface": - case "module": - case "namespace": - case "type": - return true; - } - } - - return false; - } - - isExportDefaultSpecifier() { - if (this.tsIsDeclarationStart()) return false; - return super.isExportDefaultSpecifier(); - } - - parseAssignableListItem(allowModifiers, decorators) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let accessibility; - let readonly = false; - let override = false; - - if (allowModifiers !== undefined) { - const modified = {}; - this.tsParseModifiers(modified, ["public", "private", "protected", "override", "readonly"]); - accessibility = modified.accessibility; - override = modified.override; - readonly = modified.readonly; - - if (allowModifiers === false && (accessibility || readonly || override)) { - this.raise(startPos, TSErrors.UnexpectedParameterModifier); - } - } - - const left = this.parseMaybeDefault(); - this.parseAssignableListItemTypes(left); - const elt = this.parseMaybeDefault(left.start, left.loc.start, left); - - if (accessibility || readonly || override) { - const pp = this.startNodeAt(startPos, startLoc); - - if (decorators.length) { - pp.decorators = decorators; - } - - if (accessibility) pp.accessibility = accessibility; - if (readonly) pp.readonly = readonly; - if (override) pp.override = override; - - if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { - this.raise(pp.start, TSErrors.UnsupportedParameterPropertyKind); - } - - pp.parameter = elt; - return this.finishNode(pp, "TSParameterProperty"); - } - - if (decorators.length) { - left.decorators = decorators; - } - - return elt; - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(22)) { - node.returnType = this.tsParseTypeOrTypePredicateAnnotation(22); - } - - const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" ? "TSDeclareMethod" : undefined; - - if (bodilessType && !this.match(13) && this.isLineTerminator()) { - this.finishNode(node, bodilessType); - return; - } - - if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { - this.raise(node.start, TSErrors.DeclareFunctionHasImplementation); - - if (node.declare) { - super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); - return; - } - } - - super.parseFunctionBodyAndFinish(node, type, isMethod); - } - - registerFunctionStatementId(node) { - if (!node.body && node.id) { - this.checkLVal(node.id, "function name", BIND_TS_AMBIENT); - } else { - super.registerFunctionStatementId(...arguments); - } - } - - tsCheckForInvalidTypeCasts(items) { - items.forEach(node => { - if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { - this.raise(node.typeAnnotation.start, TSErrors.UnexpectedTypeAnnotation); - } - }); - } - - toReferencedList(exprList, isInParens) { - this.tsCheckForInvalidTypeCasts(exprList); - return exprList; - } - - parseArrayLike(...args) { - const node = super.parseArrayLike(...args); - - if (node.type === "ArrayExpression") { - this.tsCheckForInvalidTypeCasts(node.elements); - } - - return node; - } - - parseSubscript(base, startPos, startLoc, noCalls, state) { - if (!this.hasPrecedingLineBreak() && this.match(40)) { - this.state.exprAllowed = false; - this.next(); - const nonNullExpression = this.startNodeAt(startPos, startLoc); - nonNullExpression.expression = base; - return this.finishNode(nonNullExpression, "TSNonNullExpression"); - } - - let isOptionalCall = false; - - if (this.match(26) && this.lookaheadCharCode() === 60) { - if (noCalls) { - state.stop = true; - return base; - } - - state.optionalChainMember = isOptionalCall = true; - this.next(); - } - - if (this.isRelational("<")) { - let missingParenErrorPos; - const result = this.tsTryParseAndCatch(() => { - if (!noCalls && this.atPossibleAsyncArrow(base)) { - const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc); - - if (asyncArrowFn) { - return asyncArrowFn; - } - } - - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const typeArguments = this.tsParseTypeArguments(); - - if (typeArguments) { - if (isOptionalCall && !this.match(18)) { - missingParenErrorPos = this.state.pos; - this.unexpected(); - } - - if (!noCalls && this.eat(18)) { - node.arguments = this.parseCallExpressionArguments(19, false); - this.tsCheckForInvalidTypeCasts(node.arguments); - node.typeParameters = typeArguments; - - if (state.optionalChainMember) { - node.optional = isOptionalCall; - } - - return this.finishCallExpression(node, state.optionalChainMember); - } else if (this.match(30)) { - const result = this.parseTaggedTemplateExpression(base, startPos, startLoc, state); - result.typeParameters = typeArguments; - return result; - } - } - - this.unexpected(); - }); - - if (missingParenErrorPos) { - this.unexpected(missingParenErrorPos, 18); - } - - if (result) return result; - } - - return super.parseSubscript(base, startPos, startLoc, noCalls, state); - } - - parseNewArguments(node) { - if (this.isRelational("<")) { - const typeParameters = this.tsTryParseAndCatch(() => { - const args = this.tsParseTypeArguments(); - if (!this.match(18)) this.unexpected(); - return args; - }); - - if (typeParameters) { - node.typeParameters = typeParameters; - } - } - - super.parseNewArguments(node); - } - - parseExprOp(left, leftStartPos, leftStartLoc, minPrec) { - if (tokenOperatorPrecedence(57) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual("as")) { - const node = this.startNodeAt(leftStartPos, leftStartLoc); - node.expression = left; - - const _const = this.tsTryNextParseConstantContext(); - - if (_const) { - node.typeAnnotation = _const; - } else { - node.typeAnnotation = this.tsNextThenParseType(); - } - - this.finishNode(node, "TSAsExpression"); - this.reScan_lt_gt(); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec); - } - - return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec); - } - - checkReservedWord(word, startLoc, checkKeywords, isBinding) {} - - checkDuplicateExports() {} - - parseImport(node) { - node.importKind = "value"; - - if (this.match(5) || this.match(54) || this.match(13)) { - let ahead = this.lookahead(); - - if (this.isContextual("type") && ahead.type !== 20 && !(ahead.type === 5 && ahead.value === "from") && ahead.type !== 35) { - node.importKind = "type"; - this.next(); - ahead = this.lookahead(); - } - - if (this.match(5) && ahead.type === 35) { - return this.tsParseImportEqualsDeclaration(node); - } - } - - const importNode = super.parseImport(node); - - if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { - this.raise(importNode.start, TSErrors.TypeImportCannotSpecifyDefaultAndNamed); - } - - return importNode; - } - - parseExport(node) { - if (this.match(82)) { - this.next(); - - if (this.isContextual("type") && this.lookaheadCharCode() !== 61) { - node.importKind = "type"; - this.next(); - } else { - node.importKind = "value"; - } - - return this.tsParseImportEqualsDeclaration(node, true); - } else if (this.eat(35)) { - const assign = node; - assign.expression = this.parseExpression(); - this.semicolon(); - return this.finishNode(assign, "TSExportAssignment"); - } else if (this.eatContextual("as")) { - const decl = node; - this.expectContextual("namespace"); - decl.id = this.parseIdentifier(); - this.semicolon(); - return this.finishNode(decl, "TSNamespaceExportDeclaration"); - } else { - if (this.isContextual("type") && this.lookahead().type === 13) { - this.next(); - node.exportKind = "type"; - } else { - node.exportKind = "value"; - } - - return super.parseExport(node); - } - } - - isAbstractClass() { - return this.isContextual("abstract") && this.lookahead().type === 79; - } - - parseExportDefaultExpression() { - if (this.isAbstractClass()) { - const cls = this.startNode(); - this.next(); - cls.abstract = true; - this.parseClass(cls, true, true); - return cls; - } - - if (this.state.value === "interface") { - const interfaceNode = this.startNode(); - this.next(); - const result = this.tsParseInterfaceDeclaration(interfaceNode); - if (result) return result; - } - - return super.parseExportDefaultExpression(); - } - - parseStatementContent(context, topLevel) { - if (this.state.type === 74) { - const ahead = this.lookahead(); - - if (ahead.type === 5 && ahead.value === "enum") { - const node = this.startNode(); - this.expect(74); - this.expectContextual("enum"); - return this.tsParseEnumDeclaration(node, true); - } - } - - return super.parseStatementContent(context, topLevel); - } - - parseAccessModifier() { - return this.tsParseModifier(["public", "protected", "private"]); - } - - tsHasSomeModifiers(member, modifiers) { - return modifiers.some(modifier => { - if (tsIsAccessModifier(modifier)) { - return member.accessibility === modifier; - } - - return !!member[modifier]; - }); - } - - tsIsStartOfStaticBlocks() { - return this.isContextual("static") && this.lookaheadCharCode() === 123; - } - - parseClassMember(classBody, member, state) { - const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; - this.tsParseModifiers(member, modifiers, undefined, undefined, true); - - const callParseClassMemberWithIsStatic = () => { - if (this.tsIsStartOfStaticBlocks()) { - this.next(); - this.next(); - - if (this.tsHasSomeModifiers(member, modifiers)) { - this.raise(this.state.pos, TSErrors.StaticBlockCannotHaveModifier); - } - - this.parseClassStaticBlock(classBody, member); - } else { - this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); - } - }; - - if (member.declare) { - this.tsInAmbientContext(callParseClassMemberWithIsStatic); - } else { - callParseClassMemberWithIsStatic(); - } - } - - parseClassMemberWithIsStatic(classBody, member, state, isStatic) { - const idx = this.tsTryParseIndexSignature(member); - - if (idx) { - classBody.body.push(idx); - - if (member.abstract) { - this.raise(member.start, TSErrors.IndexSignatureHasAbstract); - } - - if (member.accessibility) { - this.raise(member.start, TSErrors.IndexSignatureHasAccessibility, member.accessibility); - } - - if (member.declare) { - this.raise(member.start, TSErrors.IndexSignatureHasDeclare); - } - - if (member.override) { - this.raise(member.start, TSErrors.IndexSignatureHasOverride); - } - - return; - } - - if (!this.state.inAbstractClass && member.abstract) { - this.raise(member.start, TSErrors.NonAbstractClassHasAbstractMethod); - } - - if (member.override) { - if (!state.hadSuperClass) { - this.raise(member.start, TSErrors.OverrideNotInSubClass); - } - } - - super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); - } - - parsePostMemberNameModifiers(methodOrProp) { - const optional = this.eat(25); - if (optional) methodOrProp.optional = true; - - if (methodOrProp.readonly && this.match(18)) { - this.raise(methodOrProp.start, TSErrors.ClassMethodHasReadonly); - } - - if (methodOrProp.declare && this.match(18)) { - this.raise(methodOrProp.start, TSErrors.ClassMethodHasDeclare); - } - } - - parseExpressionStatement(node, expr) { - const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined; - return decl || super.parseExpressionStatement(node, expr); - } - - shouldParseExportDeclaration() { - if (this.tsIsDeclarationStart()) return true; - return super.shouldParseExportDeclaration(); - } - - parseConditional(expr, startPos, startLoc, refExpressionErrors) { - if (!this.state.maybeInArrowParameters || !this.match(25)) { - return super.parseConditional(expr, startPos, startLoc, refExpressionErrors); - } - - const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc)); - - if (!result.node) { - if (result.error) { - super.setOptionalParametersError(refExpressionErrors, result.error); - } - - return expr; - } - - if (result.error) this.state = result.failState; - return result.node; - } - - parseParenItem(node, startPos, startLoc) { - node = super.parseParenItem(node, startPos, startLoc); - - if (this.eat(25)) { - node.optional = true; - this.resetEndLocation(node); - } - - if (this.match(22)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TSTypeCastExpression"); - } - - return node; - } - - parseExportDeclaration(node) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const isDeclare = this.eatContextual("declare"); - - if (isDeclare && (this.isContextual("declare") || !this.shouldParseExportDeclaration())) { - throw this.raise(this.state.start, TSErrors.ExpectedAmbientAfterExportDeclare); - } - - let declaration; - - if (this.match(5)) { - declaration = this.tsTryParseExportDeclaration(); - } - - if (!declaration) { - declaration = super.parseExportDeclaration(node); - } - - if (declaration && (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare)) { - node.exportKind = "type"; - } - - if (declaration && isDeclare) { - this.resetStartLocation(declaration, startPos, startLoc); - declaration.declare = true; - } - - return declaration; - } - - parseClassId(node, isStatement, optionalId) { - if ((!isStatement || optionalId) && this.isContextual("implements")) { - return; - } - - super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS); - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) node.typeParameters = typeParameters; - } - - parseClassPropertyAnnotation(node) { - if (!node.optional && this.eat(40)) { - node.definite = true; - } - - const type = this.tsTryParseTypeAnnotation(); - if (type) node.typeAnnotation = type; - } - - parseClassProperty(node) { - this.parseClassPropertyAnnotation(node); - - if (this.state.isAmbientContext && this.match(35)) { - this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer); - } - - if (node.abstract && this.match(35)) { - const { - key - } = node; - this.raise(this.state.start, TSErrors.AbstractPropertyHasInitializer, key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`); - } - - return super.parseClassProperty(node); - } - - parseClassPrivateProperty(node) { - if (node.abstract) { - this.raise(node.start, TSErrors.PrivateElementHasAbstract); - } - - if (node.accessibility) { - this.raise(node.start, TSErrors.PrivateElementHasAccessibility, node.accessibility); - } - - this.parseClassPropertyAnnotation(node); - return super.parseClassPrivateProperty(node); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - const typeParameters = this.tsTryParseTypeParameters(); - - if (typeParameters && isConstructor) { - this.raise(typeParameters.start, TSErrors.ConstructorHasTypeParameters); - } - - if (method.declare && (method.kind === "get" || method.kind === "set")) { - this.raise(method.start, TSErrors.DeclareAccessor, method.kind); - } - - if (typeParameters) method.typeParameters = typeParameters; - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) method.typeParameters = typeParameters; - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - - parseClassSuper(node) { - super.parseClassSuper(node); - - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.tsParseTypeArguments(); - } - - if (this.eatContextual("implements")) { - node.implements = this.tsParseHeritageClause("implements"); - } - } - - parseObjPropValue(prop, ...args) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) prop.typeParameters = typeParameters; - super.parseObjPropValue(prop, ...args); - } - - parseFunctionParams(node, allowModifiers) { - const typeParameters = this.tsTryParseTypeParameters(); - if (typeParameters) node.typeParameters = typeParameters; - super.parseFunctionParams(node, allowModifiers); - } - - parseVarId(decl, kind) { - super.parseVarId(decl, kind); - - if (decl.id.type === "Identifier" && this.eat(40)) { - decl.definite = true; - } - - const type = this.tsTryParseTypeAnnotation(); - - if (type) { - decl.id.typeAnnotation = type; - this.resetEndLocation(decl.id); - } - } - - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(22)) { - node.returnType = this.tsParseTypeAnnotation(); - } - - return super.parseAsyncArrowFromCallExpression(node, call); - } - - parseMaybeAssign(...args) { - var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3; - - let state; - let jsx; - let typeCast; - - if (this.hasPlugin("jsx") && (this.match(94) || this.isRelational("<"))) { - state = this.state.clone(); - jsx = this.tryParse(() => super.parseMaybeAssign(...args), state); - if (!jsx.error) return jsx.node; - const { - context - } = this.state; - - if (context[context.length - 1] === types.j_oTag) { - context.length -= 2; - } else if (context[context.length - 1] === types.j_expr) { - context.length -= 1; - } - } - - if (!((_jsx = jsx) != null && _jsx.error) && !this.isRelational("<")) { - return super.parseMaybeAssign(...args); - } - - let typeParameters; - state = state || this.state.clone(); - const arrow = this.tryParse(abort => { - var _expr$extra, _typeParameters; - - typeParameters = this.tsParseTypeParameters(); - const expr = super.parseMaybeAssign(...args); - - if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { - abort(); - } - - if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { - this.resetStartLocationFromNode(expr, typeParameters); - } - - expr.typeParameters = typeParameters; - return expr; - }, state); - if (!arrow.error && !arrow.aborted) return arrow.node; - - if (!jsx) { - assert(!this.hasPlugin("jsx")); - typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state); - if (!typeCast.error) return typeCast.node; - } - - if ((_jsx2 = jsx) != null && _jsx2.node) { - this.state = jsx.failState; - return jsx.node; - } - - if (arrow.node) { - this.state = arrow.failState; - return arrow.node; - } - - if ((_typeCast = typeCast) != null && _typeCast.node) { - this.state = typeCast.failState; - return typeCast.node; - } - - if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - if ((_typeCast2 = typeCast) != null && _typeCast2.thrown) throw typeCast.error; - throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error); - } - - parseMaybeUnary(refExpressionErrors) { - if (!this.hasPlugin("jsx") && this.isRelational("<")) { - return this.tsParseTypeAssertion(); - } else { - return super.parseMaybeUnary(refExpressionErrors); - } - } - - parseArrow(node) { - if (this.match(22)) { - const result = this.tryParse(abort => { - const returnType = this.tsParseTypeOrTypePredicateAnnotation(22); - if (this.canInsertSemicolon() || !this.match(27)) abort(); - return returnType; - }); - if (result.aborted) return; - - if (!result.thrown) { - if (result.error) this.state = result.failState; - node.returnType = result.node; - } - } - - return super.parseArrow(node); - } - - parseAssignableListItemTypes(param) { - if (this.eat(25)) { - if (param.type !== "Identifier" && !this.state.isAmbientContext && !this.state.inType) { - this.raise(param.start, TSErrors.PatternIsOptional); - } - - param.optional = true; - } - - const type = this.tsTryParseTypeAnnotation(); - if (type) param.typeAnnotation = type; - this.resetEndLocation(param); - return param; - } - - isAssignable(node, isBinding) { - switch (node.type) { - case "TSTypeCastExpression": - return this.isAssignable(node.expression, isBinding); - - case "TSParameterProperty": - return true; - - default: - return super.isAssignable(node, isBinding); - } - } - - toAssignable(node, isLHS = false) { - switch (node.type) { - case "TSTypeCastExpression": - return super.toAssignable(this.typeCastToParameter(node), isLHS); - - case "TSParameterProperty": - return super.toAssignable(node, isLHS); - - case "ParenthesizedExpression": - return this.toAssignableParenthesizedExpression(node, isLHS); - - case "TSAsExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - node.expression = this.toAssignable(node.expression, isLHS); - return node; - - default: - return super.toAssignable(node, isLHS); - } - } - - toAssignableParenthesizedExpression(node, isLHS) { - switch (node.expression.type) { - case "TSAsExpression": - case "TSNonNullExpression": - case "TSTypeAssertion": - case "ParenthesizedExpression": - node.expression = this.toAssignable(node.expression, isLHS); - return node; - - default: - return super.toAssignable(node, isLHS); - } - } - - checkLVal(expr, contextDescription, ...args) { - var _expr$extra2; - - switch (expr.type) { - case "TSTypeCastExpression": - return; - - case "TSParameterProperty": - this.checkLVal(expr.parameter, "parameter property", ...args); - return; - - case "TSAsExpression": - case "TSTypeAssertion": - if (!args[0] && contextDescription !== "parenthesized expression" && !((_expr$extra2 = expr.extra) != null && _expr$extra2.parenthesized)) { - this.raise(expr.start, ErrorMessages.InvalidLhs, contextDescription); - break; - } - - this.checkLVal(expr.expression, "parenthesized expression", ...args); - return; - - case "TSNonNullExpression": - this.checkLVal(expr.expression, contextDescription, ...args); - return; - - default: - super.checkLVal(expr, contextDescription, ...args); - return; - } - } - - parseBindingAtom() { - switch (this.state.type) { - case 77: - return this.parseIdentifier(true); - - default: - return super.parseBindingAtom(); - } - } - - parseMaybeDecoratorArguments(expr) { - if (this.isRelational("<")) { - const typeArguments = this.tsParseTypeArguments(); - - if (this.match(18)) { - const call = super.parseMaybeDecoratorArguments(expr); - call.typeParameters = typeArguments; - return call; - } - - this.unexpected(this.state.start, 18); - } - - return super.parseMaybeDecoratorArguments(expr); - } - - checkCommaAfterRest(close) { - if (this.state.isAmbientContext && this.match(20) && this.lookaheadCharCode() === close) { - this.next(); - } else { - super.checkCommaAfterRest(close); - } - } - - isClassMethod() { - return this.isRelational("<") || super.isClassMethod(); - } - - isClassProperty() { - return this.match(40) || this.match(22) || super.isClassProperty(); - } - - parseMaybeDefault(...args) { - const node = super.parseMaybeDefault(...args); - - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, TSErrors.TypeAnnotationAfterAssign); - } - - return node; - } - - getTokenFromCode(code) { - if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(50, 1); - } else { - return super.getTokenFromCode(code); - } - } - - reScan_lt_gt() { - if (this.match(50)) { - const code = this.input.charCodeAt(this.state.start); - - if (code === 60 || code === 62) { - this.state.pos -= 1; - this.readToken_lt_gt(code); - } - } - } - - toAssignableList(exprList) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - if (!expr) continue; - - switch (expr.type) { - case "TSTypeCastExpression": - exprList[i] = this.typeCastToParameter(expr); - break; - - case "TSAsExpression": - case "TSTypeAssertion": - if (!this.state.maybeInArrowParameters) { - exprList[i] = this.typeCastToParameter(expr); - } else { - this.raise(expr.start, TSErrors.UnexpectedTypeCastInParameter); - } - - break; - } - } - - return super.toAssignableList(...arguments); - } - - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); - return node.expression; - } - - shouldParseArrow(params) { - if (this.match(22)) { - return params.every(expr => this.isAssignable(expr, true)); - } - - return super.shouldParseArrow(params); - } - - shouldParseAsyncArrow() { - return this.match(22) || super.shouldParseAsyncArrow(); - } - - canHaveLeadingDecorator() { - return super.canHaveLeadingDecorator() || this.isAbstractClass(); - } - - jsxParseOpeningElementAfterName(node) { - if (this.isRelational("<")) { - const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArguments()); - if (typeArguments) node.typeParameters = typeArguments; - } - - return super.jsxParseOpeningElementAfterName(node); - } - - getGetterSetterExpectedParamCount(method) { - const baseCount = super.getGetterSetterExpectedParamCount(method); - const params = this.getObjectOrClassMethodParams(method); - const firstParam = params[0]; - const hasContextParam = firstParam && this.isThisParam(firstParam); - return hasContextParam ? baseCount + 1 : baseCount; - } - - parseCatchClauseParam() { - const param = super.parseCatchClauseParam(); - const type = this.tsTryParseTypeAnnotation(); - - if (type) { - param.typeAnnotation = type; - this.resetEndLocation(param); - } - - return param; - } - - tsInAmbientContext(cb) { - const oldIsAmbientContext = this.state.isAmbientContext; - this.state.isAmbientContext = true; - - try { - return cb(); - } finally { - this.state.isAmbientContext = oldIsAmbientContext; - } - } - - parseClass(node, ...args) { - const oldInAbstractClass = this.state.inAbstractClass; - this.state.inAbstractClass = !!node.abstract; - - try { - return super.parseClass(node, ...args); - } finally { - this.state.inAbstractClass = oldInAbstractClass; - } - } - - tsParseAbstractDeclaration(node) { - if (this.match(79)) { - node.abstract = true; - return this.parseClass(node, true, false); - } else if (this.isContextual("interface")) { - if (!this.hasFollowingLineBreak()) { - node.abstract = true; - this.raise(node.start, TSErrors.NonClassMethodPropertyHasAbstractModifer); - this.next(); - return this.tsParseInterfaceDeclaration(node); - } - } else { - this.unexpected(null, 79); - } - } - - parseMethod(...args) { - const method = super.parseMethod(...args); - - if (method.abstract) { - const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body; - - if (hasBody) { - const { - key - } = method; - this.raise(method.start, TSErrors.AbstractMethodHasImplementation, key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]`); - } - } - - return method; - } - - tsParseTypeParameterName() { - const typeName = this.parseIdentifier(); - return typeName.name; - } - - shouldParseAsAmbientContext() { - return !!this.getPluginOption("typescript", "dts"); - } - - parse() { - if (this.shouldParseAsAmbientContext()) { - this.state.isAmbientContext = true; - } - - return super.parse(); - } - - getExpression() { - if (this.shouldParseAsAmbientContext()) { - this.state.isAmbientContext = true; - } - - return super.getExpression(); - } - -}); - -const PlaceHolderErrors = makeErrorTemplates({ - ClassNameIsRequired: "A class name is required." -}, ErrorCodes.SyntaxError); -var placeholders = (superClass => class extends superClass { - parsePlaceholder(expectedNode) { - if (this.match(96)) { - const node = this.startNode(); - this.next(); - this.assertNoSpace("Unexpected space in placeholder."); - node.name = super.parseIdentifier(true); - this.assertNoSpace("Unexpected space in placeholder."); - this.expect(96); - return this.finishPlaceholder(node, expectedNode); - } - } - - finishPlaceholder(node, expectedNode) { - const isFinished = !!(node.expectedNode && node.type === "Placeholder"); - node.expectedNode = expectedNode; - return isFinished ? node : this.finishNode(node, "Placeholder"); - } - - getTokenFromCode(code) { - if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { - return this.finishOp(96, 2); - } - - return super.getTokenFromCode(...arguments); - } - - parseExprAtom() { - return this.parsePlaceholder("Expression") || super.parseExprAtom(...arguments); - } - - parseIdentifier() { - return this.parsePlaceholder("Identifier") || super.parseIdentifier(...arguments); - } - - checkReservedWord(word) { - if (word !== undefined) super.checkReservedWord(...arguments); - } - - parseBindingAtom() { - return this.parsePlaceholder("Pattern") || super.parseBindingAtom(...arguments); - } - - checkLVal(expr) { - if (expr.type !== "Placeholder") super.checkLVal(...arguments); - } - - toAssignable(node) { - if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { - node.expectedNode = "Pattern"; - return node; - } - - return super.toAssignable(...arguments); - } - - isLet(context) { - if (super.isLet(context)) { - return true; - } - - if (!this.isContextual("let")) { - return false; - } - - if (context) return false; - const nextToken = this.lookahead(); - - if (nextToken.type === 96) { - return true; - } - - return false; - } - - verifyBreakContinue(node) { - if (node.label && node.label.type === "Placeholder") return; - super.verifyBreakContinue(...arguments); - } - - parseExpressionStatement(node, expr) { - if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) { - return super.parseExpressionStatement(...arguments); - } - - if (this.match(22)) { - const stmt = node; - stmt.label = this.finishPlaceholder(expr, "Identifier"); - this.next(); - stmt.body = this.parseStatement("label"); - return this.finishNode(stmt, "LabeledStatement"); - } - - this.semicolon(); - node.name = expr.name; - return this.finishPlaceholder(node, "Statement"); - } - - parseBlock() { - return this.parsePlaceholder("BlockStatement") || super.parseBlock(...arguments); - } - - parseFunctionId() { - return this.parsePlaceholder("Identifier") || super.parseFunctionId(...arguments); - } - - parseClass(node, isStatement, optionalId) { - const type = isStatement ? "ClassDeclaration" : "ClassExpression"; - this.next(); - this.takeDecorators(node); - const oldStrict = this.state.strict; - const placeholder = this.parsePlaceholder("Identifier"); - - if (placeholder) { - if (this.match(80) || this.match(96) || this.match(13)) { - node.id = placeholder; - } else if (optionalId || !isStatement) { - node.id = null; - node.body = this.finishPlaceholder(placeholder, "ClassBody"); - return this.finishNode(node, type); - } else { - this.unexpected(null, PlaceHolderErrors.ClassNameIsRequired); - } - } else { - this.parseClassId(node, isStatement, optionalId); - } - - this.parseClassSuper(node); - node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass, oldStrict); - return this.finishNode(node, type); - } - - parseExport(node) { - const placeholder = this.parsePlaceholder("Identifier"); - if (!placeholder) return super.parseExport(...arguments); - - if (!this.isContextual("from") && !this.match(20)) { - node.specifiers = []; - node.source = null; - node.declaration = this.finishPlaceholder(placeholder, "Declaration"); - return this.finishNode(node, "ExportNamedDeclaration"); - } - - this.expectPlugin("exportDefaultFrom"); - const specifier = this.startNode(); - specifier.exported = placeholder; - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - return super.parseExport(node); - } - - isExportDefaultSpecifier() { - if (this.match(64)) { - const next = this.nextTokenStart(); - - if (this.isUnparsedContextual(next, "from")) { - if (this.input.startsWith(tokenLabelName(96), this.nextTokenStartSince(next + 4))) { - return true; - } - } - } - - return super.isExportDefaultSpecifier(); - } - - maybeParseExportDefaultSpecifier(node) { - if (node.specifiers && node.specifiers.length > 0) { - return true; - } - - return super.maybeParseExportDefaultSpecifier(...arguments); - } - - checkExport(node) { - const { - specifiers - } = node; - - if (specifiers != null && specifiers.length) { - node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); - } - - super.checkExport(node); - node.specifiers = specifiers; - } - - parseImport(node) { - const placeholder = this.parsePlaceholder("Identifier"); - if (!placeholder) return super.parseImport(...arguments); - node.specifiers = []; - - if (!this.isContextual("from") && !this.match(20)) { - node.source = this.finishPlaceholder(placeholder, "StringLiteral"); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - const specifier = this.startNodeAtNode(placeholder); - specifier.local = placeholder; - this.finishNode(specifier, "ImportDefaultSpecifier"); - node.specifiers.push(specifier); - - if (this.eat(20)) { - const hasStarImport = this.maybeParseStarImportSpecifier(node); - if (!hasStarImport) this.parseNamedImportSpecifiers(node); - } - - this.expectContextual("from"); - node.source = this.parseImportSource(); - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - parseImportSource() { - return this.parsePlaceholder("StringLiteral") || super.parseImportSource(...arguments); - } - -}); - -var v8intrinsic = (superClass => class extends superClass { - parseV8Intrinsic() { - if (this.match(53)) { - const v8IntrinsicStart = this.state.start; - const node = this.startNode(); - this.eat(53); - - if (this.match(5)) { - const name = this.parseIdentifierName(this.state.start); - const identifier = this.createIdentifier(node, name); - identifier.type = "V8IntrinsicIdentifier"; - - if (this.match(18)) { - return identifier; - } - } - - this.unexpected(v8IntrinsicStart); - } - } - - parseExprAtom() { - return this.parseV8Intrinsic() || super.parseExprAtom(...arguments); - } - -}); - -function hasPlugin(plugins, name) { - return plugins.some(plugin => { - if (Array.isArray(plugin)) { - return plugin[0] === name; - } else { - return plugin === name; - } - }); -} -function getPluginOption(plugins, name, option) { - const plugin = plugins.find(plugin => { - if (Array.isArray(plugin)) { - return plugin[0] === name; - } else { - return plugin === name; - } - }); - - if (plugin && Array.isArray(plugin)) { - return plugin[1][option]; - } - - return null; -} -const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; -const TOPIC_TOKENS = ["%", "#"]; -const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; -function validatePlugins(plugins) { - if (hasPlugin(plugins, "decorators")) { - if (hasPlugin(plugins, "decorators-legacy")) { - throw new Error("Cannot use the decorators and decorators-legacy plugin together"); - } - - const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport"); - - if (decoratorsBeforeExport == null) { - throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'."); - } else if (typeof decoratorsBeforeExport !== "boolean") { - throw new Error("'decoratorsBeforeExport' must be a boolean."); - } - } - - if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) { - throw new Error("Cannot combine flow and typescript plugins."); - } - - if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) { - throw new Error("Cannot combine placeholders and v8intrinsic plugins."); - } - - if (hasPlugin(plugins, "pipelineOperator")) { - const proposal = getPluginOption(plugins, "pipelineOperator", "proposal"); - - if (!PIPELINE_PROPOSALS.includes(proposal)) { - const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); - throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); - } - - const tupleSyntaxIsHash = hasPlugin(plugins, "recordAndTuple") && getPluginOption(plugins, "recordAndTuple", "syntaxType") === "hash"; - - if (proposal === "hack") { - if (hasPlugin(plugins, "placeholders")) { - throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); - } - - if (hasPlugin(plugins, "v8intrinsic")) { - throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); - } - - const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken"); - - if (!TOPIC_TOKENS.includes(topicToken)) { - const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); - throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); - } - - if (topicToken === "#" && tupleSyntaxIsHash) { - throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); - } - } else if (proposal === "smart" && tupleSyntaxIsHash) { - throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); - } - } - - if (hasPlugin(plugins, "moduleAttributes")) { - { - if (hasPlugin(plugins, "importAssertions")) { - throw new Error("Cannot combine importAssertions and moduleAttributes plugins."); - } - - const moduleAttributesVerionPluginOption = getPluginOption(plugins, "moduleAttributes", "version"); - - if (moduleAttributesVerionPluginOption !== "may-2020") { - throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); - } - } - } - - if (hasPlugin(plugins, "recordAndTuple") && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) { - throw new Error("'recordAndTuple' requires 'syntaxType' option whose value should be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); - } - - if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) { - const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); - error.missingPlugins = "doExpressions"; - throw error; - } -} -const mixinPlugins = { - estree, - jsx, - flow, - typescript, - v8intrinsic, - placeholders -}; -const mixinPluginNames = Object.keys(mixinPlugins); - -const defaultOptions = { - sourceType: "script", - sourceFilename: undefined, - startLine: 1, - allowAwaitOutsideFunction: false, - allowReturnOutsideFunction: false, - allowImportExportEverywhere: false, - allowSuperOutsideMethod: false, - allowUndeclaredExports: false, - plugins: [], - strictMode: null, - ranges: false, - tokens: false, - createParenthesizedExpressions: false, - errorRecovery: false, - attachComment: true -}; -function getOptions(opts) { - const options = {}; - - for (const key of Object.keys(defaultOptions)) { - options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; - } - - return options; -} - -const unwrapParenthesizedExpression = node => { - return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; -}; - -class LValParser extends NodeUtils { - toAssignable(node, isLHS = false) { - var _node$extra, _node$extra3; - - let parenthesized = undefined; - - if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { - parenthesized = unwrapParenthesizedExpression(node); - - if (isLHS) { - if (parenthesized.type === "Identifier") { - this.expressionScope.recordParenthesizedIdentifierError(node.start, ErrorMessages.InvalidParenthesizedAssignment); - } else if (parenthesized.type !== "MemberExpression") { - this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment); - } - } else { - this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment); - } - } - - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - case "RestElement": - break; - - case "ObjectExpression": - node.type = "ObjectPattern"; - - for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { - var _node$extra2; - - const prop = node.properties[i]; - const isLast = i === last; - this.toAssignableObjectExpressionProp(prop, isLast, isLHS); - - if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingComma) { - this.raiseRestNotLast(node.extra.trailingComma); - } - } - - break; - - case "ObjectProperty": - this.toAssignable(node.value, isLHS); - break; - - case "SpreadElement": - { - this.checkToRestConversion(node); - node.type = "RestElement"; - const arg = node.argument; - this.toAssignable(arg, isLHS); - break; - } - - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma, isLHS); - break; - - case "AssignmentExpression": - if (node.operator !== "=") { - this.raise(node.left.end, ErrorMessages.MissingEqInAssignment); - } - - node.type = "AssignmentPattern"; - delete node.operator; - this.toAssignable(node.left, isLHS); - break; - - case "ParenthesizedExpression": - this.toAssignable(parenthesized, isLHS); - break; - } - - return node; - } - - toAssignableObjectExpressionProp(prop, isLast, isLHS) { - if (prop.type === "ObjectMethod") { - const error = prop.kind === "get" || prop.kind === "set" ? ErrorMessages.PatternHasAccessor : ErrorMessages.PatternHasMethod; - this.raise(prop.key.start, error); - } else if (prop.type === "SpreadElement" && !isLast) { - this.raiseRestNotLast(prop.start); - } else { - this.toAssignable(prop, isLHS); - } - } - - toAssignableList(exprList, trailingCommaPos, isLHS) { - let end = exprList.length; - - if (end) { - const last = exprList[end - 1]; - - if ((last == null ? void 0 : last.type) === "RestElement") { - --end; - } else if ((last == null ? void 0 : last.type) === "SpreadElement") { - last.type = "RestElement"; - let arg = last.argument; - this.toAssignable(arg, isLHS); - arg = unwrapParenthesizedExpression(arg); - - if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") { - this.unexpected(arg.start); - } - - if (trailingCommaPos) { - this.raiseTrailingCommaAfterRest(trailingCommaPos); - } - - --end; - } - } - - for (let i = 0; i < end; i++) { - const elt = exprList[i]; - - if (elt) { - this.toAssignable(elt, isLHS); - - if (elt.type === "RestElement") { - this.raiseRestNotLast(elt.start); - } - } - } - - return exprList; - } - - isAssignable(node, isBinding) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - case "RestElement": - return true; - - case "ObjectExpression": - { - const last = node.properties.length - 1; - return node.properties.every((prop, i) => { - return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); - }); - } - - case "ObjectProperty": - return this.isAssignable(node.value); - - case "SpreadElement": - return this.isAssignable(node.argument); - - case "ArrayExpression": - return node.elements.every(element => element === null || this.isAssignable(element)); - - case "AssignmentExpression": - return node.operator === "="; - - case "ParenthesizedExpression": - return this.isAssignable(node.expression); - - case "MemberExpression": - case "OptionalMemberExpression": - return !isBinding; - - default: - return false; - } - } - - toReferencedList(exprList, isParenthesizedExpr) { - return exprList; - } - - toReferencedListDeep(exprList, isParenthesizedExpr) { - this.toReferencedList(exprList, isParenthesizedExpr); - - for (const expr of exprList) { - if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { - this.toReferencedListDeep(expr.elements); - } - } - } - - parseSpread(refExpressionErrors, refNeedsArrowPos) { - const node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined, refNeedsArrowPos); - return this.finishNode(node, "SpreadElement"); - } - - parseRestBinding() { - const node = this.startNode(); - this.next(); - node.argument = this.parseBindingAtom(); - return this.finishNode(node, "RestElement"); - } - - parseBindingAtom() { - switch (this.state.type) { - case 8: - { - const node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(11, 93, true); - return this.finishNode(node, "ArrayPattern"); - } - - case 13: - return this.parseObjectLike(16, true); - } - - return this.parseIdentifier(); - } - - parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) { - const elts = []; - let first = true; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(20); - } - - if (allowEmpty && this.match(20)) { - elts.push(null); - } else if (this.eat(close)) { - break; - } else if (this.match(29)) { - elts.push(this.parseAssignableListItemTypes(this.parseRestBinding())); - this.checkCommaAfterRest(closeCharCode); - this.expect(close); - break; - } else { - const decorators = []; - - if (this.match(32) && this.hasPlugin("decorators")) { - this.raise(this.state.start, ErrorMessages.UnsupportedParameterDecorator); - } - - while (this.match(32)) { - decorators.push(this.parseDecorator()); - } - - elts.push(this.parseAssignableListItem(allowModifiers, decorators)); - } - } - - return elts; - } - - parseAssignableListItem(allowModifiers, decorators) { - const left = this.parseMaybeDefault(); - this.parseAssignableListItemTypes(left); - const elt = this.parseMaybeDefault(left.start, left.loc.start, left); - - if (decorators.length) { - left.decorators = decorators; - } - - return elt; - } - - parseAssignableListItemTypes(param) { - return param; - } - - parseMaybeDefault(startPos, startLoc, left) { - var _startLoc, _startPos, _left; - - startLoc = (_startLoc = startLoc) != null ? _startLoc : this.state.startLoc; - startPos = (_startPos = startPos) != null ? _startPos : this.state.start; - left = (_left = left) != null ? _left : this.parseBindingAtom(); - if (!this.eat(35)) return left; - const node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssignAllowIn(); - return this.finishNode(node, "AssignmentPattern"); - } - - checkLVal(expr, contextDescription, bindingType = BIND_NONE, checkClashes, disallowLetBinding, strictModeChanged = false) { - switch (expr.type) { - case "Identifier": - { - const { - name - } = expr; - - if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(name, this.inModule) : isStrictBindOnlyReservedWord(name))) { - this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.StrictEvalArguments : ErrorMessages.StrictEvalArgumentsBinding, name); - } - - if (checkClashes) { - if (checkClashes.has(name)) { - this.raise(expr.start, ErrorMessages.ParamDupe); - } else { - checkClashes.add(name); - } - } - - if (disallowLetBinding && name === "let") { - this.raise(expr.start, ErrorMessages.LetInLexicalBinding); - } - - if (!(bindingType & BIND_NONE)) { - this.scope.declareName(name, bindingType, expr.start); - } - - break; - } - - case "MemberExpression": - if (bindingType !== BIND_NONE) { - this.raise(expr.start, ErrorMessages.InvalidPropertyBindingPattern); - } - - break; - - case "ObjectPattern": - for (let prop of expr.properties) { - if (this.isObjectProperty(prop)) prop = prop.value;else if (this.isObjectMethod(prop)) continue; - this.checkLVal(prop, "object destructuring pattern", bindingType, checkClashes, disallowLetBinding); - } - - break; - - case "ArrayPattern": - for (const elem of expr.elements) { - if (elem) { - this.checkLVal(elem, "array destructuring pattern", bindingType, checkClashes, disallowLetBinding); - } - } - - break; - - case "AssignmentPattern": - this.checkLVal(expr.left, "assignment pattern", bindingType, checkClashes); - break; - - case "RestElement": - this.checkLVal(expr.argument, "rest element", bindingType, checkClashes); - break; - - case "ParenthesizedExpression": - this.checkLVal(expr.expression, "parenthesized expression", bindingType, checkClashes); - break; - - default: - { - this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.InvalidLhs : ErrorMessages.InvalidLhsBinding, contextDescription); - } - } - } - - checkToRestConversion(node) { - if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") { - this.raise(node.argument.start, ErrorMessages.InvalidRestAssignmentPattern); - } - } - - checkCommaAfterRest(close) { - if (this.match(20)) { - if (this.lookaheadCharCode() === close) { - this.raiseTrailingCommaAfterRest(this.state.start); - } else { - this.raiseRestNotLast(this.state.start); - } - } - } - - raiseRestNotLast(pos) { - throw this.raise(pos, ErrorMessages.ElementAfterRest); - } - - raiseTrailingCommaAfterRest(pos) { - this.raise(pos, ErrorMessages.RestTrailingComma); - } - -} - -const invalidHackPipeBodies = new Map([["ArrowFunctionExpression", "arrow function"], ["AssignmentExpression", "assignment"], ["ConditionalExpression", "conditional"], ["YieldExpression", "yield"]]); -class ExpressionParser extends LValParser { - checkProto(prop, isRecord, protoRef, refExpressionErrors) { - if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { - return; - } - - const key = prop.key; - const name = key.type === "Identifier" ? key.name : key.value; - - if (name === "__proto__") { - if (isRecord) { - this.raise(key.start, ErrorMessages.RecordNoProto); - return; - } - - if (protoRef.used) { - if (refExpressionErrors) { - if (refExpressionErrors.doubleProto === -1) { - refExpressionErrors.doubleProto = key.start; - } - } else { - this.raise(key.start, ErrorMessages.DuplicateProto); - } - } - - protoRef.used = true; - } - } - - shouldExitDescending(expr, potentialArrowAt) { - return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt; - } - - getExpression() { - this.enterInitialScopes(); - this.nextToken(); - const expr = this.parseExpression(); - - if (!this.match(7)) { - this.unexpected(); - } - - this.finalizeRemainingComments(); - expr.comments = this.state.comments; - expr.errors = this.state.errors; - - if (this.options.tokens) { - expr.tokens = this.tokens; - } - - return expr; - } - - parseExpression(disallowIn, refExpressionErrors) { - if (disallowIn) { - return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); - } - - return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); - } - - parseExpressionBase(refExpressionErrors) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const expr = this.parseMaybeAssign(refExpressionErrors); - - if (this.match(20)) { - const node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - - while (this.eat(20)) { - node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); - } - - this.toReferencedList(node.expressions); - return this.finishNode(node, "SequenceExpression"); - } - - return expr; - } - - parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { - return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); - } - - parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { - return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); - } - - setOptionalParametersError(refExpressionErrors, resultError) { - var _resultError$pos; - - refExpressionErrors.optionalParameters = (_resultError$pos = resultError == null ? void 0 : resultError.pos) != null ? _resultError$pos : this.state.start; - } - - parseMaybeAssign(refExpressionErrors, afterLeftParse) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - - if (this.isContextual("yield")) { - if (this.prodParam.hasYield) { - let left = this.parseYield(); - - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startPos, startLoc); - } - - return left; - } - } - - let ownExpressionErrors; - - if (refExpressionErrors) { - ownExpressionErrors = false; - } else { - refExpressionErrors = new ExpressionErrors(); - ownExpressionErrors = true; - } - - if (this.match(18) || this.match(5)) { - this.state.potentialArrowAt = this.state.start; - } - - let left = this.parseMaybeConditional(refExpressionErrors); - - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startPos, startLoc); - } - - if (tokenIsAssignment(this.state.type)) { - const node = this.startNodeAt(startPos, startLoc); - const operator = this.state.value; - node.operator = operator; - - if (this.match(35)) { - node.left = this.toAssignable(left, true); - refExpressionErrors.doubleProto = -1; - } else { - node.left = left; - } - - if (refExpressionErrors.shorthandAssign >= node.left.start) { - refExpressionErrors.shorthandAssign = -1; - } - - this.checkLVal(left, "assignment expression"); - this.next(); - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentExpression"); - } else if (ownExpressionErrors) { - this.checkExpressionErrors(refExpressionErrors, true); - } - - return left; - } - - parseMaybeConditional(refExpressionErrors) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprOps(refExpressionErrors); - - if (this.shouldExitDescending(expr, potentialArrowAt)) { - return expr; - } - - return this.parseConditional(expr, startPos, startLoc, refExpressionErrors); - } - - parseConditional(expr, startPos, startLoc, refExpressionErrors) { - if (this.eat(25)) { - const node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssignAllowIn(); - this.expect(22); - node.alternate = this.parseMaybeAssign(); - return this.finishNode(node, "ConditionalExpression"); - } - - return expr; - } - - parseMaybeUnaryOrPrivate(refExpressionErrors) { - return this.match(6) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); - } - - parseExprOps(refExpressionErrors) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); - - if (this.shouldExitDescending(expr, potentialArrowAt)) { - return expr; - } - - return this.parseExprOp(expr, startPos, startLoc, -1); - } - - parseExprOp(left, leftStartPos, leftStartLoc, minPrec) { - if (this.isPrivateName(left)) { - const value = this.getPrivateNameSV(left); - const { - start - } = left; - - if (minPrec >= tokenOperatorPrecedence(57) || !this.prodParam.hasIn || !this.match(57)) { - this.raise(start, ErrorMessages.PrivateInExpectedIn, value); - } - - this.classScope.usePrivateName(value, start); - } - - const op = this.state.type; - - if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(57))) { - let prec = tokenOperatorPrecedence(op); - - if (prec > minPrec) { - if (op === 42) { - this.expectPlugin("pipelineOperator"); - - if (this.state.inFSharpPipelineDirectBody) { - return left; - } - - this.checkPipelineAtInfixOperator(left, leftStartPos); - } - - const node = this.startNodeAt(leftStartPos, leftStartLoc); - node.left = left; - node.operator = this.state.value; - const logical = op === 44 || op === 45; - const coalesce = op === 43; - - if (coalesce) { - prec = tokenOperatorPrecedence(45); - } - - this.next(); - - if (op === 42 && this.getPluginOption("pipelineOperator", "proposal") === "minimal") { - if (this.match(5) && this.state.value === "await" && this.prodParam.hasAwait) { - throw this.raise(this.state.start, ErrorMessages.UnexpectedAwaitAfterPipelineBody); - } - } - - node.right = this.parseExprOpRightExpr(op, prec); - this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); - const nextOp = this.state.type; - - if (coalesce && (nextOp === 44 || nextOp === 45) || logical && nextOp === 43) { - throw this.raise(this.state.start, ErrorMessages.MixingCoalesceWithLogical); - } - - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec); - } - } - - return left; - } - - parseExprOpRightExpr(op, prec) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - - switch (op) { - case 42: - switch (this.getPluginOption("pipelineOperator", "proposal")) { - case "hack": - return this.withTopicBindingContext(() => { - return this.parseHackPipeBody(); - }); - - case "smart": - return this.withTopicBindingContext(() => { - if (this.prodParam.hasYield && this.isContextual("yield")) { - throw this.raise(this.state.start, ErrorMessages.PipeBodyIsTighter, this.state.value); - } - - return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startPos, startLoc); - }); - - case "fsharp": - return this.withSoloAwaitPermittingContext(() => { - return this.parseFSharpPipelineBody(prec); - }); - } - - default: - return this.parseExprOpBaseRightExpr(op, prec); - } - } - - parseExprOpBaseRightExpr(op, prec) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec); - } - - parseHackPipeBody() { - var _body$extra; - - const { - start - } = this.state; - const body = this.parseMaybeAssign(); - - if (invalidHackPipeBodies.has(body.type) && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { - this.raise(start, ErrorMessages.PipeUnparenthesizedBody, invalidHackPipeBodies.get(body.type)); - } - - if (!this.topicReferenceWasUsedInCurrentContext()) { - this.raise(start, ErrorMessages.PipeTopicUnused); - } - - return body; - } - - checkExponentialAfterUnary(node) { - if (this.match(56)) { - this.raise(node.argument.start, ErrorMessages.UnexpectedTokenUnaryExponentiation); - } - } - - parseMaybeUnary(refExpressionErrors, sawUnary) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const isAwait = this.isContextual("await"); - - if (isAwait && this.isAwaitAllowed()) { - this.next(); - const expr = this.parseAwait(startPos, startLoc); - if (!sawUnary) this.checkExponentialAfterUnary(expr); - return expr; - } - - const update = this.match(39); - const node = this.startNode(); - - if (tokenIsPrefix(this.state.type)) { - node.operator = this.state.value; - node.prefix = true; - - if (this.match(71)) { - this.expectPlugin("throwExpressions"); - } - - const isDelete = this.match(88); - this.next(); - node.argument = this.parseMaybeUnary(null, true); - this.checkExpressionErrors(refExpressionErrors, true); - - if (this.state.strict && isDelete) { - const arg = node.argument; - - if (arg.type === "Identifier") { - this.raise(node.start, ErrorMessages.StrictDelete); - } else if (this.hasPropertyAsPrivateName(arg)) { - this.raise(node.start, ErrorMessages.DeletePrivateField); - } - } - - if (!update) { - if (!sawUnary) this.checkExponentialAfterUnary(node); - return this.finishNode(node, "UnaryExpression"); - } - } - - const expr = this.parseUpdate(node, update, refExpressionErrors); - - if (isAwait) { - const { - type - } = this.state; - const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(53); - - if (startsExpr && !this.isAmbiguousAwait()) { - this.raiseOverwrite(startPos, ErrorMessages.AwaitNotInAsyncContext); - return this.parseAwait(startPos, startLoc); - } - } - - return expr; - } - - parseUpdate(node, update, refExpressionErrors) { - if (update) { - this.checkLVal(node.argument, "prefix operation"); - return this.finishNode(node, "UpdateExpression"); - } - - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let expr = this.parseExprSubscripts(refExpressionErrors); - if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; - - while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startPos, startLoc); - node.operator = this.state.value; - node.prefix = false; - node.argument = expr; - this.checkLVal(expr, "postfix operation"); - this.next(); - expr = this.finishNode(node, "UpdateExpression"); - } - - return expr; - } - - parseExprSubscripts(refExpressionErrors) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprAtom(refExpressionErrors); - - if (this.shouldExitDescending(expr, potentialArrowAt)) { - return expr; - } - - return this.parseSubscripts(expr, startPos, startLoc); - } - - parseSubscripts(base, startPos, startLoc, noCalls) { - const state = { - optionalChainMember: false, - maybeAsyncArrow: this.atPossibleAsyncArrow(base), - stop: false - }; - - do { - base = this.parseSubscript(base, startPos, startLoc, noCalls, state); - state.maybeAsyncArrow = false; - } while (!state.stop); - - return base; - } - - parseSubscript(base, startPos, startLoc, noCalls, state) { - if (!noCalls && this.eat(23)) { - return this.parseBind(base, startPos, startLoc, noCalls, state); - } else if (this.match(30)) { - return this.parseTaggedTemplateExpression(base, startPos, startLoc, state); - } - - let optional = false; - - if (this.match(26)) { - if (noCalls && this.lookaheadCharCode() === 40) { - state.stop = true; - return base; - } - - state.optionalChainMember = optional = true; - this.next(); - } - - if (!noCalls && this.match(18)) { - return this.parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional); - } else { - const computed = this.eat(8); - - if (computed || optional || this.eat(24)) { - return this.parseMember(base, startPos, startLoc, state, computed, optional); - } else { - state.stop = true; - return base; - } - } - } - - parseMember(base, startPos, startLoc, state, computed, optional) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.computed = computed; - const privateName = !computed && this.match(6) && this.state.value; - const property = computed ? this.parseExpression() : privateName ? this.parsePrivateName() : this.parseIdentifier(true); - - if (privateName !== false) { - if (node.object.type === "Super") { - this.raise(startPos, ErrorMessages.SuperPrivateField); - } - - this.classScope.usePrivateName(privateName, property.start); - } - - node.property = property; - - if (computed) { - this.expect(11); - } - - if (state.optionalChainMember) { - node.optional = optional; - return this.finishNode(node, "OptionalMemberExpression"); - } else { - return this.finishNode(node, "MemberExpression"); - } - } - - parseBind(base, startPos, startLoc, noCalls, state) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.callee = this.parseNoCallExpr(); - state.stop = true; - return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); - } - - parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional) { - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - let refExpressionErrors = null; - this.state.maybeInArrowParameters = true; - this.next(); - let node = this.startNodeAt(startPos, startLoc); - node.callee = base; - - if (state.maybeAsyncArrow) { - this.expressionScope.enter(newAsyncArrowScope()); - refExpressionErrors = new ExpressionErrors(); - } - - if (state.optionalChainMember) { - node.optional = optional; - } - - if (optional) { - node.arguments = this.parseCallExpressionArguments(19); - } else { - node.arguments = this.parseCallExpressionArguments(19, base.type === "Import", base.type !== "Super", node, refExpressionErrors); - } - - this.finishCallExpression(node, state.optionalChainMember); - - if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { - state.stop = true; - this.expressionScope.validateAsPattern(); - this.expressionScope.exit(); - node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); - } else { - if (state.maybeAsyncArrow) { - this.checkExpressionErrors(refExpressionErrors, true); - this.expressionScope.exit(); - } - - this.toReferencedArguments(node); - } - - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - return node; - } - - toReferencedArguments(node, isParenthesizedExpr) { - this.toReferencedListDeep(node.arguments, isParenthesizedExpr); - } - - parseTaggedTemplateExpression(base, startPos, startLoc, state) { - const node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate(true); - - if (state.optionalChainMember) { - this.raise(startPos, ErrorMessages.OptionalChainingNoTemplate); - } - - return this.finishNode(node, "TaggedTemplateExpression"); - } - - atPossibleAsyncArrow(base) { - return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt; - } - - finishCallExpression(node, optional) { - if (node.callee.type === "Import") { - if (node.arguments.length === 2) { - { - if (!this.hasPlugin("moduleAttributes")) { - this.expectPlugin("importAssertions"); - } - } - } - - if (node.arguments.length === 0 || node.arguments.length > 2) { - this.raise(node.start, ErrorMessages.ImportCallArity, this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? "one or two arguments" : "one argument"); - } else { - for (const arg of node.arguments) { - if (arg.type === "SpreadElement") { - this.raise(arg.start, ErrorMessages.ImportCallSpreadArgument); - } - } - } - } - - return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); - } - - parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) { - const elts = []; - let first = true; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(20); - - if (this.match(close)) { - if (dynamicImport && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { - this.raise(this.state.lastTokStart, ErrorMessages.ImportCallArgumentTrailingComma); - } - - if (nodeForExtra) { - this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart); - } - - this.next(); - break; - } - } - - elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder)); - } - - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return elts; - } - - shouldParseAsyncArrow() { - return this.match(27) && !this.canInsertSemicolon(); - } - - parseAsyncArrowFromCallExpression(node, call) { - var _call$extra; - - this.resetPreviousNodeTrailingComments(call); - this.expect(27); - this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma); - setInnerComments(node, call.innerComments); - setInnerComments(node, call.callee.trailingComments); - return node; - } - - parseNoCallExpr() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); - } - - parseExprAtom(refExpressionErrors) { - let node; - - switch (this.state.type) { - case 78: - return this.parseSuper(); - - case 82: - node = this.startNode(); - this.next(); - - if (this.match(24)) { - return this.parseImportMetaProperty(node); - } - - if (!this.match(18)) { - this.raise(this.state.lastTokStart, ErrorMessages.UnsupportedImport); - } - - return this.finishNode(node, "Import"); - - case 77: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression"); - - case 5: - { - if (this.isContextual("module") && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) { - return this.parseModuleExpression(); - } - - const canBeArrow = this.state.potentialArrowAt === this.state.start; - const containsEsc = this.state.containsEsc; - const id = this.parseIdentifier(); - - if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { - if (this.match(67)) { - this.resetPreviousNodeTrailingComments(id); - this.next(); - return this.parseFunction(this.startNodeAtNode(id), undefined, true); - } else if (this.match(5)) { - if (this.lookaheadCharCode() === 61) { - return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); - } else { - return id; - } - } else if (this.match(89)) { - this.resetPreviousNodeTrailingComments(id); - return this.parseDo(this.startNodeAtNode(id), true); - } - } - - if (canBeArrow && this.match(27) && !this.canInsertSemicolon()) { - this.next(); - return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); - } - - return id; - } - - case 89: - { - return this.parseDo(this.startNode(), false); - } - - case 55: - case 37: - { - this.readRegexp(); - return this.parseRegExpLiteral(this.state.value); - } - - case 0: - return this.parseNumericLiteral(this.state.value); - - case 1: - return this.parseBigIntLiteral(this.state.value); - - case 2: - return this.parseDecimalLiteral(this.state.value); - - case 4: - return this.parseStringLiteral(this.state.value); - - case 83: - return this.parseNullLiteral(); - - case 84: - return this.parseBooleanLiteral(true); - - case 85: - return this.parseBooleanLiteral(false); - - case 18: - { - const canBeArrow = this.state.potentialArrowAt === this.state.start; - return this.parseParenAndDistinguishExpression(canBeArrow); - } - - case 10: - case 9: - { - return this.parseArrayLike(this.state.type === 10 ? 12 : 11, false, true, refExpressionErrors); - } - - case 8: - { - return this.parseArrayLike(11, true, false, refExpressionErrors); - } - - case 14: - case 15: - { - return this.parseObjectLike(this.state.type === 14 ? 17 : 16, false, true, refExpressionErrors); - } - - case 13: - { - return this.parseObjectLike(16, false, false, refExpressionErrors); - } - - case 67: - return this.parseFunctionOrFunctionSent(); - - case 32: - this.parseDecorators(); - - case 79: - node = this.startNode(); - this.takeDecorators(node); - return this.parseClass(node, false); - - case 76: - return this.parseNewOrNewTarget(); - - case 30: - return this.parseTemplate(false); - - case 23: - { - node = this.startNode(); - this.next(); - node.object = null; - const callee = node.callee = this.parseNoCallExpr(); - - if (callee.type === "MemberExpression") { - return this.finishNode(node, "BindExpression"); - } else { - throw this.raise(callee.start, ErrorMessages.UnsupportedBind); - } - } - - case 6: - { - this.raise(this.state.start, ErrorMessages.PrivateInExpectedIn, this.state.value); - return this.parsePrivateName(); - } - - case 38: - if (this.getPluginOption("pipelineOperator", "proposal") === "hack" && this.getPluginOption("pipelineOperator", "topicToken") === "%") { - this.state.value = "%"; - this.state.type = 53; - this.state.pos--; - this.state.end--; - this.state.endLoc.column--; - } else { - throw this.unexpected(); - } - - case 53: - case 33: - { - const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); - - if (pipeProposal) { - node = this.startNode(); - const start = this.state.start; - const tokenType = this.state.type; - this.next(); - return this.finishTopicReference(node, start, pipeProposal, tokenType); - } - } - - case 50: - { - if (this.state.value === "<") { - const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); - - if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) { - this.expectOnePlugin(["jsx", "flow", "typescript"]); - } - } - } - - default: - throw this.unexpected(); - } - } - - finishTopicReference(node, start, pipeProposal, tokenType) { - if (this.testTopicReferenceConfiguration(pipeProposal, start, tokenType)) { - let nodeType; - - if (pipeProposal === "smart") { - nodeType = "PipelinePrimaryTopicReference"; - } else { - nodeType = "TopicReference"; - } - - if (!this.topicReferenceIsAllowedInCurrentContext()) { - if (pipeProposal === "smart") { - this.raise(start, ErrorMessages.PrimaryTopicNotAllowed); - } else { - this.raise(start, ErrorMessages.PipeTopicUnbound); - } - } - - this.registerTopicReference(); - return this.finishNode(node, nodeType); - } else { - throw this.raise(start, ErrorMessages.PipeTopicUnconfiguredToken, tokenLabelName(tokenType)); - } - } - - testTopicReferenceConfiguration(pipeProposal, start, tokenType) { - switch (pipeProposal) { - case "hack": - { - const pluginTopicToken = this.getPluginOption("pipelineOperator", "topicToken"); - return tokenLabelName(tokenType) === pluginTopicToken; - } - - case "smart": - return tokenType === 33; - - default: - throw this.raise(start, ErrorMessages.PipeTopicRequiresHackPipes); - } - } - - parseAsyncArrowUnaryFunction(node) { - this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); - const params = [this.parseIdentifier()]; - this.prodParam.exit(); - - if (this.hasPrecedingLineBreak()) { - this.raise(this.state.pos, ErrorMessages.LineTerminatorBeforeArrow); - } - - this.expect(27); - this.parseArrowExpression(node, params, true); - return node; - } - - parseDo(node, isAsync) { - this.expectPlugin("doExpressions"); - - if (isAsync) { - this.expectPlugin("asyncDoExpressions"); - } - - node.async = isAsync; - this.next(); - const oldLabels = this.state.labels; - this.state.labels = []; - - if (isAsync) { - this.prodParam.enter(PARAM_AWAIT); - node.body = this.parseBlock(); - this.prodParam.exit(); - } else { - node.body = this.parseBlock(); - } - - this.state.labels = oldLabels; - return this.finishNode(node, "DoExpression"); - } - - parseSuper() { - const node = this.startNode(); - this.next(); - - if (this.match(18) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { - this.raise(node.start, ErrorMessages.SuperNotAllowed); - } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { - this.raise(node.start, ErrorMessages.UnexpectedSuper); - } - - if (!this.match(18) && !this.match(8) && !this.match(24)) { - this.raise(node.start, ErrorMessages.UnsupportedSuper); - } - - return this.finishNode(node, "Super"); - } - - parseMaybePrivateName(isPrivateNameAllowed) { - const isPrivate = this.match(6); - - if (isPrivate) { - if (!isPrivateNameAllowed) { - this.raise(this.state.start + 1, ErrorMessages.UnexpectedPrivateField); - } - - return this.parsePrivateName(); - } else { - return this.parseIdentifier(true); - } - } - - parsePrivateName() { - const node = this.startNode(); - const id = this.startNodeAt(this.state.start + 1, new Position(this.state.curLine, this.state.start + 1 - this.state.lineStart)); - const name = this.state.value; - this.next(); - node.id = this.createIdentifier(id, name); - return this.finishNode(node, "PrivateName"); - } - - parseFunctionOrFunctionSent() { - const node = this.startNode(); - this.next(); - - if (this.prodParam.hasYield && this.match(24)) { - const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); - this.next(); - return this.parseMetaProperty(node, meta, "sent"); - } - - return this.parseFunction(node); - } - - parseMetaProperty(node, meta, propertyName) { - node.meta = meta; - - if (meta.name === "function" && propertyName === "sent") { - if (this.isContextual(propertyName)) { - this.expectPlugin("functionSent"); - } else if (!this.hasPlugin("functionSent")) { - this.unexpected(); - } - } - - const containsEsc = this.state.containsEsc; - node.property = this.parseIdentifier(true); - - if (node.property.name !== propertyName || containsEsc) { - this.raise(node.property.start, ErrorMessages.UnsupportedMetaProperty, meta.name, propertyName); - } - - return this.finishNode(node, "MetaProperty"); - } - - parseImportMetaProperty(node) { - const id = this.createIdentifier(this.startNodeAtNode(node), "import"); - this.next(); - - if (this.isContextual("meta")) { - if (!this.inModule) { - this.raise(id.start, SourceTypeModuleErrorMessages.ImportMetaOutsideModule); - } - - this.sawUnambiguousESM = true; - } - - return this.parseMetaProperty(node, id, "meta"); - } - - parseLiteralAtNode(value, type, node) { - this.addExtra(node, "rawValue", value); - this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)); - node.value = value; - this.next(); - return this.finishNode(node, type); - } - - parseLiteral(value, type) { - const node = this.startNode(); - return this.parseLiteralAtNode(value, type, node); - } - - parseStringLiteral(value) { - return this.parseLiteral(value, "StringLiteral"); - } - - parseNumericLiteral(value) { - return this.parseLiteral(value, "NumericLiteral"); - } - - parseBigIntLiteral(value) { - return this.parseLiteral(value, "BigIntLiteral"); - } - - parseDecimalLiteral(value) { - return this.parseLiteral(value, "DecimalLiteral"); - } - - parseRegExpLiteral(value) { - const node = this.parseLiteral(value.value, "RegExpLiteral"); - node.pattern = value.pattern; - node.flags = value.flags; - return node; - } - - parseBooleanLiteral(value) { - const node = this.startNode(); - node.value = value; - this.next(); - return this.finishNode(node, "BooleanLiteral"); - } - - parseNullLiteral() { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "NullLiteral"); - } - - parseParenAndDistinguishExpression(canBeArrow) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let val; - this.next(); - this.expressionScope.enter(newArrowHeadScope()); - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.maybeInArrowParameters = true; - this.state.inFSharpPipelineDirectBody = false; - const innerStartPos = this.state.start; - const innerStartLoc = this.state.startLoc; - const exprList = []; - const refExpressionErrors = new ExpressionErrors(); - let first = true; - let spreadStart; - let optionalCommaStart; - - while (!this.match(19)) { - if (first) { - first = false; - } else { - this.expect(20, refExpressionErrors.optionalParameters === -1 ? null : refExpressionErrors.optionalParameters); - - if (this.match(19)) { - optionalCommaStart = this.state.start; - break; - } - } - - if (this.match(29)) { - const spreadNodeStartPos = this.state.start; - const spreadNodeStartLoc = this.state.startLoc; - spreadStart = this.state.start; - exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc)); - this.checkCommaAfterRest(41); - break; - } else { - exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem)); - } - } - - const innerEndPos = this.state.lastTokEnd; - const innerEndLoc = this.state.lastTokEndLoc; - this.expect(19); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - let arrowNode = this.startNodeAt(startPos, startLoc); - - if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { - this.expressionScope.validateAsPattern(); - this.expressionScope.exit(); - this.parseArrowExpression(arrowNode, exprList, false); - return arrowNode; - } - - this.expressionScope.exit(); - - if (!exprList.length) { - this.unexpected(this.state.lastTokStart); - } - - if (optionalCommaStart) this.unexpected(optionalCommaStart); - if (spreadStart) this.unexpected(spreadStart); - this.checkExpressionErrors(refExpressionErrors, true); - this.toReferencedListDeep(exprList, true); - - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNode(val, "SequenceExpression"); - this.resetEndLocation(val, innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - - if (!this.options.createParenthesizedExpressions) { - this.addExtra(val, "parenthesized", true); - this.addExtra(val, "parenStart", startPos); - return val; - } - - const parenExpression = this.startNodeAt(startPos, startLoc); - parenExpression.expression = val; - this.finishNode(parenExpression, "ParenthesizedExpression"); - return parenExpression; - } - - shouldParseArrow(params) { - return !this.canInsertSemicolon(); - } - - parseArrow(node) { - if (this.eat(27)) { - return node; - } - } - - parseParenItem(node, startPos, startLoc) { - return node; - } - - parseNewOrNewTarget() { - const node = this.startNode(); - this.next(); - - if (this.match(24)) { - const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); - this.next(); - const metaProp = this.parseMetaProperty(node, meta, "target"); - - if (!this.scope.inNonArrowFunction && !this.scope.inClass) { - this.raise(metaProp.start, ErrorMessages.UnexpectedNewTarget); - } - - return metaProp; - } - - return this.parseNew(node); - } - - parseNew(node) { - node.callee = this.parseNoCallExpr(); - - if (node.callee.type === "Import") { - this.raise(node.callee.start, ErrorMessages.ImportCallNotNewExpression); - } else if (this.isOptionalChain(node.callee)) { - this.raise(this.state.lastTokEnd, ErrorMessages.OptionalChainingNoNew); - } else if (this.eat(26)) { - this.raise(this.state.start, ErrorMessages.OptionalChainingNoNew); - } - - this.parseNewArguments(node); - return this.finishNode(node, "NewExpression"); - } - - parseNewArguments(node) { - if (this.eat(18)) { - const args = this.parseExprList(19); - this.toReferencedList(args); - node.arguments = args; - } else { - node.arguments = []; - } - } - - parseTemplateElement(isTagged) { - const elem = this.startNode(); - - if (this.state.value === null) { - if (!isTagged) { - this.raise(this.state.start + 1, ErrorMessages.InvalidEscapeSequenceTemplate); - } - } - - elem.value = { - raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), - cooked: this.state.value - }; - this.next(); - elem.tail = this.match(30); - return this.finishNode(elem, "TemplateElement"); - } - - parseTemplate(isTagged) { - const node = this.startNode(); - this.next(); - node.expressions = []; - let curElt = this.parseTemplateElement(isTagged); - node.quasis = [curElt]; - - while (!curElt.tail) { - this.expect(31); - node.expressions.push(this.parseTemplateSubstitution()); - this.expect(16); - node.quasis.push(curElt = this.parseTemplateElement(isTagged)); - } - - this.next(); - return this.finishNode(node, "TemplateLiteral"); - } - - parseTemplateSubstitution() { - return this.parseExpression(); - } - - parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { - if (isRecord) { - this.expectPlugin("recordAndTuple"); - } - - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - const propHash = Object.create(null); - let first = true; - const node = this.startNode(); - node.properties = []; - this.next(); - - while (!this.match(close)) { - if (first) { - first = false; - } else { - this.expect(20); - - if (this.match(close)) { - this.addExtra(node, "trailingComma", this.state.lastTokStart); - break; - } - } - - const prop = this.parsePropertyDefinition(isPattern, refExpressionErrors); - - if (!isPattern) { - this.checkProto(prop, isRecord, propHash, refExpressionErrors); - } - - if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { - this.raise(prop.start, ErrorMessages.InvalidRecordProperty); - } - - if (prop.shorthand) { - this.addExtra(prop, "shorthand", true); - } - - node.properties.push(prop); - } - - this.next(); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - let type = "ObjectExpression"; - - if (isPattern) { - type = "ObjectPattern"; - } else if (isRecord) { - type = "RecordExpression"; - } - - return this.finishNode(node, type); - } - - maybeAsyncOrAccessorProp(prop) { - return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(8) || this.match(54)); - } - - parsePropertyDefinition(isPattern, refExpressionErrors) { - let decorators = []; - - if (this.match(32)) { - if (this.hasPlugin("decorators")) { - this.raise(this.state.start, ErrorMessages.UnsupportedPropertyDecorator); - } - - while (this.match(32)) { - decorators.push(this.parseDecorator()); - } - } - - const prop = this.startNode(); - let isGenerator = false; - let isAsync = false; - let isAccessor = false; - let startPos; - let startLoc; - - if (this.match(29)) { - if (decorators.length) this.unexpected(); - - if (isPattern) { - this.next(); - prop.argument = this.parseIdentifier(); - this.checkCommaAfterRest(125); - return this.finishNode(prop, "RestElement"); - } - - return this.parseSpread(); - } - - if (decorators.length) { - prop.decorators = decorators; - decorators = []; - } - - prop.method = false; - - if (isPattern || refExpressionErrors) { - startPos = this.state.start; - startLoc = this.state.startLoc; - } - - if (!isPattern) { - isGenerator = this.eat(54); - } - - const containsEsc = this.state.containsEsc; - const key = this.parsePropertyName(prop, false); - - if (!isPattern && !isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { - const keyName = key.name; - - if (keyName === "async" && !this.hasPrecedingLineBreak()) { - isAsync = true; - this.resetPreviousNodeTrailingComments(key); - isGenerator = this.eat(54); - this.parsePropertyName(prop, false); - } - - if (keyName === "get" || keyName === "set") { - isAccessor = true; - this.resetPreviousNodeTrailingComments(key); - prop.kind = keyName; - - if (this.match(54)) { - isGenerator = true; - this.raise(this.state.pos, ErrorMessages.AccessorIsGenerator, keyName); - this.next(); - } - - this.parsePropertyName(prop, false); - } - } - - this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); - return prop; - } - - getGetterSetterExpectedParamCount(method) { - return method.kind === "get" ? 0 : 1; - } - - getObjectOrClassMethodParams(method) { - return method.params; - } - - checkGetterSetterParams(method) { - var _params; - - const paramCount = this.getGetterSetterExpectedParamCount(method); - const params = this.getObjectOrClassMethodParams(method); - const start = method.start; - - if (params.length !== paramCount) { - if (method.kind === "get") { - this.raise(start, ErrorMessages.BadGetterArity); - } else { - this.raise(start, ErrorMessages.BadSetterArity); - } - } - - if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { - this.raise(start, ErrorMessages.BadSetterRestParameter); - } - } - - parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { - if (isAccessor) { - this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); - this.checkGetterSetterParams(prop); - return prop; - } - - if (isAsync || isGenerator || this.match(18)) { - if (isPattern) this.unexpected(); - prop.kind = "method"; - prop.method = true; - return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); - } - } - - parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) { - prop.shorthand = false; - - if (this.eat(22)) { - prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); - return this.finishNode(prop, "ObjectProperty"); - } - - if (!prop.computed && prop.key.type === "Identifier") { - this.checkReservedWord(prop.key.name, prop.key.start, true, false); - - if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key)); - } else if (this.match(35) && refExpressionErrors) { - if (refExpressionErrors.shorthandAssign === -1) { - refExpressionErrors.shorthandAssign = this.state.start; - } - - prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key)); - } else { - prop.value = cloneIdentifier(prop.key); - } - - prop.shorthand = true; - return this.finishNode(prop, "ObjectProperty"); - } - } - - parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { - const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors); - if (!node) this.unexpected(); - return node; - } - - parsePropertyName(prop, isPrivateNameAllowed) { - if (this.eat(8)) { - prop.computed = true; - prop.key = this.parseMaybeAssignAllowIn(); - this.expect(11); - } else { - const oldInPropertyName = this.state.inPropertyName; - this.state.inPropertyName = true; - const type = this.state.type; - prop.key = type === 0 || type === 4 || type === 1 || type === 2 ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed); - - if (type !== 6) { - prop.computed = false; - } - - this.state.inPropertyName = oldInPropertyName; - } - - return prop.key; - } - - initFunction(node, isAsync) { - node.id = null; - node.generator = false; - node.async = !!isAsync; - } - - parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { - this.initFunction(node, isAsync); - node.generator = !!isGenerator; - const allowModifiers = isConstructor; - this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); - this.prodParam.enter(functionFlags(isAsync, node.generator)); - this.parseFunctionParams(node, allowModifiers); - this.parseFunctionBodyAndFinish(node, type, true); - this.prodParam.exit(); - this.scope.exit(); - return node; - } - - parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { - if (isTuple) { - this.expectPlugin("recordAndTuple"); - } - - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = false; - const node = this.startNode(); - this.next(); - node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); - } - - parseArrowExpression(node, params, isAsync, trailingCommaPos) { - this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); - let flags = functionFlags(isAsync, false); - - if (!this.match(8) && this.prodParam.hasIn) { - flags |= PARAM_IN; - } - - this.prodParam.enter(flags); - this.initFunction(node, isAsync); - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - - if (params) { - this.state.maybeInArrowParameters = true; - this.setArrowFunctionParameters(node, params, trailingCommaPos); - } - - this.state.maybeInArrowParameters = false; - this.parseFunctionBody(node, true); - this.prodParam.exit(); - this.scope.exit(); - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - return this.finishNode(node, "ArrowFunctionExpression"); - } - - setArrowFunctionParameters(node, params, trailingCommaPos) { - node.params = this.toAssignableList(params, trailingCommaPos, false); - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - this.parseFunctionBody(node, false, isMethod); - this.finishNode(node, type); - } - - parseFunctionBody(node, allowExpression, isMethod = false) { - const isExpression = allowExpression && !this.match(13); - this.expressionScope.enter(newExpressionScope()); - - if (isExpression) { - node.body = this.parseMaybeAssign(); - this.checkParams(node, false, allowExpression, false); - } else { - const oldStrict = this.state.strict; - const oldLabels = this.state.labels; - this.state.labels = []; - this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN); - node.body = this.parseBlock(true, false, hasStrictModeDirective => { - const nonSimple = !this.isSimpleParamList(node.params); - - if (hasStrictModeDirective && nonSimple) { - const errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start; - this.raise(errorPos, ErrorMessages.IllegalLanguageModeDirective); - } - - const strictModeChanged = !oldStrict && this.state.strict; - this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); - - if (this.state.strict && node.id) { - this.checkLVal(node.id, "function name", BIND_OUTSIDE, undefined, undefined, strictModeChanged); - } - }); - this.prodParam.exit(); - this.expressionScope.exit(); - this.state.labels = oldLabels; - } - } - - isSimpleParamList(params) { - for (let i = 0, len = params.length; i < len; i++) { - if (params[i].type !== "Identifier") return false; - } - - return true; - } - - checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { - const checkClashes = new Set(); - - for (const param of node.params) { - this.checkLVal(param, "function parameter list", BIND_VAR, allowDuplicates ? null : checkClashes, undefined, strictModeChanged); - } - } - - parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { - const elts = []; - let first = true; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(20); - - if (this.match(close)) { - if (nodeForExtra) { - this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart); - } - - this.next(); - break; - } - } - - elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); - } - - return elts; - } - - parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) { - let elt; - - if (this.match(20)) { - if (!allowEmpty) { - this.raise(this.state.pos, ErrorMessages.UnexpectedToken, ","); - } - - elt = null; - } else if (this.match(29)) { - const spreadNodeStartPos = this.state.start; - const spreadNodeStartLoc = this.state.startLoc; - elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartPos, spreadNodeStartLoc); - } else if (this.match(25)) { - this.expectPlugin("partialApplication"); - - if (!allowPlaceholder) { - this.raise(this.state.start, ErrorMessages.UnexpectedArgumentPlaceholder); - } - - const node = this.startNode(); - this.next(); - elt = this.finishNode(node, "ArgumentPlaceholder"); - } else { - elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem); - } - - return elt; - } - - parseIdentifier(liberal) { - const node = this.startNode(); - const name = this.parseIdentifierName(node.start, liberal); - return this.createIdentifier(node, name); - } - - createIdentifier(node, name) { - node.name = name; - node.loc.identifierName = name; - return this.finishNode(node, "Identifier"); - } - - parseIdentifierName(pos, liberal) { - let name; - const { - start, - type - } = this.state; - - if (type === 5) { - name = this.state.value; - } else if (tokenIsKeyword(type)) { - name = tokenLabelName(type); - } else { - throw this.unexpected(); - } - - if (liberal) { - this.state.type = 5; - } else { - this.checkReservedWord(name, start, tokenIsKeyword(type), false); - } - - this.next(); - return name; - } - - checkReservedWord(word, startLoc, checkKeywords, isBinding) { - if (word.length > 10) { - return; - } - - if (!canBeReservedWord(word)) { - return; - } - - if (word === "yield") { - if (this.prodParam.hasYield) { - this.raise(startLoc, ErrorMessages.YieldBindingIdentifier); - return; - } - } else if (word === "await") { - if (this.prodParam.hasAwait) { - this.raise(startLoc, ErrorMessages.AwaitBindingIdentifier); - return; - } else if (this.scope.inStaticBlock) { - this.raise(startLoc, ErrorMessages.AwaitBindingIdentifierInStaticBlock); - return; - } else { - this.expressionScope.recordAsyncArrowParametersError(startLoc, ErrorMessages.AwaitBindingIdentifier); - } - } else if (word === "arguments") { - if (this.scope.inClassAndNotInNonArrowFunction) { - this.raise(startLoc, ErrorMessages.ArgumentsInClass); - return; - } - } - - if (checkKeywords && isKeyword(word)) { - this.raise(startLoc, ErrorMessages.UnexpectedKeyword, word); - return; - } - - const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; - - if (reservedTest(word, this.inModule)) { - this.raise(startLoc, ErrorMessages.UnexpectedReservedWord, word); - } - } - - isAwaitAllowed() { - if (this.prodParam.hasAwait) return true; - - if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) { - return true; - } - - return false; - } - - parseAwait(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.AwaitExpressionFormalParameter); - - if (this.eat(54)) { - this.raise(node.start, ErrorMessages.ObsoleteAwaitStar); - } - - if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { - if (this.isAmbiguousAwait()) { - this.ambiguousScriptDifferentAst = true; - } else { - this.sawUnambiguousESM = true; - } - } - - if (!this.state.soloAwait) { - node.argument = this.parseMaybeUnary(null, true); - } - - return this.finishNode(node, "AwaitExpression"); - } - - isAmbiguousAwait() { - return this.hasPrecedingLineBreak() || this.match(52) || this.match(18) || this.match(8) || this.match(30) || this.match(3) || this.match(55) || this.hasPlugin("v8intrinsic") && this.match(53); - } - - parseYield() { - const node = this.startNode(); - this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.YieldInParameter); - this.next(); - let delegating = false; - let argument = null; - - if (!this.hasPrecedingLineBreak()) { - delegating = this.eat(54); - - switch (this.state.type) { - case 21: - case 7: - case 16: - case 19: - case 11: - case 17: - case 22: - case 20: - if (!delegating) break; - - default: - argument = this.parseMaybeAssign(); - } - } - - node.delegate = delegating; - node.argument = argument; - return this.finishNode(node, "YieldExpression"); - } - - checkPipelineAtInfixOperator(left, leftStartPos) { - if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { - if (left.type === "SequenceExpression") { - this.raise(leftStartPos, ErrorMessages.PipelineHeadSequenceExpression); - } - } - } - - checkHackPipeBodyEarlyErrors(startPos) { - if (!this.topicReferenceWasUsedInCurrentContext()) { - this.raise(startPos, ErrorMessages.PipeTopicUnused); - } - } - - parseSmartPipelineBodyInStyle(childExpr, startPos, startLoc) { - const bodyNode = this.startNodeAt(startPos, startLoc); - - if (this.isSimpleReference(childExpr)) { - bodyNode.callee = childExpr; - return this.finishNode(bodyNode, "PipelineBareFunction"); - } else { - this.checkSmartPipeTopicBodyEarlyErrors(startPos); - bodyNode.expression = childExpr; - return this.finishNode(bodyNode, "PipelineTopicExpression"); - } - } - - isSimpleReference(expression) { - switch (expression.type) { - case "MemberExpression": - return !expression.computed && this.isSimpleReference(expression.object); - - case "Identifier": - return true; - - default: - return false; - } - } - - checkSmartPipeTopicBodyEarlyErrors(startPos) { - if (this.match(27)) { - throw this.raise(this.state.start, ErrorMessages.PipelineBodyNoArrow); - } else if (!this.topicReferenceWasUsedInCurrentContext()) { - this.raise(startPos, ErrorMessages.PipelineTopicUnused); - } - } - - withTopicBindingContext(callback) { - const outerContextTopicState = this.state.topicContext; - this.state.topicContext = { - maxNumOfResolvableTopics: 1, - maxTopicIndex: null - }; - - try { - return callback(); - } finally { - this.state.topicContext = outerContextTopicState; - } - } - - withSmartMixTopicForbiddingContext(callback) { - const proposal = this.getPluginOption("pipelineOperator", "proposal"); - - if (proposal === "smart") { - const outerContextTopicState = this.state.topicContext; - this.state.topicContext = { - maxNumOfResolvableTopics: 0, - maxTopicIndex: null - }; - - try { - return callback(); - } finally { - this.state.topicContext = outerContextTopicState; - } - } else { - return callback(); - } - } - - withSoloAwaitPermittingContext(callback) { - const outerContextSoloAwaitState = this.state.soloAwait; - this.state.soloAwait = true; - - try { - return callback(); - } finally { - this.state.soloAwait = outerContextSoloAwaitState; - } - } - - allowInAnd(callback) { - const flags = this.prodParam.currentFlags(); - const prodParamToSet = PARAM_IN & ~flags; - - if (prodParamToSet) { - this.prodParam.enter(flags | PARAM_IN); - - try { - return callback(); - } finally { - this.prodParam.exit(); - } - } - - return callback(); - } - - disallowInAnd(callback) { - const flags = this.prodParam.currentFlags(); - const prodParamToClear = PARAM_IN & flags; - - if (prodParamToClear) { - this.prodParam.enter(flags & ~PARAM_IN); - - try { - return callback(); - } finally { - this.prodParam.exit(); - } - } - - return callback(); - } - - registerTopicReference() { - this.state.topicContext.maxTopicIndex = 0; - } - - topicReferenceIsAllowedInCurrentContext() { - return this.state.topicContext.maxNumOfResolvableTopics >= 1; - } - - topicReferenceWasUsedInCurrentContext() { - return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; - } - - parseFSharpPipelineBody(prec) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - this.state.potentialArrowAt = this.state.start; - const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; - this.state.inFSharpPipelineDirectBody = true; - const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, prec); - this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; - return ret; - } - - parseModuleExpression() { - this.expectPlugin("moduleBlocks"); - const node = this.startNode(); - this.next(); - this.eat(13); - const revertScopes = this.initializeScopes(true); - this.enterInitialScopes(); - const program = this.startNode(); - - try { - node.body = this.parseProgram(program, 16, "module"); - } finally { - revertScopes(); - } - - this.eat(16); - return this.finishNode(node, "ModuleExpression"); - } - -} - -const loopLabel = { - kind: "loop" -}, - switchLabel = { - kind: "switch" -}; -const FUNC_NO_FLAGS = 0b000, - FUNC_STATEMENT = 0b001, - FUNC_HANGING_STATEMENT = 0b010, - FUNC_NULLABLE_ID = 0b100; -const loneSurrogate = /[\uD800-\uDFFF]/u; -const keywordRelationalOperator = /in(?:stanceof)?/y; - -function babel7CompatTokens(tokens) { - for (let i = 0; i < tokens.length; i++) { - const token = tokens[i]; - const { - type - } = token; - - if (type === 6) { - { - const { - loc, - start, - value, - end - } = token; - const hashEndPos = start + 1; - const hashEndLoc = new Position(loc.start.line, loc.start.column + 1); - tokens.splice(i, 1, new Token({ - type: getExportedToken(33), - value: "#", - start: start, - end: hashEndPos, - startLoc: loc.start, - endLoc: hashEndLoc - }), new Token({ - type: getExportedToken(5), - value: value, - start: hashEndPos, - end: end, - startLoc: hashEndLoc, - endLoc: loc.end - })); - i++; - continue; - } - } - - if (typeof type === "number") { - token.type = getExportedToken(type); - } - } - - return tokens; -} - -class StatementParser extends ExpressionParser { - parseTopLevel(file, program) { - file.program = this.parseProgram(program); - file.comments = this.state.comments; - if (this.options.tokens) file.tokens = babel7CompatTokens(this.tokens); - return this.finishNode(file, "File"); - } - - parseProgram(program, end = 7, sourceType = this.options.sourceType) { - program.sourceType = sourceType; - program.interpreter = this.parseInterpreterDirective(); - this.parseBlockBody(program, true, true, end); - - if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { - for (const [name] of Array.from(this.scope.undefinedExports)) { - const pos = this.scope.undefinedExports.get(name); - this.raise(pos, ErrorMessages.ModuleExportUndefined, name); - } - } - - return this.finishNode(program, "Program"); - } - - stmtToDirective(stmt) { - const directive = stmt; - directive.type = "Directive"; - directive.value = directive.expression; - delete directive.expression; - const directiveLiteral = directive.value; - const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end); - const val = directiveLiteral.value = raw.slice(1, -1); - this.addExtra(directiveLiteral, "raw", raw); - this.addExtra(directiveLiteral, "rawValue", val); - directiveLiteral.type = "DirectiveLiteral"; - return directive; - } - - parseInterpreterDirective() { - if (!this.match(34)) { - return null; - } - - const node = this.startNode(); - node.value = this.state.value; - this.next(); - return this.finishNode(node, "InterpreterDirective"); - } - - isLet(context) { - if (!this.isContextual("let")) { - return false; - } - - return this.isLetKeyword(context); - } - - isLetKeyword(context) { - const next = this.nextTokenStart(); - const nextCh = this.codePointAtPos(next); - - if (nextCh === 92 || nextCh === 91) { - return true; - } - - if (context) return false; - if (nextCh === 123) return true; - - if (isIdentifierStart(nextCh)) { - keywordRelationalOperator.lastIndex = next; - - if (keywordRelationalOperator.test(this.input)) { - const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); - - if (!isIdentifierChar(endCh) && endCh !== 92) { - return false; - } - } - - return true; - } - - return false; - } - - parseStatement(context, topLevel) { - if (this.match(32)) { - this.parseDecorators(true); - } - - return this.parseStatementContent(context, topLevel); - } - - parseStatementContent(context, topLevel) { - let starttype = this.state.type; - const node = this.startNode(); - let kind; - - if (this.isLet(context)) { - starttype = 73; - kind = "let"; - } - - switch (starttype) { - case 59: - return this.parseBreakContinueStatement(node, true); - - case 62: - return this.parseBreakContinueStatement(node, false); - - case 63: - return this.parseDebuggerStatement(node); - - case 89: - return this.parseDoStatement(node); - - case 90: - return this.parseForStatement(node); - - case 67: - if (this.lookaheadCharCode() === 46) break; - - if (context) { - if (this.state.strict) { - this.raise(this.state.start, ErrorMessages.StrictFunction); - } else if (context !== "if" && context !== "label") { - this.raise(this.state.start, ErrorMessages.SloppyFunction); - } - } - - return this.parseFunctionStatement(node, false, !context); - - case 79: - if (context) this.unexpected(); - return this.parseClass(node, true); - - case 68: - return this.parseIfStatement(node); - - case 69: - return this.parseReturnStatement(node); - - case 70: - return this.parseSwitchStatement(node); - - case 71: - return this.parseThrowStatement(node); - - case 72: - return this.parseTryStatement(node); - - case 74: - case 73: - kind = kind || this.state.value; - - if (context && kind !== "var") { - this.raise(this.state.start, ErrorMessages.UnexpectedLexicalDeclaration); - } - - return this.parseVarStatement(node, kind); - - case 91: - return this.parseWhileStatement(node); - - case 75: - return this.parseWithStatement(node); - - case 13: - return this.parseBlock(); - - case 21: - return this.parseEmptyStatement(node); - - case 82: - { - const nextTokenCharCode = this.lookaheadCharCode(); - - if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { - break; - } - } - - case 81: - { - if (!this.options.allowImportExportEverywhere && !topLevel) { - this.raise(this.state.start, ErrorMessages.UnexpectedImportExport); - } - - this.next(); - let result; - - if (starttype === 82) { - result = this.parseImport(node); - - if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { - this.sawUnambiguousESM = true; - } - } else { - result = this.parseExport(node); - - if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { - this.sawUnambiguousESM = true; - } - } - - this.assertModuleNodeAllowed(node); - return result; - } - - default: - { - if (this.isAsyncFunction()) { - if (context) { - this.raise(this.state.start, ErrorMessages.AsyncFunctionInSingleStatementContext); - } - - this.next(); - return this.parseFunctionStatement(node, true, !context); - } - } - } - - const maybeName = this.state.value; - const expr = this.parseExpression(); - - if (starttype === 5 && expr.type === "Identifier" && this.eat(22)) { - return this.parseLabeledStatement(node, maybeName, expr, context); - } else { - return this.parseExpressionStatement(node, expr); - } - } - - assertModuleNodeAllowed(node) { - if (!this.options.allowImportExportEverywhere && !this.inModule) { - this.raise(node.start, SourceTypeModuleErrorMessages.ImportOutsideModule); - } - } - - takeDecorators(node) { - const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; - - if (decorators.length) { - node.decorators = decorators; - this.resetStartLocationFromNode(node, decorators[0]); - this.state.decoratorStack[this.state.decoratorStack.length - 1] = []; - } - } - - canHaveLeadingDecorator() { - return this.match(79); - } - - parseDecorators(allowExport) { - const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; - - while (this.match(32)) { - const decorator = this.parseDecorator(); - currentContextDecorators.push(decorator); - } - - if (this.match(81)) { - if (!allowExport) { - this.unexpected(); - } - - if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.raise(this.state.start, ErrorMessages.DecoratorExportClass); - } - } else if (!this.canHaveLeadingDecorator()) { - throw this.raise(this.state.start, ErrorMessages.UnexpectedLeadingDecorator); - } - } - - parseDecorator() { - this.expectOnePlugin(["decorators-legacy", "decorators"]); - const node = this.startNode(); - this.next(); - - if (this.hasPlugin("decorators")) { - this.state.decoratorStack.push([]); - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let expr; - - if (this.eat(18)) { - expr = this.parseExpression(); - this.expect(19); - } else { - expr = this.parseIdentifier(false); - - while (this.eat(24)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = expr; - node.property = this.parseIdentifier(true); - node.computed = false; - expr = this.finishNode(node, "MemberExpression"); - } - } - - node.expression = this.parseMaybeDecoratorArguments(expr); - this.state.decoratorStack.pop(); - } else { - node.expression = this.parseExprSubscripts(); - } - - return this.finishNode(node, "Decorator"); - } - - parseMaybeDecoratorArguments(expr) { - if (this.eat(18)) { - const node = this.startNodeAtNode(expr); - node.callee = expr; - node.arguments = this.parseCallExpressionArguments(19, false); - this.toReferencedList(node.arguments); - return this.finishNode(node, "CallExpression"); - } - - return expr; - } - - parseBreakContinueStatement(node, isBreak) { - this.next(); - - if (this.isLineTerminator()) { - node.label = null; - } else { - node.label = this.parseIdentifier(); - this.semicolon(); - } - - this.verifyBreakContinue(node, isBreak); - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); - } - - verifyBreakContinue(node, isBreak) { - let i; - - for (i = 0; i < this.state.labels.length; ++i) { - const lab = this.state.labels[i]; - - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break; - if (node.label && isBreak) break; - } - } - - if (i === this.state.labels.length) { - this.raise(node.start, ErrorMessages.IllegalBreakContinue, isBreak ? "break" : "continue"); - } - } - - parseDebuggerStatement(node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); - } - - parseHeaderExpression() { - this.expect(18); - const val = this.parseExpression(); - this.expect(19); - return val; - } - - parseDoStatement(node) { - this.next(); - this.state.labels.push(loopLabel); - node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("do")); - this.state.labels.pop(); - this.expect(91); - node.test = this.parseHeaderExpression(); - this.eat(21); - return this.finishNode(node, "DoWhileStatement"); - } - - parseForStatement(node) { - this.next(); - this.state.labels.push(loopLabel); - let awaitAt = -1; - - if (this.isAwaitAllowed() && this.eatContextual("await")) { - awaitAt = this.state.lastTokStart; - } - - this.scope.enter(SCOPE_OTHER); - this.expect(18); - - if (this.match(21)) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - - return this.parseFor(node, null); - } - - const startsWithLet = this.isContextual("let"); - const isLet = startsWithLet && this.isLetKeyword(); - - if (this.match(73) || this.match(74) || isLet) { - const init = this.startNode(); - const kind = isLet ? "let" : this.state.value; - this.next(); - this.parseVar(init, true, kind); - this.finishNode(init, "VariableDeclaration"); - - if ((this.match(57) || this.isContextual("of")) && init.declarations.length === 1) { - return this.parseForIn(node, init, awaitAt); - } - - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - - return this.parseFor(node, init); - } - - const startsWithUnescapedName = this.match(5) && !this.state.containsEsc; - const refExpressionErrors = new ExpressionErrors(); - const init = this.parseExpression(true, refExpressionErrors); - const isForOf = this.isContextual("of"); - - if (isForOf) { - if (startsWithLet) { - this.raise(init.start, ErrorMessages.ForOfLet); - } else if (awaitAt === -1 && startsWithUnescapedName && init.type === "Identifier" && init.name === "async") { - this.raise(init.start, ErrorMessages.ForOfAsync); - } - } - - if (isForOf || this.match(57)) { - this.toAssignable(init, true); - const description = isForOf ? "for-of statement" : "for-in statement"; - this.checkLVal(init, description); - return this.parseForIn(node, init, awaitAt); - } else { - this.checkExpressionErrors(refExpressionErrors, true); - } - - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - - return this.parseFor(node, init); - } - - parseFunctionStatement(node, isAsync, declarationPosition) { - this.next(); - return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync); - } - - parseIfStatement(node) { - this.next(); - node.test = this.parseHeaderExpression(); - node.consequent = this.parseStatement("if"); - node.alternate = this.eat(65) ? this.parseStatement("if") : null; - return this.finishNode(node, "IfStatement"); - } - - parseReturnStatement(node) { - if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { - this.raise(this.state.start, ErrorMessages.IllegalReturn); - } - - this.next(); - - if (this.isLineTerminator()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } - - return this.finishNode(node, "ReturnStatement"); - } - - parseSwitchStatement(node) { - this.next(); - node.discriminant = this.parseHeaderExpression(); - const cases = node.cases = []; - this.expect(13); - this.state.labels.push(switchLabel); - this.scope.enter(SCOPE_OTHER); - let cur; - - for (let sawDefault; !this.match(16);) { - if (this.match(60) || this.match(64)) { - const isCase = this.match(60); - if (cur) this.finishNode(cur, "SwitchCase"); - cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { - this.raise(this.state.lastTokStart, ErrorMessages.MultipleDefaultsInSwitch); - } - - sawDefault = true; - cur.test = null; - } - - this.expect(22); - } else { - if (cur) { - cur.consequent.push(this.parseStatement(null)); - } else { - this.unexpected(); - } - } - } - - this.scope.exit(); - if (cur) this.finishNode(cur, "SwitchCase"); - this.next(); - this.state.labels.pop(); - return this.finishNode(node, "SwitchStatement"); - } - - parseThrowStatement(node) { - this.next(); - - if (this.hasPrecedingLineBreak()) { - this.raise(this.state.lastTokEnd, ErrorMessages.NewlineAfterThrow); - } - - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement"); - } - - parseCatchClauseParam() { - const param = this.parseBindingAtom(); - const simple = param.type === "Identifier"; - this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLVal(param, "catch clause", BIND_LEXICAL); - return param; - } - - parseTryStatement(node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - - if (this.match(61)) { - const clause = this.startNode(); - this.next(); - - if (this.match(18)) { - this.expect(18); - clause.param = this.parseCatchClauseParam(); - this.expect(19); - } else { - clause.param = null; - this.scope.enter(SCOPE_OTHER); - } - - clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); - this.scope.exit(); - node.handler = this.finishNode(clause, "CatchClause"); - } - - node.finalizer = this.eat(66) ? this.parseBlock() : null; - - if (!node.handler && !node.finalizer) { - this.raise(node.start, ErrorMessages.NoCatchOrFinally); - } - - return this.finishNode(node, "TryStatement"); - } - - parseVarStatement(node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); - } - - parseWhileStatement(node) { - this.next(); - node.test = this.parseHeaderExpression(); - this.state.labels.push(loopLabel); - node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("while")); - this.state.labels.pop(); - return this.finishNode(node, "WhileStatement"); - } - - parseWithStatement(node) { - if (this.state.strict) { - this.raise(this.state.start, ErrorMessages.StrictWith); - } - - this.next(); - node.object = this.parseHeaderExpression(); - node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("with")); - return this.finishNode(node, "WithStatement"); - } - - parseEmptyStatement(node) { - this.next(); - return this.finishNode(node, "EmptyStatement"); - } - - parseLabeledStatement(node, maybeName, expr, context) { - for (const label of this.state.labels) { - if (label.name === maybeName) { - this.raise(expr.start, ErrorMessages.LabelRedeclaration, maybeName); - } - } - - const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(70) ? "switch" : null; - - for (let i = this.state.labels.length - 1; i >= 0; i--) { - const label = this.state.labels[i]; - - if (label.statementStart === node.start) { - label.statementStart = this.state.start; - label.kind = kind; - } else { - break; - } - } - - this.state.labels.push({ - name: maybeName, - kind: kind, - statementStart: this.state.start - }); - node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); - this.state.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement"); - } - - parseExpressionStatement(node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement"); - } - - parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { - const node = this.startNode(); - - if (allowDirectives) { - this.state.strictErrors.clear(); - } - - this.expect(13); - - if (createNewLexicalScope) { - this.scope.enter(SCOPE_OTHER); - } - - this.parseBlockBody(node, allowDirectives, false, 16, afterBlockParse); - - if (createNewLexicalScope) { - this.scope.exit(); - } - - return this.finishNode(node, "BlockStatement"); - } - - isValidDirective(stmt) { - return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; - } - - parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { - const body = node.body = []; - const directives = node.directives = []; - this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); - } - - parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { - const oldStrict = this.state.strict; - let hasStrictModeDirective = false; - let parsedNonDirective = false; - - while (!this.match(end)) { - const stmt = this.parseStatement(null, topLevel); - - if (directives && !parsedNonDirective) { - if (this.isValidDirective(stmt)) { - const directive = this.stmtToDirective(stmt); - directives.push(directive); - - if (!hasStrictModeDirective && directive.value.value === "use strict") { - hasStrictModeDirective = true; - this.setStrict(true); - } - - continue; - } - - parsedNonDirective = true; - this.state.strictErrors.clear(); - } - - body.push(stmt); - } - - if (afterBlockParse) { - afterBlockParse.call(this, hasStrictModeDirective); - } - - if (!oldStrict) { - this.setStrict(false); - } - - this.next(); - } - - parseFor(node, init) { - node.init = init; - this.semicolon(false); - node.test = this.match(21) ? null : this.parseExpression(); - this.semicolon(false); - node.update = this.match(19) ? null : this.parseExpression(); - this.expect(19); - node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for")); - this.scope.exit(); - this.state.labels.pop(); - return this.finishNode(node, "ForStatement"); - } - - parseForIn(node, init, awaitAt) { - const isForIn = this.match(57); - this.next(); - - if (isForIn) { - if (awaitAt > -1) this.unexpected(awaitAt); - } else { - node.await = awaitAt > -1; - } - - if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { - this.raise(init.start, ErrorMessages.ForInOfLoopInitializer, isForIn ? "for-in" : "for-of"); - } else if (init.type === "AssignmentPattern") { - this.raise(init.start, ErrorMessages.InvalidLhs, "for-loop"); - } - - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); - this.expect(19); - node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for")); - this.scope.exit(); - this.state.labels.pop(); - return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); - } - - parseVar(node, isFor, kind) { - const declarations = node.declarations = []; - const isTypescript = this.hasPlugin("typescript"); - node.kind = kind; - - for (;;) { - const decl = this.startNode(); - this.parseVarId(decl, kind); - - if (this.eat(35)) { - decl.init = isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); - } else { - if (kind === "const" && !(this.match(57) || this.isContextual("of"))) { - if (!isTypescript) { - this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Const declarations"); - } - } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(57) || this.isContextual("of")))) { - this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Complex binding patterns"); - } - - decl.init = null; - } - - declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(20)) break; - } - - return node; - } - - parseVarId(decl, kind) { - decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, "variable declaration", kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, kind !== "var"); - } - - parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) { - const isStatement = statement & FUNC_STATEMENT; - const isHangingStatement = statement & FUNC_HANGING_STATEMENT; - const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID); - this.initFunction(node, isAsync); - - if (this.match(54) && isHangingStatement) { - this.raise(this.state.start, ErrorMessages.GeneratorInSingleStatementContext); - } - - node.generator = this.eat(54); - - if (isStatement) { - node.id = this.parseFunctionId(requireId); - } - - const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - this.state.maybeInArrowParameters = false; - this.scope.enter(SCOPE_FUNCTION); - this.prodParam.enter(functionFlags(isAsync, node.generator)); - - if (!isStatement) { - node.id = this.parseFunctionId(); - } - - this.parseFunctionParams(node, false); - this.withSmartMixTopicForbiddingContext(() => { - this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); - }); - this.prodParam.exit(); - this.scope.exit(); - - if (isStatement && !isHangingStatement) { - this.registerFunctionStatementId(node); - } - - this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - return node; - } - - parseFunctionId(requireId) { - return requireId || this.match(5) ? this.parseIdentifier() : null; - } - - parseFunctionParams(node, allowModifiers) { - this.expect(18); - this.expressionScope.enter(newParameterDeclarationScope()); - node.params = this.parseBindingList(19, 41, false, allowModifiers); - this.expressionScope.exit(); - } - - registerFunctionStatementId(node) { - if (!node.id) return; - this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.start); - } - - parseClass(node, isStatement, optionalId) { - this.next(); - this.takeDecorators(node); - const oldStrict = this.state.strict; - this.state.strict = true; - this.parseClassId(node, isStatement, optionalId); - this.parseClassSuper(node); - node.body = this.parseClassBody(!!node.superClass, oldStrict); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); - } - - isClassProperty() { - return this.match(35) || this.match(21) || this.match(16); - } - - isClassMethod() { - return this.match(18); - } - - isNonstaticConstructor(method) { - return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor"); - } - - parseClassBody(hadSuperClass, oldStrict) { - this.classScope.enter(); - const state = { - hadConstructor: false, - hadSuperClass - }; - let decorators = []; - const classBody = this.startNode(); - classBody.body = []; - this.expect(13); - this.withSmartMixTopicForbiddingContext(() => { - while (!this.match(16)) { - if (this.eat(21)) { - if (decorators.length > 0) { - throw this.raise(this.state.lastTokEnd, ErrorMessages.DecoratorSemicolon); - } - - continue; - } - - if (this.match(32)) { - decorators.push(this.parseDecorator()); - continue; - } - - const member = this.startNode(); - - if (decorators.length) { - member.decorators = decorators; - this.resetStartLocationFromNode(member, decorators[0]); - decorators = []; - } - - this.parseClassMember(classBody, member, state); - - if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { - this.raise(member.start, ErrorMessages.DecoratorConstructor); - } - } - }); - this.state.strict = oldStrict; - this.next(); - - if (decorators.length) { - throw this.raise(this.state.start, ErrorMessages.TrailingDecorator); - } - - this.classScope.exit(); - return this.finishNode(classBody, "ClassBody"); - } - - parseClassMemberFromModifier(classBody, member) { - const key = this.parseIdentifier(true); - - if (this.isClassMethod()) { - const method = member; - method.kind = "method"; - method.computed = false; - method.key = key; - method.static = false; - this.pushClassMethod(classBody, method, false, false, false, false); - return true; - } else if (this.isClassProperty()) { - const prop = member; - prop.computed = false; - prop.key = key; - prop.static = false; - classBody.body.push(this.parseClassProperty(prop)); - return true; - } - - this.resetPreviousNodeTrailingComments(key); - return false; - } - - parseClassMember(classBody, member, state) { - const isStatic = this.isContextual("static"); - - if (isStatic) { - if (this.parseClassMemberFromModifier(classBody, member)) { - return; - } - - if (this.eat(13)) { - this.parseClassStaticBlock(classBody, member); - return; - } - } - - this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); - } - - parseClassMemberWithIsStatic(classBody, member, state, isStatic) { - const publicMethod = member; - const privateMethod = member; - const publicProp = member; - const privateProp = member; - const method = publicMethod; - const publicMember = publicMethod; - member.static = isStatic; - - if (this.eat(54)) { - method.kind = "method"; - const isPrivateName = this.match(6); - this.parseClassElementName(method); - - if (isPrivateName) { - this.pushClassPrivateMethod(classBody, privateMethod, true, false); - return; - } - - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsGenerator); - } - - this.pushClassMethod(classBody, publicMethod, true, false, false, false); - return; - } - - const isContextual = this.match(5) && !this.state.containsEsc; - const isPrivate = this.match(6); - const key = this.parseClassElementName(member); - const maybeQuestionTokenStart = this.state.start; - this.parsePostMemberNameModifiers(publicMember); - - if (this.isClassMethod()) { - method.kind = "method"; - - if (isPrivate) { - this.pushClassPrivateMethod(classBody, privateMethod, false, false); - return; - } - - const isConstructor = this.isNonstaticConstructor(publicMethod); - let allowsDirectSuper = false; - - if (isConstructor) { - publicMethod.kind = "constructor"; - - if (state.hadConstructor && !this.hasPlugin("typescript")) { - this.raise(key.start, ErrorMessages.DuplicateConstructor); - } - - if (isConstructor && this.hasPlugin("typescript") && member.override) { - this.raise(key.start, ErrorMessages.OverrideOnConstructor); - } - - state.hadConstructor = true; - allowsDirectSuper = state.hadSuperClass; - } - - this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); - } else if (this.isClassProperty()) { - if (isPrivate) { - this.pushClassPrivateProperty(classBody, privateProp); - } else { - this.pushClassProperty(classBody, publicProp); - } - } else if (isContextual && key.name === "async" && !this.isLineTerminator()) { - this.resetPreviousNodeTrailingComments(key); - const isGenerator = this.eat(54); - - if (publicMember.optional) { - this.unexpected(maybeQuestionTokenStart); - } - - method.kind = "method"; - const isPrivate = this.match(6); - this.parseClassElementName(method); - this.parsePostMemberNameModifiers(publicMember); - - if (isPrivate) { - this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); - } else { - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAsync); - } - - this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); - } - } else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(54) && this.isLineTerminator())) { - this.resetPreviousNodeTrailingComments(key); - method.kind = key.name; - const isPrivate = this.match(6); - this.parseClassElementName(publicMethod); - - if (isPrivate) { - this.pushClassPrivateMethod(classBody, privateMethod, false, false); - } else { - if (this.isNonstaticConstructor(publicMethod)) { - this.raise(publicMethod.key.start, ErrorMessages.ConstructorIsAccessor); - } - - this.pushClassMethod(classBody, publicMethod, false, false, false, false); - } - - this.checkGetterSetterParams(publicMethod); - } else if (this.isLineTerminator()) { - if (isPrivate) { - this.pushClassPrivateProperty(classBody, privateProp); - } else { - this.pushClassProperty(classBody, publicProp); - } - } else { - this.unexpected(); - } - } - - parseClassElementName(member) { - const { - type, - value, - start - } = this.state; - - if ((type === 5 || type === 4) && member.static && value === "prototype") { - this.raise(start, ErrorMessages.StaticPrototype); - } - - if (type === 6 && value === "constructor") { - this.raise(start, ErrorMessages.ConstructorClassPrivateField); - } - - return this.parsePropertyName(member, true); - } - - parseClassStaticBlock(classBody, member) { - var _member$decorators; - - this.expectPlugin("classStaticBlock", member.start); - this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER); - const oldLabels = this.state.labels; - this.state.labels = []; - this.prodParam.enter(PARAM); - const body = member.body = []; - this.parseBlockOrModuleBlockBody(body, undefined, false, 16); - this.prodParam.exit(); - this.scope.exit(); - this.state.labels = oldLabels; - classBody.body.push(this.finishNode(member, "StaticBlock")); - - if ((_member$decorators = member.decorators) != null && _member$decorators.length) { - this.raise(member.start, ErrorMessages.DecoratorStaticBlock); - } - } - - pushClassProperty(classBody, prop) { - if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) { - this.raise(prop.key.start, ErrorMessages.ConstructorClassField); - } - - classBody.body.push(this.parseClassProperty(prop)); - } - - pushClassPrivateProperty(classBody, prop) { - const node = this.parseClassPrivateProperty(prop); - classBody.body.push(node); - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.start); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); - classBody.body.push(node); - const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER; - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.start); - } - - parsePostMemberNameModifiers(methodOrProp) {} - - parseClassPrivateProperty(node) { - this.parseInitializer(node); - this.semicolon(); - return this.finishNode(node, "ClassPrivateProperty"); - } - - parseClassProperty(node) { - this.parseInitializer(node); - this.semicolon(); - return this.finishNode(node, "ClassProperty"); - } - - parseInitializer(node) { - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); - this.expressionScope.enter(newExpressionScope()); - this.prodParam.enter(PARAM); - node.value = this.eat(35) ? this.parseMaybeAssignAllowIn() : null; - this.expressionScope.exit(); - this.prodParam.exit(); - this.scope.exit(); - } - - parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) { - if (this.match(5)) { - node.id = this.parseIdentifier(); - - if (isStatement) { - this.checkLVal(node.id, "class name", bindingType); - } - } else { - if (optionalId || !isStatement) { - node.id = null; - } else { - this.unexpected(null, ErrorMessages.MissingClassName); - } - } - } - - parseClassSuper(node) { - node.superClass = this.eat(80) ? this.parseExprSubscripts() : null; - } - - parseExport(node) { - const hasDefault = this.maybeParseExportDefaultSpecifier(node); - const parseAfterDefault = !hasDefault || this.eat(20); - const hasStar = parseAfterDefault && this.eatExportStar(node); - const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); - const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(20)); - const isFromRequired = hasDefault || hasStar; - - if (hasStar && !hasNamespace) { - if (hasDefault) this.unexpected(); - this.parseExportFrom(node, true); - return this.finishNode(node, "ExportAllDeclaration"); - } - - const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); - - if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) { - throw this.unexpected(null, 13); - } - - let hasDeclaration; - - if (isFromRequired || hasSpecifiers) { - hasDeclaration = false; - this.parseExportFrom(node, isFromRequired); - } else { - hasDeclaration = this.maybeParseExportDeclaration(node); - } - - if (isFromRequired || hasSpecifiers || hasDeclaration) { - this.checkExport(node, true, false, !!node.source); - return this.finishNode(node, "ExportNamedDeclaration"); - } - - if (this.eat(64)) { - node.declaration = this.parseExportDefaultExpression(); - this.checkExport(node, true, true); - return this.finishNode(node, "ExportDefaultDeclaration"); - } - - throw this.unexpected(null, 13); - } - - eatExportStar(node) { - return this.eat(54); - } - - maybeParseExportDefaultSpecifier(node) { - if (this.isExportDefaultSpecifier()) { - this.expectPlugin("exportDefaultFrom"); - const specifier = this.startNode(); - specifier.exported = this.parseIdentifier(true); - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - return true; - } - - return false; - } - - maybeParseExportNamespaceSpecifier(node) { - if (this.isContextual("as")) { - if (!node.specifiers) node.specifiers = []; - const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc); - this.next(); - specifier.exported = this.parseModuleExportName(); - node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); - return true; - } - - return false; - } - - maybeParseExportNamedSpecifiers(node) { - if (this.match(13)) { - if (!node.specifiers) node.specifiers = []; - node.specifiers.push(...this.parseExportSpecifiers()); - node.source = null; - node.declaration = null; - return true; - } - - return false; - } - - maybeParseExportDeclaration(node) { - if (this.shouldParseExportDeclaration()) { - node.specifiers = []; - node.source = null; - node.declaration = this.parseExportDeclaration(node); - return true; - } - - return false; - } - - isAsyncFunction() { - if (!this.isContextual("async")) return false; - const next = this.nextTokenStart(); - return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function"); - } - - parseExportDefaultExpression() { - const expr = this.startNode(); - const isAsync = this.isAsyncFunction(); - - if (this.match(67) || isAsync) { - this.next(); - - if (isAsync) { - this.next(); - } - - return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync); - } else if (this.match(79)) { - return this.parseClass(expr, true, true); - } else if (this.match(32)) { - if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.raise(this.state.start, ErrorMessages.DecoratorBeforeExport); - } - - this.parseDecorators(false); - return this.parseClass(expr, true, true); - } else if (this.match(74) || this.match(73) || this.isLet()) { - throw this.raise(this.state.start, ErrorMessages.UnsupportedDefaultExport); - } else { - const res = this.parseMaybeAssignAllowIn(); - this.semicolon(); - return res; - } - } - - parseExportDeclaration(node) { - return this.parseStatement(null); - } - - isExportDefaultSpecifier() { - if (this.match(5)) { - const value = this.state.value; - - if (value === "async" && !this.state.containsEsc || value === "let") { - return false; - } - - if ((value === "type" || value === "interface") && !this.state.containsEsc) { - const l = this.lookahead(); - - if (l.type === 5 && l.value !== "from" || l.type === 13) { - this.expectOnePlugin(["flow", "typescript"]); - return false; - } - } - } else if (!this.match(64)) { - return false; - } - - const next = this.nextTokenStart(); - const hasFrom = this.isUnparsedContextual(next, "from"); - - if (this.input.charCodeAt(next) === 44 || this.match(5) && hasFrom) { - return true; - } - - if (this.match(64) && hasFrom) { - const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); - return nextAfterFrom === 34 || nextAfterFrom === 39; - } - - return false; - } - - parseExportFrom(node, expect) { - if (this.eatContextual("from")) { - node.source = this.parseImportSource(); - this.checkExport(node); - const assertions = this.maybeParseImportAssertions(); - - if (assertions) { - node.assertions = assertions; - } - } else { - if (expect) { - this.unexpected(); - } else { - node.source = null; - } - } - - this.semicolon(); - } - - shouldParseExportDeclaration() { - const { - type - } = this.state; - - if (type === 32) { - this.expectOnePlugin(["decorators", "decorators-legacy"]); - - if (this.hasPlugin("decorators")) { - if (this.getPluginOption("decorators", "decoratorsBeforeExport")) { - this.unexpected(this.state.start, ErrorMessages.DecoratorBeforeExport); - } else { - return true; - } - } - } - - return type === 73 || type === 74 || type === 67 || type === 79 || this.isLet() || this.isAsyncFunction(); - } - - checkExport(node, checkNames, isDefault, isFrom) { - if (checkNames) { - if (isDefault) { - this.checkDuplicateExports(node, "default"); - - if (this.hasPlugin("exportDefaultFrom")) { - var _declaration$extra; - - const declaration = node.declaration; - - if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { - this.raise(declaration.start, ErrorMessages.ExportDefaultFromAsIdentifier); - } - } - } else if (node.specifiers && node.specifiers.length) { - for (const specifier of node.specifiers) { - const { - exported - } = specifier; - const exportedName = exported.type === "Identifier" ? exported.name : exported.value; - this.checkDuplicateExports(specifier, exportedName); - - if (!isFrom && specifier.local) { - const { - local - } = specifier; - - if (local.type !== "Identifier") { - this.raise(specifier.start, ErrorMessages.ExportBindingIsString, local.value, exportedName); - } else { - this.checkReservedWord(local.name, local.start, true, false); - this.scope.checkLocalExport(local); - } - } - } - } else if (node.declaration) { - if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { - const id = node.declaration.id; - if (!id) throw new Error("Assertion failure"); - this.checkDuplicateExports(node, id.name); - } else if (node.declaration.type === "VariableDeclaration") { - for (const declaration of node.declaration.declarations) { - this.checkDeclaration(declaration.id); - } - } - } - } - - const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; - - if (currentContextDecorators.length) { - throw this.raise(node.start, ErrorMessages.UnsupportedDecoratorExport); - } - } - - checkDeclaration(node) { - if (node.type === "Identifier") { - this.checkDuplicateExports(node, node.name); - } else if (node.type === "ObjectPattern") { - for (const prop of node.properties) { - this.checkDeclaration(prop); - } - } else if (node.type === "ArrayPattern") { - for (const elem of node.elements) { - if (elem) { - this.checkDeclaration(elem); - } - } - } else if (node.type === "ObjectProperty") { - this.checkDeclaration(node.value); - } else if (node.type === "RestElement") { - this.checkDeclaration(node.argument); - } else if (node.type === "AssignmentPattern") { - this.checkDeclaration(node.left); - } - } - - checkDuplicateExports(node, name) { - if (this.exportedIdentifiers.has(name)) { - this.raise(node.start, name === "default" ? ErrorMessages.DuplicateDefaultExport : ErrorMessages.DuplicateExport, name); - } - - this.exportedIdentifiers.add(name); - } - - parseExportSpecifiers() { - const nodes = []; - let first = true; - this.expect(13); - - while (!this.eat(16)) { - if (first) { - first = false; - } else { - this.expect(20); - if (this.eat(16)) break; - } - - const node = this.startNode(); - const isString = this.match(4); - const local = this.parseModuleExportName(); - node.local = local; - - if (this.eatContextual("as")) { - node.exported = this.parseModuleExportName(); - } else if (isString) { - node.exported = cloneStringLiteral(local); - } else { - node.exported = cloneIdentifier(local); - } - - nodes.push(this.finishNode(node, "ExportSpecifier")); - } - - return nodes; - } - - parseModuleExportName() { - if (this.match(4)) { - const result = this.parseStringLiteral(this.state.value); - const surrogate = result.value.match(loneSurrogate); - - if (surrogate) { - this.raise(result.start, ErrorMessages.ModuleExportNameHasLoneSurrogate, surrogate[0].charCodeAt(0).toString(16)); - } - - return result; - } - - return this.parseIdentifier(true); - } - - parseImport(node) { - node.specifiers = []; - - if (!this.match(4)) { - const hasDefault = this.maybeParseDefaultImportSpecifier(node); - const parseNext = !hasDefault || this.eat(20); - const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); - if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); - this.expectContextual("from"); - } - - node.source = this.parseImportSource(); - const assertions = this.maybeParseImportAssertions(); - - if (assertions) { - node.assertions = assertions; - } else { - const attributes = this.maybeParseModuleAttributes(); - - if (attributes) { - node.attributes = attributes; - } - } - - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); - } - - parseImportSource() { - if (!this.match(4)) this.unexpected(); - return this.parseExprAtom(); - } - - shouldParseDefaultImport(node) { - return this.match(5); - } - - parseImportSpecifierLocal(node, specifier, type, contextDescription) { - specifier.local = this.parseIdentifier(); - this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, type)); - } - - parseAssertEntries() { - const attrs = []; - const attrNames = new Set(); - - do { - if (this.match(16)) { - break; - } - - const node = this.startNode(); - const keyName = this.state.value; - - if (attrNames.has(keyName)) { - this.raise(this.state.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, keyName); - } - - attrNames.add(keyName); - - if (this.match(4)) { - node.key = this.parseStringLiteral(keyName); - } else { - node.key = this.parseIdentifier(true); - } - - this.expect(22); - - if (!this.match(4)) { - throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue); - } - - node.value = this.parseStringLiteral(this.state.value); - this.finishNode(node, "ImportAttribute"); - attrs.push(node); - } while (this.eat(20)); - - return attrs; - } - - maybeParseModuleAttributes() { - if (this.match(75) && !this.hasPrecedingLineBreak()) { - this.expectPlugin("moduleAttributes"); - this.next(); - } else { - if (this.hasPlugin("moduleAttributes")) return []; - return null; - } - - const attrs = []; - const attributes = new Set(); - - do { - const node = this.startNode(); - node.key = this.parseIdentifier(true); - - if (node.key.name !== "type") { - this.raise(node.key.start, ErrorMessages.ModuleAttributeDifferentFromType, node.key.name); - } - - if (attributes.has(node.key.name)) { - this.raise(node.key.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, node.key.name); - } - - attributes.add(node.key.name); - this.expect(22); - - if (!this.match(4)) { - throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue); - } - - node.value = this.parseStringLiteral(this.state.value); - this.finishNode(node, "ImportAttribute"); - attrs.push(node); - } while (this.eat(20)); - - return attrs; - } - - maybeParseImportAssertions() { - if (this.isContextual("assert") && !this.hasPrecedingLineBreak()) { - this.expectPlugin("importAssertions"); - this.next(); - } else { - if (this.hasPlugin("importAssertions")) return []; - return null; - } - - this.eat(13); - const attrs = this.parseAssertEntries(); - this.eat(16); - return attrs; - } - - maybeParseDefaultImportSpecifier(node) { - if (this.shouldParseDefaultImport(node)) { - this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier"); - return true; - } - - return false; - } - - maybeParseStarImportSpecifier(node) { - if (this.match(54)) { - const specifier = this.startNode(); - this.next(); - this.expectContextual("as"); - this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier"); - return true; - } - - return false; - } - - parseNamedImportSpecifiers(node) { - let first = true; - this.expect(13); - - while (!this.eat(16)) { - if (first) { - first = false; - } else { - if (this.eat(22)) { - throw this.raise(this.state.start, ErrorMessages.DestructureNamedImport); - } - - this.expect(20); - if (this.eat(16)) break; - } - - this.parseImportSpecifier(node); - } - } - - parseImportSpecifier(node) { - const specifier = this.startNode(); - const importedIsString = this.match(4); - specifier.imported = this.parseModuleExportName(); - - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); - } else { - const { - imported - } = specifier; - - if (importedIsString) { - throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, imported.value); - } - - this.checkReservedWord(imported.name, specifier.start, true, true); - specifier.local = cloneIdentifier(imported); - } - - this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - } - - isThisParam(param) { - return param.type === "Identifier" && param.name === "this"; - } - -} - -class Parser extends StatementParser { - constructor(options, input) { - options = getOptions(options); - super(options, input); - this.options = options; - this.initializeScopes(); - this.plugins = pluginsMap(this.options.plugins); - this.filename = options.sourceFilename; - } - - getScopeHandler() { - return ScopeHandler; - } - - parse() { - this.enterInitialScopes(); - const file = this.startNode(); - const program = this.startNode(); - this.nextToken(); - file.errors = null; - this.parseTopLevel(file, program); - file.errors = this.state.errors; - return file; - } - -} - -function pluginsMap(plugins) { - const pluginMap = new Map(); - - for (const plugin of plugins) { - const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}]; - if (!pluginMap.has(name)) pluginMap.set(name, options || {}); - } - - return pluginMap; -} - -function parse(input, options) { - var _options; - - if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { - options = Object.assign({}, options); - - try { - options.sourceType = "module"; - const parser = getParser(options, input); - const ast = parser.parse(); - - if (parser.sawUnambiguousESM) { - return ast; - } - - if (parser.ambiguousScriptDifferentAst) { - try { - options.sourceType = "script"; - return getParser(options, input).parse(); - } catch (_unused) {} - } else { - ast.program.sourceType = "script"; - } - - return ast; - } catch (moduleError) { - try { - options.sourceType = "script"; - return getParser(options, input).parse(); - } catch (_unused2) {} - - throw moduleError; - } - } else { - return getParser(options, input).parse(); - } -} -function parseExpression(input, options) { - const parser = getParser(options, input); - - if (parser.options.strictMode) { - parser.state.strict = true; - } - - return parser.getExpression(); -} - -function generateExportedTokenTypes(internalTokenTypes) { - const tokenTypes = {}; - - for (const typeName of Object.keys(internalTokenTypes)) { - tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]); - } - - return tokenTypes; -} - -const tokTypes = generateExportedTokenTypes(tt); - -function getParser(options, input) { - let cls = Parser; - - if (options != null && options.plugins) { - validatePlugins(options.plugins); - cls = getParserClass(options.plugins); - } - - return new cls(options, input); -} - -const parserClassCache = {}; - -function getParserClass(pluginsFromOptions) { - const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name)); - const key = pluginList.join("/"); - let cls = parserClassCache[key]; - - if (!cls) { - cls = Parser; - - for (const plugin of pluginList) { - cls = mixinPlugins[plugin](cls); - } - - parserClassCache[key] = cls; - } - - return cls; -} - -exports.parse = parse; -exports.parseExpression = parseExpression; -exports.tokTypes = tokTypes; -//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js.map b/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js.map deleted file mode 100644 index 15ad24ac..00000000 --- a/node_modules/@babel/core/node_modules/@babel/parser/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/util/whitespace.js","../src/util/location.js","../src/parser/base.js","../src/parser/comments.js","../src/parser/error-codes.js","../src/parser/error-message.js","../src/parser/error.js","../src/plugins/estree.js","../src/tokenizer/context.js","../src/tokenizer/types.js","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.js","../src/util/scopeflags.js","../src/util/scope.js","../src/plugins/flow/scope.js","../src/tokenizer/state.js","../src/tokenizer/index.js","../src/util/class-scope.js","../src/util/expression-scope.js","../src/util/production-parameter.js","../src/parser/util.js","../src/parser/node.js","../src/plugins/flow/index.js","../src/plugins/jsx/xhtml.js","../src/plugins/jsx/index.js","../src/plugins/typescript/scope.js","../src/plugins/typescript/index.js","../src/plugins/placeholders.js","../src/plugins/v8intrinsic.js","../src/plugin-utils.js","../src/options.js","../src/parser/lval.js","../src/parser/expression.js","../src/parser/statement.js","../src/parser/index.js","../src/index.js"],"sourcesContent":["// @flow\n\nimport * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/y;\n\n// Skip whitespace and single-line comments, including /* no newline here */.\n// After this RegExp matches, its lastIndex points to a line terminator, or\n// the start of multi-line comment (which is effectively a line terminator),\n// or the end of string.\nexport const skipWhiteSpaceToLineBreak = new RegExp(\n // Unfortunately JS doesn't support Perl's atomic /(?>pattern)/ or\n // possessive quantifiers, so we use a trick to prevent backtracking\n // when the look-ahead for line terminator fails.\n \"(?=(\" +\n // Capture the whitespace and comments that should be skipped inside\n // a look-ahead assertion, and then re-match the group as a unit.\n skipWhiteSpaceInLine.source +\n \"))\\\\1\" +\n // Look-ahead for either line terminator, start of multi-line comment,\n // or end of string.\n /(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)/.source,\n \"y\", // sticky\n);\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","// @flow\n\nimport { lineBreakG } from \"./whitespace\";\n\nexport type Pos = {\n start: number,\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n\n constructor(line: number, col: number) {\n this.line = line;\n this.column = col;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: ?string;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // $FlowIgnore (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nexport function getLineInfo(input: string, offset: number): Position {\n let line = 1;\n let lineStart = 0;\n let match;\n lineBreakG.lastIndex = 0;\n while ((match = lineBreakG.exec(input)) && match.index < offset) {\n line++;\n lineStart = lineBreakG.lastIndex;\n }\n\n return new Position(line, offset - lineStart);\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ExpressionScopeHandler from \"../util/expression-scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler<*>;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: ?string;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n\n hasPlugin(name: string): boolean {\n return this.plugins.has(name);\n }\n\n getPluginOption(plugin: string, name: string) {\n // $FlowIssue\n if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];\n }\n}\n","// @flow\n\n/*:: declare var invariant; */\n\nimport BaseParser from \"./base\";\nimport type { Comment, Node } from \"../types\";\nimport * as charCodes from \"charcodes\";\n\n/**\n * A whitespace token containing comments\n * @typedef CommentWhitespace\n * @type {object}\n * @property {number} start - the start of the whitespace token.\n * @property {number} end - the end of the whitespace token.\n * @property {Array} comments - the containing comments\n * @property {Node | null} leadingNode - the immediately preceding AST node of the whitespace token\n * @property {Node | null} trailingNode - the immediately following AST node of the whitespace token\n * @property {Node | null} containingNode - the innermost AST node containing the whitespace\n * with minimal size (|end - start|)\n */\nexport type CommentWhitespace = {\n start: number,\n end: number,\n comments: Array,\n leadingNode: Node | null,\n trailingNode: Node | null,\n containingNode: Node | null,\n};\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n *\n * @param {Node} node\n * @param {Array} comments\n */\nfunction setTrailingComments(node: Node, comments: Array) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n *\n * @param {Node} node\n * @param {Array} comments\n */\nexport function setInnerComments(node: Node, comments: Array | void) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else if (comments !== undefined) {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n *\n * @param {Node} node\n * @param {Array} elements\n * @param {Array} comments\n */\nfunction adjustInnerComments(\n node: Node,\n elements: Array,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\n/** @class CommentsParser */\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.comments.push(comment);\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n *\n * @param {Node} node\n * @returns {void}\n * @memberof CommentsParser\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n *\n * @memberof CommentsParser\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n commentWS.trailingNode.leadingComments = comments;\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (this.input.charCodeAt(commentStart - 1) === charCodes.comma) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaning commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n *\n * @memberof CommentsParser\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterepret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing */\n // async /* 1 */ function f() {}\n /*\n * the comment whitespace \"* 1 *\" has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark \"* 1 *\" as\n * inner comments. So \"* 1 *\" should be detached from the Identifier node.\n *\n * @param {N.Node} node the last finished AST node _before_ current token\n * @returns\n * @memberof CommentsParser\n */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n}\n","// @flow\n\nexport const ErrorCodes = Object.freeze({\n SyntaxError: \"BABEL_PARSER_SYNTAX_ERROR\",\n SourceTypeModuleError: \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\",\n});\n\nexport type ErrorCode = $Values;\n","// @flow\n\nimport { makeErrorTemplates, ErrorCodes } from \"./error\";\n\n/* eslint sort-keys: \"error\" */\n\n/**\n * @module parser/error-message\n */\n\n// The Errors key follows https://cs.chromium.org/chromium/src/v8/src/common/message-template.h unless it does not exist\nexport const ErrorMessages = makeErrorTemplates(\n {\n AccessorIsGenerator: \"A %0ter cannot be a generator.\",\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter:\n \"'await' is not allowed in async function parameters.\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions.\",\n BadGetterArity: \"A 'get' accesor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accesor must have exactly one formal parameter.\",\n BadSetterRestParameter:\n \"A 'set' accesor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: \"'%0' require an initialization value.\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport:\n \"`%0` has already been exported. Exported identifiers must be unique.\",\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString:\n \"A string literal cannot be used as an exported binding without `from`.\\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?\",\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'.\",\n ForInOfLoopInitializer:\n \"'%0' loop variable declaration may not have an initializer.\",\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block.\",\n IllegalBreakContinue: \"Unsyntactic %0.\",\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportBindingIsString:\n 'A string literal cannot be used as an imported binding.\\n- Did you mean `import { \"%0\" as foo }`?',\n ImportCallArgumentTrailingComma:\n \"Trailing comma is disallowed inside import(...) arguments.\",\n ImportCallArity: \"`import()` requires exactly %0.\",\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: \"Expected number in radix %0.\",\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: \"Escape sequence in keyword %0.\",\n InvalidIdentifier: \"Invalid identifier %0.\",\n InvalidLhs: \"Invalid left-hand side in %0.\",\n InvalidLhsBinding: \"Binding invalid left-hand side in %0.\",\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: \"Unexpected character '%0'.\",\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: \"Private name #%0 is not defined.\",\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: \"Label '%0' is already declared.\",\n LetInLexicalBinding:\n \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys:\n 'Duplicate key \"%0\" is not allowed in module attributes.',\n ModuleExportNameHasLoneSurrogate:\n \"An export name cannot include a lone surrogate, found '\\\\u%0'.\",\n ModuleExportUndefined: \"Export '%0' is not defined.\",\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar:\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor:\n \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected %0 after pipeline body; any %0 expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken:\n 'Invalid topic token %0. In order to use %0 as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"%0\" }.',\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody:\n \"Hack-style pipe body cannot be an unparenthesized %0 expression; please wrap it in parentheses.\",\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n\n PrivateInExpectedIn:\n \"Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`).\",\n PrivateNameRedeclaration: \"Duplicate private name #%0.\",\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n StaticPrototype: \"Classes may not have static property named prototype.\",\n StrictDelete: \"Deleting local variable in strict mode.\",\n StrictEvalArguments: \"Assigning to '%0' in strict mode.\",\n StrictEvalArgumentsBinding: \"Binding '%0' in strict mode.\",\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n StrictNumericEscape:\n \"The only valid numeric escape in strict mode is '\\\\0'.\",\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n StrictWith: \"'with' in strict mode.\",\n SuperNotAllowed:\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: \"Unexpected keyword '%0'.\",\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget:\n \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField:\n \"Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\\n or a property of member expression (i.e. this.#p).\",\n UnexpectedReservedWord: \"Unexpected reserved word '%0'.\",\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: \"Unexpected token '%0'.\",\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport:\n \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: \"The only valid meta property for %0 is %0.%1.\",\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper:\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n VarRedeclaration: \"Identifier '%0' has already been declared.\",\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0.\",\n },\n /* code */ ErrorCodes.SyntaxError,\n);\n\nexport const SourceTypeModuleErrorMessages = makeErrorTemplates(\n {\n ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: \"module\"'`,\n ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n },\n /* code */ ErrorCodes.SourceTypeModuleError,\n);\n","// @flow\n/* eslint sort-keys: \"error\" */\nimport { getLineInfo, type Position } from \"../util/location\";\nimport CommentsParser from \"./comments\";\nimport { type ErrorCode, ErrorCodes } from \"./error-codes\";\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\ntype ErrorContext = {\n pos: number,\n loc: Position,\n missingPlugin?: Array,\n code?: string,\n reasonCode?: String,\n};\nexport type ParsingError = SyntaxError & ErrorContext;\n\nexport type ErrorTemplate = {\n code: ErrorCode,\n template: string,\n reasonCode: string,\n};\nexport type ErrorTemplates = {\n [key: string]: ErrorTemplate,\n};\n\ntype SyntaxPlugin = \"flow\" | \"typescript\" | \"jsx\" | typeof undefined;\n\nfunction keepReasonCodeCompat(reasonCode: string, syntaxPlugin: SyntaxPlugin) {\n if (!process.env.BABEL_8_BREAKING) {\n // For consistency in TypeScript and Flow error codes\n if (syntaxPlugin === \"flow\" && reasonCode === \"PatternIsOptional\") {\n return \"OptionalBindingPattern\";\n }\n }\n return reasonCode;\n}\n\nexport function makeErrorTemplates(\n messages: {\n [key: string]: string,\n },\n code: ErrorCode,\n syntaxPlugin?: SyntaxPlugin,\n): ErrorTemplates {\n const templates: ErrorTemplates = {};\n Object.keys(messages).forEach(reasonCode => {\n templates[reasonCode] = Object.freeze({\n code,\n reasonCode: keepReasonCodeCompat(reasonCode, syntaxPlugin),\n template: messages[reasonCode],\n });\n });\n return Object.freeze(templates);\n}\n\nexport { ErrorCodes };\nexport {\n ErrorMessages as Errors,\n SourceTypeModuleErrorMessages as SourceTypeModuleErrors,\n} from \"./error-message\";\n\nexport type raiseFunction = (number, ErrorTemplate, ...any) => void;\n\nexport default class ParserError extends CommentsParser {\n // Forward-declaration: defined in tokenizer/index.js\n /*::\n +isLookahead: boolean;\n */\n\n getLocationForPosition(pos: number): Position {\n let loc;\n if (pos === this.state.start) loc = this.state.startLoc;\n else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;\n else if (pos === this.state.end) loc = this.state.endLoc;\n else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;\n else loc = getLineInfo(this.input, pos);\n\n return loc;\n }\n\n raise(\n pos: number,\n { code, reasonCode, template }: ErrorTemplate,\n ...params: any\n ): Error | empty {\n return this.raiseWithData(pos, { code, reasonCode }, template, ...params);\n }\n\n /**\n * Raise a parsing error on given position pos. If errorRecovery is true,\n * it will first search current errors and overwrite the error thrown on the exact\n * position before with the new error message. If errorRecovery is false, it\n * fallbacks to `raise`.\n *\n * @param {number} pos\n * @param {string} errorTemplate\n * @param {...any} params\n * @returns {(Error | empty)}\n * @memberof ParserError\n */\n raiseOverwrite(\n pos: number,\n { code, template }: ErrorTemplate,\n ...params: any\n ): Error | empty {\n const loc = this.getLocationForPosition(pos);\n const message =\n template.replace(/%(\\d+)/g, (_, i: number) => params[i]) +\n ` (${loc.line}:${loc.column})`;\n if (this.options.errorRecovery) {\n const errors = this.state.errors;\n for (let i = errors.length - 1; i >= 0; i--) {\n const error = errors[i];\n if (error.pos === pos) {\n return Object.assign(error, { message });\n } else if (error.pos < pos) {\n break;\n }\n }\n }\n return this._raise({ code, loc, pos }, message);\n }\n\n raiseWithData(\n pos: number,\n data?: {\n missingPlugin?: Array,\n code?: string,\n },\n errorTemplate: string,\n ...params: any\n ): Error | empty {\n const loc = this.getLocationForPosition(pos);\n const message =\n errorTemplate.replace(/%(\\d+)/g, (_, i: number) => params[i]) +\n ` (${loc.line}:${loc.column})`;\n return this._raise(Object.assign(({ loc, pos }: Object), data), message);\n }\n\n _raise(errorContext: ErrorContext, message: string): Error | empty {\n // $FlowIgnore\n const err: SyntaxError & ErrorContext = new SyntaxError(message);\n Object.assign(err, errorContext);\n if (this.options.errorRecovery) {\n if (!this.isLookahead) this.state.errors.push(err);\n return err;\n } else {\n throw err;\n }\n }\n}\n","// @flow\n\nimport { type TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport * as N from \"../types\";\nimport type { Position } from \"../util/location\";\nimport { Errors } from \"../parser/error\";\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n parseRegExpLiteral({ pattern, flags }): N.Node {\n let regex = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt;\n try {\n // $FlowIgnore\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any) {\n return this.parseLiteral(value, \"Literal\");\n }\n\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n return this.estreeParseLiteral(value);\n }\n\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const directiveLiteral = directive.value;\n\n const stmt = this.startNodeAt(directive.start, directive.loc.start);\n const expression = this.startNodeAt(\n directiveLiteral.start,\n directiveLiteral.loc.start,\n );\n\n expression.value = directiveLiteral.extra.expressionValue;\n expression.raw = directiveLiteral.extra.raw;\n\n stmt.expression = this.finishNodeAt(\n expression,\n \"Literal\",\n directiveLiteral.end,\n directiveLiteral.loc.end,\n );\n stmt.directive = directiveLiteral.extra.raw.slice(1, -1);\n\n return this.finishNodeAt(\n stmt,\n \"ExpressionStatement\",\n directive.end,\n directive.loc.end,\n );\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(\n node: N.BodilessFunctionOrMethodBase,\n isAsync: ?boolean,\n ): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n this.checkDeclaration(((node: any): N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return ((method: any): N.EstreeProperty | N.EstreeMethodDefinition).value\n .params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n stmtToDirective(stmt: N.Statement): N.Directive {\n const value = stmt.expression.value;\n const directive = super.stmtToDirective(stmt);\n\n // Record the expression value as in estree mode we want\n // the stmt to have the real value e.g. (\"use strict\") and\n // not the raw value e.g. (\"use\\\\x20strict\")\n this.addExtra(directive.value, \"expressionValue\", value);\n\n return directive;\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n ...args: [?boolean, boolean, TokenType, void | (boolean => void)]\n ): void {\n super.parseBlockBody(node, ...args);\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n node.body = directiveStatements.concat(node.body);\n // $FlowIgnore - directives isn't optional in the type definition\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // $FlowIgnore\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = (node: any);\n delete node.id;\n node.name = name;\n node.type = \"PrivateIdentifier\";\n return node;\n }\n\n isPrivateName(node: N.Node): boolean {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n getPrivateNameSV(node: N.Node): string {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node);\n }\n return node.name;\n }\n\n parseLiteral(value: any, type: $ElementType): T {\n const node = super.parseLiteral(value, type);\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression: ?boolean,\n isMethod?: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n parseMethod(\n node: T,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: string,\n inClassScope: boolean = false,\n ): T {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // $FlowIgnore\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n // $FlowIgnore\n node.computed = false;\n }\n type = \"MethodDefinition\";\n return this.finishNode(node, type);\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = (super.parseClassProperty(...args): any);\n if (this.getPluginOption(\"estree\", \"classFeatures\")) {\n propertyNode.type = \"PropertyDefinition\";\n }\n return (propertyNode: N.EstreePropertyDefinition);\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = (super.parseClassPrivateProperty(...args): any);\n if (this.getPluginOption(\"estree\", \"classFeatures\")) {\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n }\n return (propertyNode: N.EstreePropertyDefinition);\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): ?N.ObjectMethod {\n const node: N.EstreeProperty = (super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ): any);\n\n if (node) {\n node.type = \"Property\";\n if (((node: any): N.ClassMethod).kind === \"method\") node.kind = \"init\";\n node.shorthand = false;\n }\n\n return (node: any);\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startPos: ?number,\n startLoc: ?Position,\n isPattern: boolean,\n refExpressionErrors: ?ExpressionErrors,\n ): ?N.ObjectProperty {\n const node: N.EstreeProperty = (super.parseObjectProperty(\n prop,\n startPos,\n startLoc,\n isPattern,\n refExpressionErrors,\n ): any);\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return (node: any);\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): N.Node {\n if (node != null && this.isObjectProperty(node)) {\n this.toAssignable(node.value, isLHS);\n\n return node;\n }\n\n return super.toAssignable(node, isLHS);\n }\n\n toAssignableObjectExpressionProp(prop: N.Node, ...args) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(prop.key.start, Errors.PatternHasAccessor);\n } else if (prop.method) {\n this.raise(prop.key.start, Errors.PatternHasMethod);\n } else {\n super.toAssignableObjectExpressionProp(prop, ...args);\n }\n }\n\n finishCallExpression(\n node: T,\n optional: boolean,\n ): N.Expression {\n super.finishCallExpression(node, optional);\n\n if (node.callee.type === \"Import\") {\n ((node: N.Node): N.EstreeImportExpression).type = \"ImportExpression\";\n ((node: N.Node): N.EstreeImportExpression).source = node.arguments[0];\n if (this.hasPlugin(\"importAssertions\")) {\n ((node: N.Node): N.EstreeImportExpression).attributes =\n node.arguments[1] ?? null;\n }\n // $FlowIgnore - arguments isn't optional in the type definition\n delete node.arguments;\n // $FlowIgnore - callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(node: N.Node) {\n super.parseExport(node);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n node.type = \"ExportAllDeclaration\";\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n state: N.ParseSubscriptState,\n ) {\n const node = super.parseSubscript(\n base,\n startPos,\n startLoc,\n noCalls,\n state,\n );\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n node.type = node.type.substring(8); // strip Optional prefix\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n node.optional = false;\n }\n\n return node;\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n isOptionalChain(node: N.Node): boolean {\n return node.type === \"ChainExpression\";\n }\n\n isObjectProperty(node: N.Node): boolean {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n isObjectMethod(node: N.Node): boolean {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n };\n","// @flow\n\n// The token context is used to track whether the apostrophe \"`\"\n// starts or ends a string template\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nexport const types: {\n [key: string]: TokContext,\n} = {\n brace: new TokContext(\"{\"),\n template: new TokContext(\"`\", true),\n};\n","// @flow\nimport { types as tc, type TokContext } from \"./context\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string,\n beforeExpr?: boolean,\n startsExpr?: boolean,\n rightAssociative?: boolean,\n isLoop?: boolean,\n isAssign?: boolean,\n prefix?: boolean,\n postfix?: boolean,\n binop?: ?number,\n};\n\n// Internally the tokenizer stores token as a number\nexport opaque type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: ?string;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: ?number;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext: ?(context: Array) => void;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport const tt: { [name: string]: TokenType } = {\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n decimal: createToken(\"decimal\", { startsExpr }),\n regexp: createToken(\"regexp\", { startsExpr }),\n string: createToken(\"string\", { startsExpr }),\n name: createToken(\"name\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\", { beforeExpr }),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // This is only needed to support % as a Hack-pipe topic token. If the proposal\n // ends up choosing a different token, it can be merged with tt.assign.\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n relational: createBinop(\"/<=/>=\", 7),\n bitShift: createBinop(\"<>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr: true }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr: true }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr: true }),\n};\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n","import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,46,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,482,44,11,6,17,0,322,29,19,43,1269,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4152,8,221,3,5761,15,7472,3104,541,1507,4938];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","/* eslint max-len: 0 */\n\n// @flow\n\nimport * as charCodes from \"charcodes\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(current: number, next: number): boolean {\n return current === charCodes.atSign && next === charCodes.atSign;\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n","// @flow\n\n// Each scope gets a bitset that may contain these flags\n// prettier-ignore\nexport const SCOPE_OTHER = 0b000000000,\n SCOPE_PROGRAM = 0b000000001,\n SCOPE_FUNCTION = 0b000000010,\n SCOPE_ARROW = 0b000000100,\n SCOPE_SIMPLE_CATCH = 0b000001000,\n SCOPE_SUPER = 0b000010000,\n SCOPE_DIRECT_SUPER = 0b000100000,\n SCOPE_CLASS = 0b001000000,\n SCOPE_STATIC_BLOCK = 0b010000000,\n SCOPE_TS_MODULE = 0b100000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;\n\nexport type ScopeFlags =\n | typeof SCOPE_OTHER\n | typeof SCOPE_PROGRAM\n | typeof SCOPE_FUNCTION\n | typeof SCOPE_VAR\n | typeof SCOPE_ARROW\n | typeof SCOPE_SIMPLE_CATCH\n | typeof SCOPE_SUPER\n | typeof SCOPE_DIRECT_SUPER\n | typeof SCOPE_CLASS\n | typeof SCOPE_STATIC_BLOCK;\n\n// These flags are meant to be _only_ used inside the Scope class (or subclasses).\n// prettier-ignore\nexport const BIND_KIND_VALUE = 0b000000_0000_01,\n BIND_KIND_TYPE = 0b000000_0000_10,\n // Used in checkLVal and declareName to determine the type of a binding\n BIND_SCOPE_VAR = 0b000000_0001_00, // Var-style binding\n BIND_SCOPE_LEXICAL = 0b000000_0010_00, // Let- or const-style binding\n BIND_SCOPE_FUNCTION = 0b000000_0100_00, // Function declaration\n BIND_SCOPE_OUTSIDE = 0b000000_1000_00, // Special case for function names as\n // bound inside the function\n // Misc flags\n BIND_FLAGS_NONE = 0b000001_0000_00,\n BIND_FLAGS_CLASS = 0b000010_0000_00,\n BIND_FLAGS_TS_ENUM = 0b000100_0000_00,\n BIND_FLAGS_TS_CONST_ENUM = 0b001000_0000_00,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b010000_0000_00,\n BIND_FLAGS_FLOW_DECLARE_FN = 0b100000_0000_00;\n\n// These flags are meant to be _only_ used by Scope consumers\n// prettier-ignore\n/* = is value? | is type? | scope | misc flags */\nexport const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS ,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0 ,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0 ,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0 ,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS ,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0 ,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n // These bindings don't introduce anything in the scope. They are used for assignments and\n // function expressions IDs.\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE ,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE ,\n\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n\n BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;\n\nexport type BindingTypes =\n | typeof BIND_NONE\n | typeof BIND_OUTSIDE\n | typeof BIND_VAR\n | typeof BIND_LEXICAL\n | typeof BIND_CLASS\n | typeof BIND_FUNCTION\n | typeof BIND_TS_INTERFACE\n | typeof BIND_TS_TYPE\n | typeof BIND_TS_ENUM\n | typeof BIND_TS_AMBIENT\n | typeof BIND_TS_NAMESPACE;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_FLAG_STATIC = 0b1_00,\n CLASS_ELEMENT_KIND_GETTER = 0b0_10,\n CLASS_ELEMENT_KIND_SETTER = 0b0_01,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nexport type ClassElementTypes =\n | typeof CLASS_ELEMENT_STATIC_GETTER\n | typeof CLASS_ELEMENT_STATIC_SETTER\n | typeof CLASS_ELEMENT_INSTANCE_GETTER\n | typeof CLASS_ELEMENT_INSTANCE_SETTER\n | typeof CLASS_ELEMENT_OTHER;\n","// @flow\nimport {\n SCOPE_ARROW,\n SCOPE_DIRECT_SUPER,\n SCOPE_FUNCTION,\n SCOPE_SIMPLE_CATCH,\n SCOPE_SUPER,\n SCOPE_PROGRAM,\n SCOPE_VAR,\n SCOPE_CLASS,\n SCOPE_STATIC_BLOCK,\n BIND_SCOPE_FUNCTION,\n BIND_SCOPE_VAR,\n BIND_SCOPE_LEXICAL,\n BIND_KIND_VALUE,\n type ScopeFlags,\n type BindingTypes,\n} from \"./scopeflags\";\nimport * as N from \"../types\";\nimport { Errors, type raiseFunction } from \"../parser/error\";\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n declare flags: ScopeFlags;\n // A set of var-declared names in the current lexical scope\n var: Set = new Set();\n // A set of lexically-declared names in the current lexical scope\n lexical: Set = new Set();\n // A set of lexically-declared FunctionDeclaration names in the current lexical scope\n functions: Set = new Set();\n\n constructor(flags: ScopeFlags) {\n this.flags = flags;\n }\n}\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler {\n scopeStack: Array = [];\n declare raise: raiseFunction;\n declare inModule: boolean;\n undefinedExports: Map = new Map();\n undefinedPrivateNames: Map = new Map();\n\n constructor(raise: raiseFunction, inModule: boolean) {\n this.raise = raise;\n this.inModule = inModule;\n }\n\n get inFunction() {\n return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0;\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & SCOPE_STATIC_BLOCK) {\n return true;\n }\n if (flags & (SCOPE_VAR | SCOPE_CLASS)) {\n // function body, module body, class property initializers\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlags): Scope {\n return new Scope(flags);\n }\n // This method will be overwritten by subclasses\n /*:: +createScope: (flags: ScopeFlags) => IScope; */\n\n enter(flags: ScopeFlags) {\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit() {\n this.scopeStack.pop();\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & SCOPE_FUNCTION ||\n (!this.inModule && scope.flags & SCOPE_PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingTypes, pos: number) {\n let scope = this.currentScope();\n if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n scope.functions.add(name);\n } else {\n scope.lexical.add(name);\n }\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BIND_SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n scope.var.add(name);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & SCOPE_VAR) break;\n }\n }\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n pos: number,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.raise(pos, Errors.VarRedeclaration, name);\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (!(bindingType & BIND_KIND_VALUE)) return false;\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n return (\n scope.lexical.has(name) ||\n scope.functions.has(name) ||\n scope.var.has(name)\n );\n }\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n return (\n scope.lexical.has(name) ||\n (!this.treatFunctionsAsVarInScope(scope) && scope.var.has(name))\n );\n }\n\n return (\n (scope.lexical.has(name) &&\n !(\n scope.flags & SCOPE_SIMPLE_CATCH &&\n scope.lexical.values().next().value === name\n )) ||\n (!this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name))\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n const topLevelScope = this.scopeStack[0];\n if (\n !topLevelScope.lexical.has(name) &&\n !topLevelScope.var.has(name) &&\n // In strict mode, scope.functions will always be empty.\n // Modules are strict by default, but the `scriptMode` option\n // can overwrite this behavior.\n !topLevelScope.functions.has(name)\n ) {\n this.undefinedExports.set(name, id.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n // $FlowIgnore\n currentVarScopeFlags(): ScopeFlags {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & SCOPE_VAR) {\n return flags;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n // $FlowIgnore\n currentThisScopeFlags(): ScopeFlags {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) {\n return flags;\n }\n }\n }\n}\n","// @flow\n\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_FLAGS_FLOW_DECLARE_FN,\n type ScopeFlags,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport * as N from \"../../types\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlags): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingTypes, pos: number) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(...arguments);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (super.isRedeclaredInScope(...arguments)) return true;\n\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n return (\n !scope.declareFunctions.has(name) &&\n (scope.lexical.has(name) || scope.functions.has(name))\n );\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location\";\n\nimport { types as ct, type TokContext } from \"./context\";\nimport { tt, type TokenType } from \"./types\";\nimport type { ParsingError, ErrorTemplate } from \"../parser/error\";\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number,\n\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0,\n};\n\nexport default class State {\n strict: boolean;\n curLine: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init(options: Options): void {\n this.strict =\n options.strictMode === false\n ? false\n : options.strictMode === true\n ? true\n : options.sourceType === \"module\";\n\n this.curLine = options.startLine;\n this.startLoc = this.endLoc = this.curPosition();\n }\n\n errors: ParsingError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n maybeInArrowParameters: boolean = false;\n inType: boolean = false;\n noAnonFunctionType: boolean = false;\n inPropertyName: boolean = false;\n hasFlowComment: boolean = false;\n isAmbientContext: boolean = false;\n inAbstractClass: boolean = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n soloAwait: boolean = false;\n inFSharpPipelineDirectBody: boolean = false;\n\n // Labels in scope.\n labels: Array<{\n kind: ?(\"loop\" | \"switch\"),\n name?: ?string,\n statementStart?: number,\n }> = [];\n\n // Leading decorators. Last element of the stack represents the decorators in current context.\n // Supports nesting of decorators, e.g. @foo(@bar class inner {}) class outer {}\n // where @foo belongs to the outer class and @bar to the inner\n decoratorStack: Array> = [[]];\n\n // Comment store for Program.comments\n comments: Array = [];\n\n // Comment attachment store\n commentStack: Array = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n lineStart: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // $FlowIgnore this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // $FlowIgnore this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n lastTokStart: number = 0;\n lastTokEnd: number = 0;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array = [ct.brace];\n // Used to track whether a JSX element is allowed to form\n exprAllowed: boolean = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n containsEsc: boolean = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart);\n }\n\n clone(skipArrays?: boolean): State {\n const state = new State();\n const keys = Object.keys(this);\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n // $FlowIgnore\n let val = this[key];\n\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n // $FlowIgnore\n state[key] = val;\n }\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number,\n value: any,\n type: TokenType,\n start: number,\n end: number,\n /* Used only in readToken_mult_modulo */\n inType: boolean,\n};\n","// @flow\n\n/*:: declare var invariant; */\n\nimport type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types\";\nimport { type TokContext, types as ct } from \"./context\";\nimport ParserErrors, { Errors, type ErrorTemplate } from \"../parser/error\";\nimport { SourceLocation } from \"../util/location\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n} from \"../util/whitespace\";\nimport State from \"./state\";\nimport type { LookaheadState } from \"./state\";\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n]);\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\n\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: [\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ],\n hex: [\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ],\n};\n\nconst allowedNumericSeparatorSiblings = {};\nallowedNumericSeparatorSiblings.bin = [\n // 0 - 1\n charCodes.digit0,\n charCodes.digit1,\n];\nallowedNumericSeparatorSiblings.oct = [\n // 0 - 7\n ...allowedNumericSeparatorSiblings.bin,\n\n charCodes.digit2,\n charCodes.digit3,\n charCodes.digit4,\n charCodes.digit5,\n charCodes.digit6,\n charCodes.digit7,\n];\nallowedNumericSeparatorSiblings.dec = [\n // 0 - 9\n ...allowedNumericSeparatorSiblings.oct,\n\n charCodes.digit8,\n charCodes.digit9,\n];\n\nallowedNumericSeparatorSiblings.hex = [\n // 0 - 9, A - F, a - f,\n ...allowedNumericSeparatorSiblings.dec,\n\n charCodes.uppercaseA,\n charCodes.uppercaseB,\n charCodes.uppercaseC,\n charCodes.uppercaseD,\n charCodes.uppercaseE,\n charCodes.uppercaseF,\n\n charCodes.lowercaseA,\n charCodes.lowercaseB,\n charCodes.lowercaseC,\n charCodes.lowercaseD,\n charCodes.lowercaseE,\n charCodes.lowercaseF,\n];\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default class Tokenizer extends ParserErrors {\n // Forward-declarations\n // parser/util.js\n /*::\n +hasPrecedingLineBreak: () => boolean;\n +unexpected: (pos?: ?number, messageOrType?: ErrorTemplate | TokenType) => empty;\n +expectPlugin: (name: string, pos?: ?number) => true;\n */\n\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokEnd = this.state.end;\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n // TODO\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n // TODO\n\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n *\n * @param {State} state\n * @returns {LookaheadState}\n * @memberof Tokenizer\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n lastTokEnd: state.end,\n context: [this.curContext()],\n inType: state.inType,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n *\n * @returns {LookaheadState}\n * @memberof Tokenizer\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // For performance we use a simpified tokenizer state structure\n // $FlowIgnore\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach((message, pos) =>\n /* eslint-disable @babel/development-internal/dry-error-messages */\n this.raise(pos, message),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related\n // properties.\n\n nextToken(): void {\n const curContext = this.curContext();\n if (!curContext.preserveSpace) this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n if (curContext === ct.template) {\n this.readTmplToken();\n } else {\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n }\n\n skipBlockComment(): N.CommentBlock | void {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(\"*/\", start + 2);\n if (end === -1) throw this.raise(start, Errors.UnterminatedComment);\n\n this.state.pos = end + 2;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start,\n end: end + 2,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | void {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment = {\n type: \"CommentLine\",\n value,\n start,\n end,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment();\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (ch === charCodes.dash && !this.inModule) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (ch === charCodes.lessThan && !this.inModule) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // ` - -> This module contains methods for building ASTs manually and for checking the types of AST nodes. - -## Install - -\`\`\`sh -npm install --save-dev @babel/types -\`\`\` - -## API`, -]; - -const customTypes = { - ClassMethod: { - key: "if computed then `Expression` else `Identifier | Literal`", - }, - Identifier: { - name: "`string`", - }, - MemberExpression: { - property: "if computed then `Expression` else `Identifier`", - }, - ObjectMethod: { - key: "if computed then `Expression` else `Identifier | Literal`", - }, - ObjectProperty: { - key: "if computed then `Expression` else `Identifier | Literal`", - }, - ClassPrivateMethod: { - computed: "'false'", - }, - ClassPrivateProperty: { - computed: "'false'", - }, -}; -const APIHistory = { - ClassProperty: [["v7.6.0", "Supports `static`"]], -}; -function formatHistory(historyItems) { - const lines = historyItems.map( - item => "| `" + item[0] + "` | " + item[1] + " |" - ); - return [ - "
", - " History", - "| Version | Changes |", - "| --- | --- |", - ...lines, - "
", - ]; -} -function printAPIHistory(key, readme) { - if (APIHistory[key]) { - readme.push(""); - readme.push(...formatHistory(APIHistory[key])); - } -} -function printNodeFields(key, readme) { - if (Object.keys(t.NODE_FIELDS[key]).length > 0) { - readme.push(""); - readme.push("AST Node `" + key + "` shape:"); - Object.keys(t.NODE_FIELDS[key]) - .sort(function (fieldA, fieldB) { - const indexA = t.BUILDER_KEYS[key].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[key].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }) - .forEach(function (field) { - const defaultValue = t.NODE_FIELDS[key][field].default; - const fieldDescription = ["`" + field + "`"]; - const validator = t.NODE_FIELDS[key][field].validate; - if (customTypes[key] && customTypes[key][field]) { - fieldDescription.push(`: ${customTypes[key][field]}`); - } else if (validator) { - try { - fieldDescription.push( - ": `" + stringifyValidator(validator, "") + "`" - ); - } catch (ex) { - if (ex.code === "UNEXPECTED_VALIDATOR_TYPE") { - console.log( - "Unrecognised validator type for " + key + "." + field - ); - console.dir(ex.validator, { depth: 10, colors: true }); - } - } - } - if (defaultValue !== null || t.NODE_FIELDS[key][field].optional) { - fieldDescription.push( - " (default: `" + util.inspect(defaultValue) + "`" - ); - if (t.BUILDER_KEYS[key].indexOf(field) < 0) { - fieldDescription.push(", excluded from builder function"); - } - fieldDescription.push(")"); - } else { - fieldDescription.push(" (required)"); - } - readme.push("- " + fieldDescription.join("")); - }); - } -} - -function printAliasKeys(key, readme) { - if (t.ALIAS_KEYS[key] && t.ALIAS_KEYS[key].length) { - readme.push(""); - readme.push( - "Aliases: " + - t.ALIAS_KEYS[key] - .map(function (key) { - return "[`" + key + "`](#" + key.toLowerCase() + ")"; - }) - .join(", ") - ); - } -} -readme.push("### Node Builders"); -readme.push(""); -Object.keys(t.BUILDER_KEYS) - .sort() - .forEach(function (key) { - readme.push("#### " + toFunctionName(key)); - readme.push(""); - readme.push("```javascript"); - readme.push( - "t." + toFunctionName(key) + "(" + t.BUILDER_KEYS[key].join(", ") + ");" - ); - readme.push("```"); - printAPIHistory(key, readme); - readme.push(""); - readme.push( - "See also `t.is" + - key + - "(node, opts)` and `t.assert" + - key + - "(node, opts)`." - ); - - printNodeFields(key, readme); - printAliasKeys(key, readme); - - readme.push(""); - readme.push("---"); - readme.push(""); - }); - -function generateMapAliasToNodeTypes() { - const result = new Map(); - for (const nodeType of Object.keys(t.ALIAS_KEYS)) { - const aliases = t.ALIAS_KEYS[nodeType]; - if (!aliases) continue; - for (const alias of aliases) { - if (!result.has(alias)) { - result.set(alias, []); - } - const nodeTypes = result.get(alias); - nodeTypes.push(nodeType); - } - } - return result; -} -const aliasDescriptions = { - Binary: - "A cover of BinaryExpression and LogicalExpression, which share the same AST shape.", - Block: "Deprecated. Will be removed in Babel 8.", - BlockParent: - "A cover of AST nodes that start an execution context with new [LexicalEnvironment](https://tc39.es/ecma262/#table-additional-state-components-for-ecmascript-code-execution-contexts). In other words, they define the scope of `let` and `const` declarations.", - Class: - "A cover of ClassExpression and ClassDeclaration, which share the same AST shape.", - CompletionStatement: - "A statement that indicates the [completion records](https://tc39.es/ecma262/#sec-completion-record-specification-type). In other words, they define the control flow of the program, such as when should a loop break or an action throws critical errors.", - Conditional: - "A cover of ConditionalExpression and IfStatement, which share the same AST shape.", - Declaration: - "A cover of any [Declaration](https://tc39.es/ecma262/#prod-Declaration)s.", - EnumBody: "A cover of Flow enum bodies.", - EnumMember: "A cover of Flow enum membors.", - ExportDeclaration: - "A cover of any [ExportDeclaration](https://tc39.es/ecma262/#prod-ExportDeclaration)s.", - Expression: - "A cover of any [Expression](https://tc39.es/ecma262/#sec-ecmascript-language-expressions)s.", - ExpressionWrapper: - "A wrapper of expression that does not have runtime semantics.", - Flow: "A cover of AST nodes defined for Flow.", - FlowBaseAnnotation: "A cover of primary Flow type annotations.", - FlowDeclaration: "A cover of Flow declarations.", - FlowPredicate: "A cover of Flow predicates.", - FlowType: "A cover of Flow type annotations.", - For: "A cover of [ForStatement](https://tc39.es/ecma262/#sec-for-statement)s and [ForXStatement](#forxstatement)s.", - ForXStatement: - "A cover of [ForInStatements and ForOfStatements](https://tc39.es/ecma262/#sec-for-in-and-for-of-statements).", - Function: - "A cover of functions and [method](#method)s, the must have `body` and `params`. Note: `Function` is different to `FunctionParent`.", - FunctionParent: - "A cover of AST nodes that start an execution context with new [VariableEnvironment](https://tc39.es/ecma262/#table-additional-state-components-for-ecmascript-code-execution-contexts). In other words, they define the scope of `var` declarations. FunctionParent did not include `Program` since Babel 7.", - Immutable: - "A cover of immutable objects and JSX elements. An object is [immutable](https://tc39.es/ecma262/#immutable-prototype-exotic-object) if no other properties can be defined once created.", - JSX: "A cover of AST nodes defined for [JSX](https://facebook.github.io/jsx/).", - LVal: "A cover of left hand side expressions used in the `left` of assignment expressions and [ForXStatement](#forxstatement)s. ", - Literal: - "A cover of [Literal](https://tc39.es/ecma262/#sec-primary-expression-literals)s, [Regular Expression Literal](https://tc39.es/ecma262/#sec-primary-expression-regular-expression-literals)s and [Template Literal](https://tc39.es/ecma262/#sec-template-literals)s.", - Loop: "A cover of loop statements.", - Method: "A cover of object methods and class methods.", - ModuleDeclaration: - "A cover of ImportDeclaration and [ExportDeclaration](#exportdeclaration)", - ModuleSpecifier: - "A cover of import and export specifiers. Note: It is _not_ the [ModuleSpecifier](https://tc39.es/ecma262/#prod-ModuleSpecifier) defined in the spec.", - ObjectMember: - "A cover of [members](https://tc39.es/ecma262/#prod-PropertyDefinitionList) in an object literal.", - Pattern: - "A cover of [BindingPattern](https://tc39.es/ecma262/#prod-BindingPattern) except Identifiers.", - PatternLike: - "A cover of [BindingPattern](https://tc39.es/ecma262/#prod-BindingPattern)s. ", - Private: "A cover of private class elements and private identifiers.", - Property: "A cover of object properties and class properties.", - Pureish: - "A cover of AST nodes which do not have side-effects. In other words, there is no observable behaviour changes if they are evaluated more than once.", - Scopable: - "A cover of [FunctionParent](#functionparent) and [BlockParent](#blockparent).", - Statement: - "A cover of any [Statement](https://tc39.es/ecma262/#prod-Statement)s.", - TSBaseType: "A cover of primary TypeScript type annotations.", - TSEntityName: "A cover of ts entities.", - TSType: "A cover of TypeScript type annotations.", - TSTypeElement: "A cover of TypeScript type declarations.", - Terminatorless: - "A cover of AST nodes whose semantic will change when a line terminator is inserted between the operator and the operand.", - UnaryLike: "A cover of UnaryExpression and SpreadElement.", - UserWhitespacable: "Deprecated. Will be removed in Babel 8.", - While: - "A cover of DoWhileStatement and WhileStatement, which share the same AST shape.", -}; -const mapAliasToNodeTypes = generateMapAliasToNodeTypes(); -readme.push("### Aliases"); -readme.push(""); -for (const alias of [...mapAliasToNodeTypes.keys()].sort()) { - const nodeTypes = mapAliasToNodeTypes.get(alias); - nodeTypes.sort(); - if (!(alias in aliasDescriptions)) { - throw new Error( - 'Missing alias descriptions of "' + - alias + - ", which covers " + - nodeTypes.join(",") - ); - } - readme.push("#### " + alias); - readme.push(""); - readme.push(aliasDescriptions[alias]); - readme.push("```javascript"); - readme.push("t.is" + alias + "(node);"); - readme.push("```"); - readme.push(""); - readme.push("Covered nodes: "); - for (const nodeType of nodeTypes) { - readme.push("- [`" + nodeType + "`](#" + nodeType.toLowerCase() + ")"); - } - readme.push(""); -} - -process.stdout.write(readme.join("\n")); diff --git a/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/flow.js b/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/flow.js deleted file mode 100644 index 7fabcc67..00000000 --- a/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/flow.js +++ /dev/null @@ -1,260 +0,0 @@ -import t from "../../lib/index.js"; -import stringifyValidator from "../utils/stringifyValidator.js"; -import toFunctionName from "../utils/toFunctionName.js"; - -const NODE_PREFIX = "BabelNode"; - -let code = `// NOTE: This file is autogenerated. Do not modify. -// See packages/babel-types/scripts/generators/flow.js for script used. - -declare class ${NODE_PREFIX}Comment { - value: string; - start: number; - end: number; - loc: ${NODE_PREFIX}SourceLocation; -} - -declare class ${NODE_PREFIX}CommentBlock extends ${NODE_PREFIX}Comment { - type: "CommentBlock"; -} - -declare class ${NODE_PREFIX}CommentLine extends ${NODE_PREFIX}Comment { - type: "CommentLine"; -} - -declare class ${NODE_PREFIX}SourceLocation { - start: { - line: number; - column: number; - }; - - end: { - line: number; - column: number; - }; -} - -declare class ${NODE_PREFIX} { - leadingComments?: Array<${NODE_PREFIX}Comment>; - innerComments?: Array<${NODE_PREFIX}Comment>; - trailingComments?: Array<${NODE_PREFIX}Comment>; - start: ?number; - end: ?number; - loc: ?${NODE_PREFIX}SourceLocation; - extra?: { [string]: mixed }; -}\n\n`; - -// - -const lines = []; - -for (const type in t.NODE_FIELDS) { - const fields = t.NODE_FIELDS[type]; - - const struct = ['type: "' + type + '";']; - const args = []; - const builderNames = t.BUILDER_KEYS[type]; - - Object.keys(t.NODE_FIELDS[type]) - .sort((fieldA, fieldB) => { - const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }) - .forEach(fieldName => { - const field = fields[fieldName]; - - let suffix = ""; - if (field.optional || field.default != null) suffix += "?"; - - let typeAnnotation = "any"; - - const validate = field.validate; - if (validate) { - typeAnnotation = stringifyValidator(validate, NODE_PREFIX); - } - - if (typeAnnotation) { - suffix += ": " + typeAnnotation; - } - if (builderNames.includes(fieldName)) { - args.push(t.toBindingIdentifierName(fieldName) + suffix); - } - - if (t.isValidIdentifier(fieldName)) { - struct.push(fieldName + suffix + ";"); - } - }); - - code += `declare class ${NODE_PREFIX}${type} extends ${NODE_PREFIX} { - ${struct.join("\n ").trim()} -}\n\n`; - - // Flow chokes on super() and import() :/ - if (type !== "Super" && type !== "Import") { - lines.push( - `declare export function ${toFunctionName(type)}(${args.join( - ", " - )}): ${NODE_PREFIX}${type};` - ); - } else { - const functionName = toFunctionName(type); - lines.push( - `declare function _${functionName}(${args.join( - ", " - )}): ${NODE_PREFIX}${type};`, - `declare export { _${functionName} as ${functionName} }` - ); - } -} - -for (const typeName of t.TYPES) { - const isDeprecated = !!t.DEPRECATED_KEYS[typeName]; - const realName = isDeprecated ? t.DEPRECATED_KEYS[typeName] : typeName; - - let decl = `declare export function is${typeName}(node: ?Object, opts?: ?Object): boolean`; - if (t.NODE_FIELDS[realName]) { - decl += ` %checks (node instanceof ${NODE_PREFIX}${realName})`; - } - lines.push(decl); - - lines.push( - `declare export function assert${typeName}(node: ?Object, opts?: ?Object): void` - ); -} - -lines.push( - `declare export var VISITOR_KEYS: { [type: string]: string[] }`, - - // assert/ - `declare export function assertNode(obj: any): void`, - - // builders/ - // eslint-disable-next-line max-len - `declare export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): ${NODE_PREFIX}TypeAnnotation`, - // eslint-disable-next-line max-len - `declare export function createUnionTypeAnnotation(types: Array<${NODE_PREFIX}FlowType>): ${NODE_PREFIX}UnionTypeAnnotation`, - // eslint-disable-next-line max-len - `declare export function createFlowUnionType(types: Array<${NODE_PREFIX}FlowType>): ${NODE_PREFIX}UnionTypeAnnotation`, - // this smells like "internal API" - // eslint-disable-next-line max-len - `declare export function buildChildren(node: { children: Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment | ${NODE_PREFIX}JSXEmptyExpression> }): Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment>`, - - // clone/ - `declare export function clone(n: T): T;`, - `declare export function cloneDeep(n: T): T;`, - `declare export function cloneDeepWithoutLoc(n: T): T;`, - `declare export function cloneNode(n: T, deep?: boolean, withoutLoc?: boolean): T;`, - `declare export function cloneWithoutLoc(n: T): T;`, - - // comments/ - `declare type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`, - // eslint-disable-next-line max-len - `declare export function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`, - // eslint-disable-next-line max-len - `declare export function addComments(node: T, type: CommentTypeShorthand, comments: Array): T`, - `declare export function inheritInnerComments(node: BabelNode, parent: BabelNode): void`, - `declare export function inheritLeadingComments(node: BabelNode, parent: BabelNode): void`, - `declare export function inheritsComments(node: T, parent: BabelNode): void`, - `declare export function inheritTrailingComments(node: BabelNode, parent: BabelNode): void`, - `declare export function removeComments(node: T): T`, - - // converters/ - `declare export function ensureBlock(node: ${NODE_PREFIX}, key: string): ${NODE_PREFIX}BlockStatement`, - `declare export function toBindingIdentifierName(name?: ?string): string`, - // eslint-disable-next-line max-len - `declare export function toBlock(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Expression, parent?: ${NODE_PREFIX}Function | null): ${NODE_PREFIX}BlockStatement`, - // eslint-disable-next-line max-len - `declare export function toComputedKey(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}Expression | ${NODE_PREFIX}Identifier): ${NODE_PREFIX}Expression`, - // eslint-disable-next-line max-len - `declare export function toExpression(node: ${NODE_PREFIX}ExpressionStatement | ${NODE_PREFIX}Expression | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function): ${NODE_PREFIX}Expression`, - `declare export function toIdentifier(name?: ?string): string`, - // eslint-disable-next-line max-len - `declare export function toKeyAlias(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}): string`, - // toSequenceExpression relies on types that aren't declared in flow - // eslint-disable-next-line max-len - `declare export function toStatement(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function | ${NODE_PREFIX}AssignmentExpression, ignore?: boolean): ${NODE_PREFIX}Statement | void`, - `declare export function valueToNode(value: any): ${NODE_PREFIX}Expression`, - - // modifications/ - // eslint-disable-next-line max-len - `declare export function removeTypeDuplicates(types: Array<${NODE_PREFIX}FlowType>): Array<${NODE_PREFIX}FlowType>`, - // eslint-disable-next-line max-len - `declare export function appendToMemberExpression(member: ${NODE_PREFIX}MemberExpression, append: ${NODE_PREFIX}, computed?: boolean): ${NODE_PREFIX}MemberExpression`, - // eslint-disable-next-line max-len - `declare export function inherits(child: T, parent: ${NODE_PREFIX} | null | void): T`, - // eslint-disable-next-line max-len - `declare export function prependToMemberExpression(member: ${NODE_PREFIX}MemberExpression, prepend: ${NODE_PREFIX}Expression): ${NODE_PREFIX}MemberExpression`, - `declare export function removeProperties(n: T, opts: ?{}): void;`, - `declare export function removePropertiesDeep(n: T, opts: ?{}): T;`, - - // retrievers/ - // eslint-disable-next-line max-len - `declare export var getBindingIdentifiers: { - (node: ${NODE_PREFIX}, duplicates?: boolean, outerOnly?: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> }, - keys: { [type: string]: string[] } - }`, - // eslint-disable-next-line max-len - `declare export function getOuterBindingIdentifiers(node: BabelNode, duplicates?: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> }`, - - // traverse/ - `declare type TraversalAncestors = Array<{ - node: BabelNode, - key: string, - index?: number, - }>; - declare type TraversalHandler = (BabelNode, TraversalAncestors, T) => void; - declare type TraversalHandlers = { - enter?: TraversalHandler, - exit?: TraversalHandler, - };`.replace(/(^|\n) {2}/g, "$1"), - // eslint-disable-next-line - `declare export function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void;`, - `declare export function traverseFast(n: BabelNode, h: TraversalHandler, state?: T): void;`, - - // utils/ - // cleanJSXElementLiteralChild is not exported - // inherit is not exported - `declare export function shallowEqual(actual: Object, expected: Object): boolean`, - - // validators/ - // eslint-disable-next-line max-len - `declare export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (?BabelNode) => boolean`, - `declare export function is(type: string, n: BabelNode, opts: Object): boolean;`, - `declare export function isBinding(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, - `declare export function isBlockScoped(node: BabelNode): boolean`, - `declare export function isImmutable(node: BabelNode): boolean`, - `declare export function isLet(node: BabelNode): boolean`, - `declare export function isNode(node: ?Object): boolean`, - `declare export function isNodesEquivalent(a: any, b: any): boolean`, - `declare export function isPlaceholderType(placeholderType: string, targetType: string): boolean`, - `declare export function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, - `declare export function isScope(node: BabelNode, parent: BabelNode): boolean`, - `declare export function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean`, - `declare export function isType(nodetype: ?string, targetType: string): boolean`, - `declare export function isValidES3Identifier(name: string): boolean`, - `declare export function isValidES3Identifier(name: string): boolean`, - `declare export function isValidIdentifier(name: string): boolean`, - `declare export function isVar(node: BabelNode): boolean`, - // eslint-disable-next-line max-len - `declare export function matchesPattern(node: ?BabelNode, match: string | Array, allowPartial?: boolean): boolean`, - `declare export function validate(n: BabelNode, key: string, value: mixed): void;` -); - -for (const type in t.FLIPPED_ALIAS_KEYS) { - const types = t.FLIPPED_ALIAS_KEYS[type]; - code += `type ${NODE_PREFIX}${type} = ${types - .map(type => `${NODE_PREFIX}${type}`) - .join(" | ")};\n`; -} - -code += `\ndeclare module "@babel/types" { - ${lines.join("\n").replace(/\n/g, "\n ").trim()} -}\n`; - -// - -process.stdout.write(code); diff --git a/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/typescript-legacy.js b/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/typescript-legacy.js deleted file mode 100644 index 40da48f4..00000000 --- a/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/typescript-legacy.js +++ /dev/null @@ -1,369 +0,0 @@ -import t from "../../lib/index.js"; -import stringifyValidator from "../utils/stringifyValidator.js"; -import toFunctionName from "../utils/toFunctionName.js"; - -let code = `// NOTE: This file is autogenerated. Do not modify. -// See packages/babel-types/scripts/generators/typescript-legacy.js for script used. - -interface BaseComment { - value: string; - start: number; - end: number; - loc: SourceLocation; - type: "CommentBlock" | "CommentLine"; -} - -export interface CommentBlock extends BaseComment { - type: "CommentBlock"; -} - -export interface CommentLine extends BaseComment { - type: "CommentLine"; -} - -export type Comment = CommentBlock | CommentLine; - -export interface SourceLocation { - start: { - line: number; - column: number; - }; - - end: { - line: number; - column: number; - }; -} - -interface BaseNode { - leadingComments: ReadonlyArray | null; - innerComments: ReadonlyArray | null; - trailingComments: ReadonlyArray | null; - start: number | null; - end: number | null; - loc: SourceLocation | null; - type: Node["type"]; - extra?: Record; -} - -export type Node = ${t.TYPES.sort().join(" | ")};\n\n`; - -// - -const lines = []; - -for (const type in t.NODE_FIELDS) { - const fields = t.NODE_FIELDS[type]; - const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type); - const builderNames = t.BUILDER_KEYS[type]; - - const struct = ['type: "' + type + '";']; - const args = []; - - fieldNames.forEach(fieldName => { - const field = fields[fieldName]; - // Future / annoying TODO: - // MemberExpression.property, ObjectProperty.key and ObjectMethod.key need special cases; either: - // - convert the declaration to chain() like ClassProperty.key and ClassMethod.key, - // - declare an alias type for valid keys, detect the case and reuse it here, - // - declare a disjoint union with, for example, ObjectPropertyBase, - // ObjectPropertyLiteralKey and ObjectPropertyComputedKey, and declare ObjectProperty - // as "ObjectPropertyBase & (ObjectPropertyLiteralKey | ObjectPropertyComputedKey)" - let typeAnnotation = stringifyValidator(field.validate, ""); - - if (isNullable(field) && !hasDefault(field)) { - typeAnnotation += " | null"; - } - - if (builderNames.includes(fieldName)) { - if (areAllRemainingFieldsNullable(fieldName, builderNames, fields)) { - args.push( - `${t.toBindingIdentifierName(fieldName)}${ - isNullable(field) ? "?:" : ":" - } ${typeAnnotation}` - ); - } else { - args.push( - `${t.toBindingIdentifierName(fieldName)}: ${typeAnnotation}${ - isNullable(field) ? " | undefined" : "" - }` - ); - } - } - - const alphaNumeric = /^\w+$/; - - if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) { - struct.push(`${fieldName}: ${typeAnnotation};`); - } else { - struct.push(`"${fieldName}": ${typeAnnotation};`); - } - }); - - code += `export interface ${type} extends BaseNode { - ${struct.join("\n ").trim()} -}\n\n`; - - // super and import are reserved words in JavaScript - if (type !== "Super" && type !== "Import") { - lines.push( - `export function ${toFunctionName(type)}(${args.join(", ")}): ${type};` - ); - } else { - const functionName = toFunctionName(type); - lines.push( - `declare function _${functionName}(${args.join(", ")}): ${type};`, - `export { _${functionName} as ${functionName}}` - ); - } -} - -for (const typeName of t.TYPES) { - const isDeprecated = !!t.DEPRECATED_KEYS[typeName]; - const realName = isDeprecated ? t.DEPRECATED_KEYS[typeName] : typeName; - - const result = - t.NODE_FIELDS[realName] || t.FLIPPED_ALIAS_KEYS[realName] - ? `node is ${realName}` - : "boolean"; - - if (isDeprecated) { - lines.push(`/** @deprecated Use \`is${realName}\` */`); - } - lines.push( - `export function is${typeName}(node: object | null | undefined, opts?: object | null): ${result};` - ); - - if (isDeprecated) { - lines.push(`/** @deprecated Use \`assert${realName}\` */`); - } - lines.push( - `export function assert${typeName}(node: object | null | undefined, opts?: object | null): void;` - ); -} - -lines.push( - // assert/ - `export function assertNode(obj: any): void`, - - // builders/ - // eslint-disable-next-line max-len - `export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): StringTypeAnnotation | VoidTypeAnnotation | NumberTypeAnnotation | BooleanTypeAnnotation | GenericTypeAnnotation`, - `export function createUnionTypeAnnotation(types: [T]): T`, - `export function createFlowUnionType(types: [T]): T`, - // this probably misbehaves if there are 0 elements, and it's not a UnionTypeAnnotation if there's only 1 - // it is possible to require "2 or more" for this overload ([T, T, ...T[]]) but it requires typescript 3.0 - `export function createUnionTypeAnnotation(types: ReadonlyArray): UnionTypeAnnotation`, - `export function createFlowUnionType(types: ReadonlyArray): UnionTypeAnnotation`, - // this smells like "internal API" - // eslint-disable-next-line max-len - `export function buildChildren(node: { children: ReadonlyArray }): JSXElement['children']`, - - // clone/ - `export function clone(n: T): T;`, - `export function cloneDeep(n: T): T;`, - `export function cloneDeepWithoutLoc(n: T): T;`, - `export function cloneNode(n: T, deep?: boolean, withoutLoc?: boolean): T;`, - `export function cloneWithoutLoc(n: T): T;`, - - // comments/ - `export type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`, - // eslint-disable-next-line max-len - `export function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`, - // eslint-disable-next-line max-len - `export function addComments(node: T, type: CommentTypeShorthand, comments: ReadonlyArray): T`, - `export function inheritInnerComments(node: Node, parent: Node): void`, - `export function inheritLeadingComments(node: Node, parent: Node): void`, - `export function inheritsComments(node: T, parent: Node): void`, - `export function inheritTrailingComments(node: Node, parent: Node): void`, - `export function removeComments(node: T): T`, - - // converters/ - // eslint-disable-next-line max-len - `export function ensureBlock(node: Extract): BlockStatement`, - // too complex? - // eslint-disable-next-line max-len - `export function ensureBlock = 'body'>(node: Extract>, key: K): BlockStatement`, - // gatherSequenceExpressions is not exported - `export function toBindingIdentifierName(name: { toString(): string } | null | undefined): string`, - `export function toBlock(node: Statement | Expression, parent?: Function | null): BlockStatement`, - // it is possible for `node` to be an arbitrary object if `key` is always provided, - // but that doesn't look like intended API - // eslint-disable-next-line max-len - `export function toComputedKey>(node: T, key?: Expression | Identifier): Expression`, - `export function toExpression(node: Function): FunctionExpression`, - `export function toExpression(node: Class): ClassExpression`, - `export function toExpression(node: ExpressionStatement | Expression | Class | Function): Expression`, - `export function toIdentifier(name: { toString(): string } | null | undefined): string`, - `export function toKeyAlias(node: Method | Property, key?: Node): string`, - // NOTE: this actually uses Scope from @babel/traverse, but we can't add a dependency on its types, - // as they live in @types. Declare the structural subset that is required. - // eslint-disable-next-line max-len - `export function toSequenceExpression(nodes: ReadonlyArray, scope: { push(value: { id: LVal; kind: 'var'; init?: Expression}): void; buildUndefinedNode(): Node }): SequenceExpression | undefined`, - `export function toStatement(node: AssignmentExpression, ignore?: boolean): ExpressionStatement`, - `export function toStatement(node: Statement | AssignmentExpression, ignore?: boolean): Statement`, - `export function toStatement(node: Class, ignore: true): ClassDeclaration | undefined`, - `export function toStatement(node: Class, ignore?: boolean): ClassDeclaration`, - `export function toStatement(node: Function, ignore: true): FunctionDeclaration | undefined`, - `export function toStatement(node: Function, ignore?: boolean): FunctionDeclaration`, - // eslint-disable-next-line max-len - `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore: true): Statement | undefined`, - // eslint-disable-next-line max-len - `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore?: boolean): Statement`, - // eslint-disable-next-line max-len - `export function valueToNode(value: undefined): Identifier`, // (should this not be a UnaryExpression to avoid shadowing?) - `export function valueToNode(value: boolean): BooleanLiteral`, - `export function valueToNode(value: null): NullLiteral`, - `export function valueToNode(value: string): StringLiteral`, - // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression - `export function valueToNode(value: number): NumericLiteral | BinaryExpression | UnaryExpression`, - `export function valueToNode(value: RegExp): RegExpLiteral`, - // eslint-disable-next-line max-len - `export function valueToNode(value: ReadonlyArray): ArrayExpression`, - // this throws with objects that are not PlainObject according to lodash, - // or if there are non-valueToNode-able values - `export function valueToNode(value: object): ObjectExpression`, - // eslint-disable-next-line max-len - `export function valueToNode(value: undefined | boolean | null | string | number | RegExp | object): Expression`, - - // modifications/ - // eslint-disable-next-line max-len - `export function removeTypeDuplicates(types: ReadonlyArray): FlowType[]`, - // eslint-disable-next-line max-len - `export function appendToMemberExpression>(member: T, append: MemberExpression['property'], computed?: boolean): T`, - // eslint-disable-next-line max-len - `export function inherits(child: T, parent: Node | null | undefined): T`, - // eslint-disable-next-line max-len - `export function prependToMemberExpression>(member: T, prepend: MemberExpression['object']): T`, - `export function removeProperties( - n: Node, - opts?: { preserveComments: boolean } | null -): void;`, - `export function removePropertiesDeep( - n: T, - opts?: { preserveComments: boolean } | null -): T;`, - - // retrievers/ - // eslint-disable-next-line max-len - `export function getBindingIdentifiers(node: Node, duplicates: true, outerOnly?: boolean): Record>`, - // eslint-disable-next-line max-len - `export function getBindingIdentifiers(node: Node, duplicates?: false, outerOnly?: boolean): Record`, - // eslint-disable-next-line max-len - `export function getBindingIdentifiers(node: Node, duplicates: boolean, outerOnly?: boolean): Record>`, - // eslint-disable-next-line max-len - `export function getOuterBindingIdentifiers(node: Node, duplicates: true): Record>`, - `export function getOuterBindingIdentifiers(node: Node, duplicates?: false): Record`, - // eslint-disable-next-line max-len - `export function getOuterBindingIdentifiers(node: Node, duplicates: boolean): Record>`, - - // traverse/ - `export type TraversalAncestors = ReadonlyArray<{ - node: Node, - key: string, - index?: number, - }>; - export type TraversalHandler = ( - this: undefined, node: Node, parent: TraversalAncestors, type: T - ) => void; - export type TraversalHandlers = { - enter?: TraversalHandler, - exit?: TraversalHandler, - };`.replace(/(^|\n) {2}/g, "$1"), - // eslint-disable-next-line - `export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void;`, - `export function traverseFast(n: Node, h: TraversalHandler, state?: T): void;`, - - // utils/ - // cleanJSXElementLiteralChild is not exported - // inherit is not exported - `export function shallowEqual(actual: object, expected: T): actual is T`, - - // validators/ - // eslint-disable-next-line max-len - `export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (node: Node | null | undefined) => node is MemberExpression`, - // eslint-disable-next-line max-len - `export function is(type: T, n: Node | null | undefined, required?: undefined): n is Extract`, - // eslint-disable-next-line max-len - `export function is>(type: T, n: Node | null | undefined, required: Partial

): n is P`, - // eslint-disable-next-line max-len - `export function is

(type: string, n: Node | null | undefined, required: Partial

): n is P`, - `export function is(type: string, n: Node | null | undefined, required?: Partial): n is Node`, - `export function isBinding(node: Node, parent: Node, grandparent?: Node): boolean`, - // eslint-disable-next-line max-len - `export function isBlockScoped(node: Node): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration`, - `export function isImmutable(node: Node): node is Immutable`, - `export function isLet(node: Node): node is VariableDeclaration`, - `export function isNode(node: object | null | undefined): node is Node`, - `export function isNodesEquivalent>(a: T, b: any): b is T`, - `export function isNodesEquivalent(a: any, b: any): boolean`, - `export function isPlaceholderType(placeholderType: Node['type'], targetType: Node['type']): boolean`, - `export function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean`, - `export function isScope(node: Node, parent: Node): node is Scopable`, - `export function isSpecifierDefault(specifier: ModuleSpecifier): boolean`, - `export function isType(nodetype: string, targetType: T): nodetype is T`, - `export function isType(nodetype: string | null | undefined, targetType: string): boolean`, - `export function isValidES3Identifier(name: string): boolean`, - `export function isValidIdentifier(name: string): boolean`, - `export function isVar(node: Node): node is VariableDeclaration`, - // the MemberExpression implication is incidental, but it follows from the implementation - // eslint-disable-next-line max-len - `export function matchesPattern(node: Node | null | undefined, match: string | ReadonlyArray, allowPartial?: boolean): node is MemberExpression`, - // eslint-disable-next-line max-len - `export function validate(n: Node | null | undefined, key: K, value: T[K]): void;`, - `export function validate(n: Node, key: string, value: any): void;` -); - -for (const type in t.DEPRECATED_KEYS) { - code += `/** - * @deprecated Use \`${t.DEPRECATED_KEYS[type]}\` - */ -export type ${type} = ${t.DEPRECATED_KEYS[type]};\n -`; -} - -for (const type in t.FLIPPED_ALIAS_KEYS) { - const types = t.FLIPPED_ALIAS_KEYS[type]; - code += `export type ${type} = ${types - .map(type => `${type}`) - .join(" | ")};\n`; -} -code += "\n"; - -code += "export interface Aliases {\n"; -for (const type in t.FLIPPED_ALIAS_KEYS) { - code += ` ${type}: ${type};\n`; -} -code += "}\n\n"; - -code += lines.join("\n") + "\n"; - -// - -process.stdout.write(code); - -// - -function areAllRemainingFieldsNullable(fieldName, fieldNames, fields) { - const index = fieldNames.indexOf(fieldName); - return fieldNames.slice(index).every(_ => isNullable(fields[_])); -} - -function hasDefault(field) { - return field.default != null; -} - -function isNullable(field) { - return field.optional || hasDefault(field); -} - -function sortFieldNames(fields, type) { - return fields.sort((fieldA, fieldB) => { - const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }); -} diff --git a/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/validators.js b/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/validators.js deleted file mode 100644 index acd6da65..00000000 --- a/node_modules/@babel/core/node_modules/@babel/types/scripts/generators/validators.js +++ /dev/null @@ -1,87 +0,0 @@ -import definitions from "../../lib/definitions/index.js"; - -const has = Function.call.bind(Object.prototype.hasOwnProperty); - -function joinComparisons(leftArr, right) { - return ( - leftArr.map(JSON.stringify).join(` === ${right} || `) + ` === ${right}` - ); -} - -function addIsHelper(type, aliasKeys, deprecated) { - const targetType = JSON.stringify(type); - let aliasSource = ""; - if (aliasKeys) { - aliasSource = joinComparisons(aliasKeys, "nodeType"); - } - - let placeholderSource = ""; - const placeholderTypes = []; - if ( - definitions.PLACEHOLDERS.includes(type) && - has(definitions.FLIPPED_ALIAS_KEYS, type) - ) { - placeholderTypes.push(type); - } - if (has(definitions.PLACEHOLDERS_FLIPPED_ALIAS, type)) { - placeholderTypes.push(...definitions.PLACEHOLDERS_FLIPPED_ALIAS[type]); - } - if (placeholderTypes.length > 0) { - placeholderSource = - ' || nodeType === "Placeholder" && (' + - joinComparisons( - placeholderTypes, - "(node as t.Placeholder).expectedNode" - ) + - ")"; - } - - const result = - definitions.NODE_FIELDS[type] || definitions.FLIPPED_ALIAS_KEYS[type] - ? `node is t.${type}` - : "boolean"; - - return `export function is${type}(node: object | null | undefined, opts?: object | null): ${result} { - ${deprecated || ""} - if (!node) return false; - - const nodeType = (node as t.Node).type; - if (${ - aliasSource ? aliasSource : `nodeType === ${targetType}` - }${placeholderSource}) { - if (typeof opts === "undefined") { - return true; - } else { - return shallowEqual(node, opts); - } - } - - return false; - } - `; -} - -export default function generateValidators() { - let output = `/* - * This file is auto-generated! Do not modify it directly. - * To re-generate run 'make build' - */ -import shallowEqual from "../../utils/shallowEqual"; -import type * as t from "../..";\n\n`; - - Object.keys(definitions.VISITOR_KEYS).forEach(type => { - output += addIsHelper(type); - }); - - Object.keys(definitions.FLIPPED_ALIAS_KEYS).forEach(type => { - output += addIsHelper(type, definitions.FLIPPED_ALIAS_KEYS[type]); - }); - - Object.keys(definitions.DEPRECATED_KEYS).forEach(type => { - const newType = definitions.DEPRECATED_KEYS[type]; - const deprecated = `console.trace("The node type ${type} has been renamed to ${newType}");`; - output += addIsHelper(type, null, deprecated); - }); - - return output; -} diff --git a/node_modules/@babel/core/node_modules/@babel/types/scripts/package.json b/node_modules/@babel/core/node_modules/@babel/types/scripts/package.json deleted file mode 100644 index 5ffd9800..00000000 --- a/node_modules/@babel/core/node_modules/@babel/types/scripts/package.json +++ /dev/null @@ -1 +0,0 @@ -{ "type": "module" } diff --git a/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/formatBuilderName.js b/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/formatBuilderName.js deleted file mode 100644 index f00a3c4a..00000000 --- a/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/formatBuilderName.js +++ /dev/null @@ -1,8 +0,0 @@ -const toLowerCase = Function.call.bind("".toLowerCase); - -export default function formatBuilderName(type) { - // FunctionExpression -> functionExpression - // JSXIdentifier -> jsxIdentifier - // V8IntrinsicIdentifier -> v8IntrinsicIdentifier - return type.replace(/^([A-Z](?=[a-z0-9])|[A-Z]+(?=[A-Z]))/, toLowerCase); -} diff --git a/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/lowerFirst.js b/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/lowerFirst.js deleted file mode 100644 index 012f252a..00000000 --- a/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/lowerFirst.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function lowerFirst(string) { - return string[0].toLowerCase() + string.slice(1); -} diff --git a/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/stringifyValidator.js b/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/stringifyValidator.js deleted file mode 100644 index 4b8d29c1..00000000 --- a/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/stringifyValidator.js +++ /dev/null @@ -1,66 +0,0 @@ -export default function stringifyValidator(validator, nodePrefix) { - if (validator === undefined) { - return "any"; - } - - if (validator.each) { - return `Array<${stringifyValidator(validator.each, nodePrefix)}>`; - } - - if (validator.chainOf) { - return stringifyValidator(validator.chainOf[1], nodePrefix); - } - - if (validator.oneOf) { - return validator.oneOf.map(JSON.stringify).join(" | "); - } - - if (validator.oneOfNodeTypes) { - return validator.oneOfNodeTypes.map(_ => nodePrefix + _).join(" | "); - } - - if (validator.oneOfNodeOrValueTypes) { - return validator.oneOfNodeOrValueTypes - .map(_ => { - return isValueType(_) ? _ : nodePrefix + _; - }) - .join(" | "); - } - - if (validator.type) { - return validator.type; - } - - if (validator.shapeOf) { - return ( - "{ " + - Object.keys(validator.shapeOf) - .map(shapeKey => { - const propertyDefinition = validator.shapeOf[shapeKey]; - if (propertyDefinition.validate) { - const isOptional = - propertyDefinition.optional || propertyDefinition.default != null; - return ( - shapeKey + - (isOptional ? "?: " : ": ") + - stringifyValidator(propertyDefinition.validate) - ); - } - return null; - }) - .filter(Boolean) - .join(", ") + - " }" - ); - } - - return ["any"]; -} - -/** - * Heuristic to decide whether or not the given type is a value type (eg. "null") - * or a Node type (eg. "Expression"). - */ -function isValueType(type) { - return type.charAt(0).toLowerCase() === type.charAt(0); -} diff --git a/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/toFunctionName.js b/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/toFunctionName.js deleted file mode 100644 index 2b645780..00000000 --- a/node_modules/@babel/core/node_modules/@babel/types/scripts/utils/toFunctionName.js +++ /dev/null @@ -1,4 +0,0 @@ -export default function toFunctionName(typeName) { - const _ = typeName.replace(/^TS/, "ts").replace(/^JSX/, "jsx"); - return _.slice(0, 1).toLowerCase() + _.slice(1); -} diff --git a/node_modules/@babel/traverse/node_modules/@babel/code-frame/LICENSE b/node_modules/@babel/traverse/node_modules/@babel/code-frame/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/node_modules/@babel/traverse/node_modules/@babel/code-frame/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/traverse/node_modules/@babel/code-frame/README.md b/node_modules/@babel/traverse/node_modules/@babel/code-frame/README.md deleted file mode 100644 index 185f93d2..00000000 --- a/node_modules/@babel/traverse/node_modules/@babel/code-frame/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/code-frame - -> Generate errors that contain a code frame that point to source locations. - -See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/code-frame -``` - -or using yarn: - -```sh -yarn add @babel/code-frame --dev -``` diff --git a/node_modules/@babel/traverse/node_modules/@babel/code-frame/lib/index.js b/node_modules/@babel/traverse/node_modules/@babel/code-frame/lib/index.js deleted file mode 100644 index 28d86f7b..00000000 --- a/node_modules/@babel/traverse/node_modules/@babel/code-frame/lib/index.js +++ /dev/null @@ -1,167 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.codeFrameColumns = codeFrameColumns; -exports.default = _default; - -var _highlight = _interopRequireWildcard(require("@babel/highlight")); - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -let deprecationWarningShown = false; - -function getDefs(chalk) { - return { - gutter: chalk.grey, - marker: chalk.red.bold, - message: chalk.red.bold - }; -} - -const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; - -function getMarkerLines(loc, source, opts) { - const startLoc = Object.assign({ - column: 0, - line: -1 - }, loc.start); - const endLoc = Object.assign({}, startLoc, loc.end); - const { - linesAbove = 2, - linesBelow = 3 - } = opts || {}; - const startLine = startLoc.line; - const startColumn = startLoc.column; - const endLine = endLoc.line; - const endColumn = endLoc.column; - let start = Math.max(startLine - (linesAbove + 1), 0); - let end = Math.min(source.length, endLine + linesBelow); - - if (startLine === -1) { - start = 0; - } - - if (endLine === -1) { - end = source.length; - } - - const lineDiff = endLine - startLine; - const markerLines = {}; - - if (lineDiff) { - for (let i = 0; i <= lineDiff; i++) { - const lineNumber = i + startLine; - - if (!startColumn) { - markerLines[lineNumber] = true; - } else if (i === 0) { - const sourceLength = source[lineNumber - 1].length; - markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; - } else if (i === lineDiff) { - markerLines[lineNumber] = [0, endColumn]; - } else { - const sourceLength = source[lineNumber - i].length; - markerLines[lineNumber] = [0, sourceLength]; - } - } - } else { - if (startColumn === endColumn) { - if (startColumn) { - markerLines[startLine] = [startColumn, 0]; - } else { - markerLines[startLine] = true; - } - } else { - markerLines[startLine] = [startColumn, endColumn - startColumn]; - } - } - - return { - start, - end, - markerLines - }; -} - -function codeFrameColumns(rawLines, loc, opts = {}) { - const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); - const chalk = (0, _highlight.getChalk)(opts); - const defs = getDefs(chalk); - - const maybeHighlight = (chalkFn, string) => { - return highlighted ? chalkFn(string) : string; - }; - - const lines = rawLines.split(NEWLINE); - const { - start, - end, - markerLines - } = getMarkerLines(loc, lines, opts); - const hasColumns = loc.start && typeof loc.start.column === "number"; - const numberMaxWidth = String(end).length; - const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; - let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { - const number = start + 1 + index; - const paddedNumber = ` ${number}`.slice(-numberMaxWidth); - const gutter = ` ${paddedNumber} | `; - const hasMarker = markerLines[number]; - const lastMarkerLine = !markerLines[number + 1]; - - if (hasMarker) { - let markerLine = ""; - - if (Array.isArray(hasMarker)) { - const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); - const numberOfMarkers = hasMarker[1] || 1; - markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); - - if (lastMarkerLine && opts.message) { - markerLine += " " + maybeHighlight(defs.message, opts.message); - } - } - - return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); - } else { - return ` ${maybeHighlight(defs.gutter, gutter)}${line}`; - } - }).join("\n"); - - if (opts.message && !hasColumns) { - frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; - } - - if (highlighted) { - return chalk.reset(frame); - } else { - return frame; - } -} - -function _default(rawLines, lineNumber, colNumber, opts = {}) { - if (!deprecationWarningShown) { - deprecationWarningShown = true; - const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; - - if (process.emitWarning) { - process.emitWarning(message, "DeprecationWarning"); - } else { - const deprecationError = new Error(message); - deprecationError.name = "DeprecationWarning"; - console.warn(new Error(message)); - } - } - - colNumber = Math.max(colNumber, 0); - const location = { - start: { - column: colNumber, - line: lineNumber - } - }; - return codeFrameColumns(rawLines, location, opts); -} \ No newline at end of file diff --git a/node_modules/@babel/traverse/node_modules/@babel/code-frame/package.json b/node_modules/@babel/traverse/node_modules/@babel/code-frame/package.json deleted file mode 100644 index d2e0ccff..00000000 --- a/node_modules/@babel/traverse/node_modules/@babel/code-frame/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@babel/code-frame", - "version": "7.10.4", - "description": "Generate errors that contain a code frame that point to source locations.", - "author": "Sebastian McKenzie ", - "homepage": "https://babeljs.io/", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-code-frame" - }, - "main": "lib/index.js", - "dependencies": { - "@babel/highlight": "^7.10.4" - }, - "devDependencies": { - "chalk": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df" -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/LICENSE b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/README.md b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/README.md deleted file mode 100644 index 8fa48c13..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-get-function-arity - -> Helper function to get function arity - -See our website [@babel/helper-get-function-arity](https://babeljs.io/docs/en/babel-helper-get-function-arity) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-get-function-arity -``` - -or using yarn: - -```sh -yarn add @babel/helper-get-function-arity --dev -``` diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/lib/index.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/lib/index.js deleted file mode 100644 index 61e22edd..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/lib/index.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _default; - -var _t = require("@babel/types"); - -const { - isAssignmentPattern, - isRestElement -} = _t; - -function _default(node) { - const params = node.params; - - for (let i = 0; i < params.length; i++) { - const param = params[i]; - - if (isAssignmentPattern(param) || isRestElement(param)) { - return i; - } - } - - return params.length; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/LICENSE b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/LICENSE deleted file mode 100644 index f31575ec..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/README.md b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/README.md deleted file mode 100644 index 0071bd7a..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/types - -> Babel Types is a Lodash-esque utility library for AST nodes - -See our website [@babel/types](https://babeljs.io/docs/en/babel-types) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/types -``` - -or using yarn: - -```sh -yarn add @babel/types --dev -``` diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/asserts/assertNode.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/asserts/assertNode.js deleted file mode 100644 index e584e3ee..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/asserts/assertNode.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = assertNode; - -var _isNode = require("../validators/isNode"); - -function assertNode(node) { - if (!(0, _isNode.default)(node)) { - var _node$type; - - const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node); - throw new TypeError(`Not a valid node of type "${type}"`); - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/asserts/generated/index.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/asserts/generated/index.js deleted file mode 100644 index b7309f7a..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/asserts/generated/index.js +++ /dev/null @@ -1,1492 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.assertArrayExpression = assertArrayExpression; -exports.assertAssignmentExpression = assertAssignmentExpression; -exports.assertBinaryExpression = assertBinaryExpression; -exports.assertInterpreterDirective = assertInterpreterDirective; -exports.assertDirective = assertDirective; -exports.assertDirectiveLiteral = assertDirectiveLiteral; -exports.assertBlockStatement = assertBlockStatement; -exports.assertBreakStatement = assertBreakStatement; -exports.assertCallExpression = assertCallExpression; -exports.assertCatchClause = assertCatchClause; -exports.assertConditionalExpression = assertConditionalExpression; -exports.assertContinueStatement = assertContinueStatement; -exports.assertDebuggerStatement = assertDebuggerStatement; -exports.assertDoWhileStatement = assertDoWhileStatement; -exports.assertEmptyStatement = assertEmptyStatement; -exports.assertExpressionStatement = assertExpressionStatement; -exports.assertFile = assertFile; -exports.assertForInStatement = assertForInStatement; -exports.assertForStatement = assertForStatement; -exports.assertFunctionDeclaration = assertFunctionDeclaration; -exports.assertFunctionExpression = assertFunctionExpression; -exports.assertIdentifier = assertIdentifier; -exports.assertIfStatement = assertIfStatement; -exports.assertLabeledStatement = assertLabeledStatement; -exports.assertStringLiteral = assertStringLiteral; -exports.assertNumericLiteral = assertNumericLiteral; -exports.assertNullLiteral = assertNullLiteral; -exports.assertBooleanLiteral = assertBooleanLiteral; -exports.assertRegExpLiteral = assertRegExpLiteral; -exports.assertLogicalExpression = assertLogicalExpression; -exports.assertMemberExpression = assertMemberExpression; -exports.assertNewExpression = assertNewExpression; -exports.assertProgram = assertProgram; -exports.assertObjectExpression = assertObjectExpression; -exports.assertObjectMethod = assertObjectMethod; -exports.assertObjectProperty = assertObjectProperty; -exports.assertRestElement = assertRestElement; -exports.assertReturnStatement = assertReturnStatement; -exports.assertSequenceExpression = assertSequenceExpression; -exports.assertParenthesizedExpression = assertParenthesizedExpression; -exports.assertSwitchCase = assertSwitchCase; -exports.assertSwitchStatement = assertSwitchStatement; -exports.assertThisExpression = assertThisExpression; -exports.assertThrowStatement = assertThrowStatement; -exports.assertTryStatement = assertTryStatement; -exports.assertUnaryExpression = assertUnaryExpression; -exports.assertUpdateExpression = assertUpdateExpression; -exports.assertVariableDeclaration = assertVariableDeclaration; -exports.assertVariableDeclarator = assertVariableDeclarator; -exports.assertWhileStatement = assertWhileStatement; -exports.assertWithStatement = assertWithStatement; -exports.assertAssignmentPattern = assertAssignmentPattern; -exports.assertArrayPattern = assertArrayPattern; -exports.assertArrowFunctionExpression = assertArrowFunctionExpression; -exports.assertClassBody = assertClassBody; -exports.assertClassExpression = assertClassExpression; -exports.assertClassDeclaration = assertClassDeclaration; -exports.assertExportAllDeclaration = assertExportAllDeclaration; -exports.assertExportDefaultDeclaration = assertExportDefaultDeclaration; -exports.assertExportNamedDeclaration = assertExportNamedDeclaration; -exports.assertExportSpecifier = assertExportSpecifier; -exports.assertForOfStatement = assertForOfStatement; -exports.assertImportDeclaration = assertImportDeclaration; -exports.assertImportDefaultSpecifier = assertImportDefaultSpecifier; -exports.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier; -exports.assertImportSpecifier = assertImportSpecifier; -exports.assertMetaProperty = assertMetaProperty; -exports.assertClassMethod = assertClassMethod; -exports.assertObjectPattern = assertObjectPattern; -exports.assertSpreadElement = assertSpreadElement; -exports.assertSuper = assertSuper; -exports.assertTaggedTemplateExpression = assertTaggedTemplateExpression; -exports.assertTemplateElement = assertTemplateElement; -exports.assertTemplateLiteral = assertTemplateLiteral; -exports.assertYieldExpression = assertYieldExpression; -exports.assertAwaitExpression = assertAwaitExpression; -exports.assertImport = assertImport; -exports.assertBigIntLiteral = assertBigIntLiteral; -exports.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier; -exports.assertOptionalMemberExpression = assertOptionalMemberExpression; -exports.assertOptionalCallExpression = assertOptionalCallExpression; -exports.assertClassProperty = assertClassProperty; -exports.assertClassPrivateProperty = assertClassPrivateProperty; -exports.assertClassPrivateMethod = assertClassPrivateMethod; -exports.assertPrivateName = assertPrivateName; -exports.assertAnyTypeAnnotation = assertAnyTypeAnnotation; -exports.assertArrayTypeAnnotation = assertArrayTypeAnnotation; -exports.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation; -exports.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation; -exports.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation; -exports.assertClassImplements = assertClassImplements; -exports.assertDeclareClass = assertDeclareClass; -exports.assertDeclareFunction = assertDeclareFunction; -exports.assertDeclareInterface = assertDeclareInterface; -exports.assertDeclareModule = assertDeclareModule; -exports.assertDeclareModuleExports = assertDeclareModuleExports; -exports.assertDeclareTypeAlias = assertDeclareTypeAlias; -exports.assertDeclareOpaqueType = assertDeclareOpaqueType; -exports.assertDeclareVariable = assertDeclareVariable; -exports.assertDeclareExportDeclaration = assertDeclareExportDeclaration; -exports.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration; -exports.assertDeclaredPredicate = assertDeclaredPredicate; -exports.assertExistsTypeAnnotation = assertExistsTypeAnnotation; -exports.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation; -exports.assertFunctionTypeParam = assertFunctionTypeParam; -exports.assertGenericTypeAnnotation = assertGenericTypeAnnotation; -exports.assertInferredPredicate = assertInferredPredicate; -exports.assertInterfaceExtends = assertInterfaceExtends; -exports.assertInterfaceDeclaration = assertInterfaceDeclaration; -exports.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation; -exports.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation; -exports.assertMixedTypeAnnotation = assertMixedTypeAnnotation; -exports.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation; -exports.assertNullableTypeAnnotation = assertNullableTypeAnnotation; -exports.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation; -exports.assertNumberTypeAnnotation = assertNumberTypeAnnotation; -exports.assertObjectTypeAnnotation = assertObjectTypeAnnotation; -exports.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot; -exports.assertObjectTypeCallProperty = assertObjectTypeCallProperty; -exports.assertObjectTypeIndexer = assertObjectTypeIndexer; -exports.assertObjectTypeProperty = assertObjectTypeProperty; -exports.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty; -exports.assertOpaqueType = assertOpaqueType; -exports.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier; -exports.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation; -exports.assertStringTypeAnnotation = assertStringTypeAnnotation; -exports.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation; -exports.assertThisTypeAnnotation = assertThisTypeAnnotation; -exports.assertTupleTypeAnnotation = assertTupleTypeAnnotation; -exports.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation; -exports.assertTypeAlias = assertTypeAlias; -exports.assertTypeAnnotation = assertTypeAnnotation; -exports.assertTypeCastExpression = assertTypeCastExpression; -exports.assertTypeParameter = assertTypeParameter; -exports.assertTypeParameterDeclaration = assertTypeParameterDeclaration; -exports.assertTypeParameterInstantiation = assertTypeParameterInstantiation; -exports.assertUnionTypeAnnotation = assertUnionTypeAnnotation; -exports.assertVariance = assertVariance; -exports.assertVoidTypeAnnotation = assertVoidTypeAnnotation; -exports.assertEnumDeclaration = assertEnumDeclaration; -exports.assertEnumBooleanBody = assertEnumBooleanBody; -exports.assertEnumNumberBody = assertEnumNumberBody; -exports.assertEnumStringBody = assertEnumStringBody; -exports.assertEnumSymbolBody = assertEnumSymbolBody; -exports.assertEnumBooleanMember = assertEnumBooleanMember; -exports.assertEnumNumberMember = assertEnumNumberMember; -exports.assertEnumStringMember = assertEnumStringMember; -exports.assertEnumDefaultedMember = assertEnumDefaultedMember; -exports.assertIndexedAccessType = assertIndexedAccessType; -exports.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType; -exports.assertJSXAttribute = assertJSXAttribute; -exports.assertJSXClosingElement = assertJSXClosingElement; -exports.assertJSXElement = assertJSXElement; -exports.assertJSXEmptyExpression = assertJSXEmptyExpression; -exports.assertJSXExpressionContainer = assertJSXExpressionContainer; -exports.assertJSXSpreadChild = assertJSXSpreadChild; -exports.assertJSXIdentifier = assertJSXIdentifier; -exports.assertJSXMemberExpression = assertJSXMemberExpression; -exports.assertJSXNamespacedName = assertJSXNamespacedName; -exports.assertJSXOpeningElement = assertJSXOpeningElement; -exports.assertJSXSpreadAttribute = assertJSXSpreadAttribute; -exports.assertJSXText = assertJSXText; -exports.assertJSXFragment = assertJSXFragment; -exports.assertJSXOpeningFragment = assertJSXOpeningFragment; -exports.assertJSXClosingFragment = assertJSXClosingFragment; -exports.assertNoop = assertNoop; -exports.assertPlaceholder = assertPlaceholder; -exports.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier; -exports.assertArgumentPlaceholder = assertArgumentPlaceholder; -exports.assertBindExpression = assertBindExpression; -exports.assertImportAttribute = assertImportAttribute; -exports.assertDecorator = assertDecorator; -exports.assertDoExpression = assertDoExpression; -exports.assertExportDefaultSpecifier = assertExportDefaultSpecifier; -exports.assertRecordExpression = assertRecordExpression; -exports.assertTupleExpression = assertTupleExpression; -exports.assertDecimalLiteral = assertDecimalLiteral; -exports.assertStaticBlock = assertStaticBlock; -exports.assertModuleExpression = assertModuleExpression; -exports.assertTopicReference = assertTopicReference; -exports.assertPipelineTopicExpression = assertPipelineTopicExpression; -exports.assertPipelineBareFunction = assertPipelineBareFunction; -exports.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference; -exports.assertTSParameterProperty = assertTSParameterProperty; -exports.assertTSDeclareFunction = assertTSDeclareFunction; -exports.assertTSDeclareMethod = assertTSDeclareMethod; -exports.assertTSQualifiedName = assertTSQualifiedName; -exports.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration; -exports.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration; -exports.assertTSPropertySignature = assertTSPropertySignature; -exports.assertTSMethodSignature = assertTSMethodSignature; -exports.assertTSIndexSignature = assertTSIndexSignature; -exports.assertTSAnyKeyword = assertTSAnyKeyword; -exports.assertTSBooleanKeyword = assertTSBooleanKeyword; -exports.assertTSBigIntKeyword = assertTSBigIntKeyword; -exports.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword; -exports.assertTSNeverKeyword = assertTSNeverKeyword; -exports.assertTSNullKeyword = assertTSNullKeyword; -exports.assertTSNumberKeyword = assertTSNumberKeyword; -exports.assertTSObjectKeyword = assertTSObjectKeyword; -exports.assertTSStringKeyword = assertTSStringKeyword; -exports.assertTSSymbolKeyword = assertTSSymbolKeyword; -exports.assertTSUndefinedKeyword = assertTSUndefinedKeyword; -exports.assertTSUnknownKeyword = assertTSUnknownKeyword; -exports.assertTSVoidKeyword = assertTSVoidKeyword; -exports.assertTSThisType = assertTSThisType; -exports.assertTSFunctionType = assertTSFunctionType; -exports.assertTSConstructorType = assertTSConstructorType; -exports.assertTSTypeReference = assertTSTypeReference; -exports.assertTSTypePredicate = assertTSTypePredicate; -exports.assertTSTypeQuery = assertTSTypeQuery; -exports.assertTSTypeLiteral = assertTSTypeLiteral; -exports.assertTSArrayType = assertTSArrayType; -exports.assertTSTupleType = assertTSTupleType; -exports.assertTSOptionalType = assertTSOptionalType; -exports.assertTSRestType = assertTSRestType; -exports.assertTSNamedTupleMember = assertTSNamedTupleMember; -exports.assertTSUnionType = assertTSUnionType; -exports.assertTSIntersectionType = assertTSIntersectionType; -exports.assertTSConditionalType = assertTSConditionalType; -exports.assertTSInferType = assertTSInferType; -exports.assertTSParenthesizedType = assertTSParenthesizedType; -exports.assertTSTypeOperator = assertTSTypeOperator; -exports.assertTSIndexedAccessType = assertTSIndexedAccessType; -exports.assertTSMappedType = assertTSMappedType; -exports.assertTSLiteralType = assertTSLiteralType; -exports.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments; -exports.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration; -exports.assertTSInterfaceBody = assertTSInterfaceBody; -exports.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration; -exports.assertTSAsExpression = assertTSAsExpression; -exports.assertTSTypeAssertion = assertTSTypeAssertion; -exports.assertTSEnumDeclaration = assertTSEnumDeclaration; -exports.assertTSEnumMember = assertTSEnumMember; -exports.assertTSModuleDeclaration = assertTSModuleDeclaration; -exports.assertTSModuleBlock = assertTSModuleBlock; -exports.assertTSImportType = assertTSImportType; -exports.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration; -exports.assertTSExternalModuleReference = assertTSExternalModuleReference; -exports.assertTSNonNullExpression = assertTSNonNullExpression; -exports.assertTSExportAssignment = assertTSExportAssignment; -exports.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration; -exports.assertTSTypeAnnotation = assertTSTypeAnnotation; -exports.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation; -exports.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration; -exports.assertTSTypeParameter = assertTSTypeParameter; -exports.assertExpression = assertExpression; -exports.assertBinary = assertBinary; -exports.assertScopable = assertScopable; -exports.assertBlockParent = assertBlockParent; -exports.assertBlock = assertBlock; -exports.assertStatement = assertStatement; -exports.assertTerminatorless = assertTerminatorless; -exports.assertCompletionStatement = assertCompletionStatement; -exports.assertConditional = assertConditional; -exports.assertLoop = assertLoop; -exports.assertWhile = assertWhile; -exports.assertExpressionWrapper = assertExpressionWrapper; -exports.assertFor = assertFor; -exports.assertForXStatement = assertForXStatement; -exports.assertFunction = assertFunction; -exports.assertFunctionParent = assertFunctionParent; -exports.assertPureish = assertPureish; -exports.assertDeclaration = assertDeclaration; -exports.assertPatternLike = assertPatternLike; -exports.assertLVal = assertLVal; -exports.assertTSEntityName = assertTSEntityName; -exports.assertLiteral = assertLiteral; -exports.assertImmutable = assertImmutable; -exports.assertUserWhitespacable = assertUserWhitespacable; -exports.assertMethod = assertMethod; -exports.assertObjectMember = assertObjectMember; -exports.assertProperty = assertProperty; -exports.assertUnaryLike = assertUnaryLike; -exports.assertPattern = assertPattern; -exports.assertClass = assertClass; -exports.assertModuleDeclaration = assertModuleDeclaration; -exports.assertExportDeclaration = assertExportDeclaration; -exports.assertModuleSpecifier = assertModuleSpecifier; -exports.assertPrivate = assertPrivate; -exports.assertFlow = assertFlow; -exports.assertFlowType = assertFlowType; -exports.assertFlowBaseAnnotation = assertFlowBaseAnnotation; -exports.assertFlowDeclaration = assertFlowDeclaration; -exports.assertFlowPredicate = assertFlowPredicate; -exports.assertEnumBody = assertEnumBody; -exports.assertEnumMember = assertEnumMember; -exports.assertJSX = assertJSX; -exports.assertTSTypeElement = assertTSTypeElement; -exports.assertTSType = assertTSType; -exports.assertTSBaseType = assertTSBaseType; -exports.assertNumberLiteral = assertNumberLiteral; -exports.assertRegexLiteral = assertRegexLiteral; -exports.assertRestProperty = assertRestProperty; -exports.assertSpreadProperty = assertSpreadProperty; - -var _is = require("../../validators/is"); - -function assert(type, node, opts) { - if (!(0, _is.default)(type, node, opts)) { - throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, ` + `but instead got "${node.type}".`); - } -} - -function assertArrayExpression(node, opts) { - assert("ArrayExpression", node, opts); -} - -function assertAssignmentExpression(node, opts) { - assert("AssignmentExpression", node, opts); -} - -function assertBinaryExpression(node, opts) { - assert("BinaryExpression", node, opts); -} - -function assertInterpreterDirective(node, opts) { - assert("InterpreterDirective", node, opts); -} - -function assertDirective(node, opts) { - assert("Directive", node, opts); -} - -function assertDirectiveLiteral(node, opts) { - assert("DirectiveLiteral", node, opts); -} - -function assertBlockStatement(node, opts) { - assert("BlockStatement", node, opts); -} - -function assertBreakStatement(node, opts) { - assert("BreakStatement", node, opts); -} - -function assertCallExpression(node, opts) { - assert("CallExpression", node, opts); -} - -function assertCatchClause(node, opts) { - assert("CatchClause", node, opts); -} - -function assertConditionalExpression(node, opts) { - assert("ConditionalExpression", node, opts); -} - -function assertContinueStatement(node, opts) { - assert("ContinueStatement", node, opts); -} - -function assertDebuggerStatement(node, opts) { - assert("DebuggerStatement", node, opts); -} - -function assertDoWhileStatement(node, opts) { - assert("DoWhileStatement", node, opts); -} - -function assertEmptyStatement(node, opts) { - assert("EmptyStatement", node, opts); -} - -function assertExpressionStatement(node, opts) { - assert("ExpressionStatement", node, opts); -} - -function assertFile(node, opts) { - assert("File", node, opts); -} - -function assertForInStatement(node, opts) { - assert("ForInStatement", node, opts); -} - -function assertForStatement(node, opts) { - assert("ForStatement", node, opts); -} - -function assertFunctionDeclaration(node, opts) { - assert("FunctionDeclaration", node, opts); -} - -function assertFunctionExpression(node, opts) { - assert("FunctionExpression", node, opts); -} - -function assertIdentifier(node, opts) { - assert("Identifier", node, opts); -} - -function assertIfStatement(node, opts) { - assert("IfStatement", node, opts); -} - -function assertLabeledStatement(node, opts) { - assert("LabeledStatement", node, opts); -} - -function assertStringLiteral(node, opts) { - assert("StringLiteral", node, opts); -} - -function assertNumericLiteral(node, opts) { - assert("NumericLiteral", node, opts); -} - -function assertNullLiteral(node, opts) { - assert("NullLiteral", node, opts); -} - -function assertBooleanLiteral(node, opts) { - assert("BooleanLiteral", node, opts); -} - -function assertRegExpLiteral(node, opts) { - assert("RegExpLiteral", node, opts); -} - -function assertLogicalExpression(node, opts) { - assert("LogicalExpression", node, opts); -} - -function assertMemberExpression(node, opts) { - assert("MemberExpression", node, opts); -} - -function assertNewExpression(node, opts) { - assert("NewExpression", node, opts); -} - -function assertProgram(node, opts) { - assert("Program", node, opts); -} - -function assertObjectExpression(node, opts) { - assert("ObjectExpression", node, opts); -} - -function assertObjectMethod(node, opts) { - assert("ObjectMethod", node, opts); -} - -function assertObjectProperty(node, opts) { - assert("ObjectProperty", node, opts); -} - -function assertRestElement(node, opts) { - assert("RestElement", node, opts); -} - -function assertReturnStatement(node, opts) { - assert("ReturnStatement", node, opts); -} - -function assertSequenceExpression(node, opts) { - assert("SequenceExpression", node, opts); -} - -function assertParenthesizedExpression(node, opts) { - assert("ParenthesizedExpression", node, opts); -} - -function assertSwitchCase(node, opts) { - assert("SwitchCase", node, opts); -} - -function assertSwitchStatement(node, opts) { - assert("SwitchStatement", node, opts); -} - -function assertThisExpression(node, opts) { - assert("ThisExpression", node, opts); -} - -function assertThrowStatement(node, opts) { - assert("ThrowStatement", node, opts); -} - -function assertTryStatement(node, opts) { - assert("TryStatement", node, opts); -} - -function assertUnaryExpression(node, opts) { - assert("UnaryExpression", node, opts); -} - -function assertUpdateExpression(node, opts) { - assert("UpdateExpression", node, opts); -} - -function assertVariableDeclaration(node, opts) { - assert("VariableDeclaration", node, opts); -} - -function assertVariableDeclarator(node, opts) { - assert("VariableDeclarator", node, opts); -} - -function assertWhileStatement(node, opts) { - assert("WhileStatement", node, opts); -} - -function assertWithStatement(node, opts) { - assert("WithStatement", node, opts); -} - -function assertAssignmentPattern(node, opts) { - assert("AssignmentPattern", node, opts); -} - -function assertArrayPattern(node, opts) { - assert("ArrayPattern", node, opts); -} - -function assertArrowFunctionExpression(node, opts) { - assert("ArrowFunctionExpression", node, opts); -} - -function assertClassBody(node, opts) { - assert("ClassBody", node, opts); -} - -function assertClassExpression(node, opts) { - assert("ClassExpression", node, opts); -} - -function assertClassDeclaration(node, opts) { - assert("ClassDeclaration", node, opts); -} - -function assertExportAllDeclaration(node, opts) { - assert("ExportAllDeclaration", node, opts); -} - -function assertExportDefaultDeclaration(node, opts) { - assert("ExportDefaultDeclaration", node, opts); -} - -function assertExportNamedDeclaration(node, opts) { - assert("ExportNamedDeclaration", node, opts); -} - -function assertExportSpecifier(node, opts) { - assert("ExportSpecifier", node, opts); -} - -function assertForOfStatement(node, opts) { - assert("ForOfStatement", node, opts); -} - -function assertImportDeclaration(node, opts) { - assert("ImportDeclaration", node, opts); -} - -function assertImportDefaultSpecifier(node, opts) { - assert("ImportDefaultSpecifier", node, opts); -} - -function assertImportNamespaceSpecifier(node, opts) { - assert("ImportNamespaceSpecifier", node, opts); -} - -function assertImportSpecifier(node, opts) { - assert("ImportSpecifier", node, opts); -} - -function assertMetaProperty(node, opts) { - assert("MetaProperty", node, opts); -} - -function assertClassMethod(node, opts) { - assert("ClassMethod", node, opts); -} - -function assertObjectPattern(node, opts) { - assert("ObjectPattern", node, opts); -} - -function assertSpreadElement(node, opts) { - assert("SpreadElement", node, opts); -} - -function assertSuper(node, opts) { - assert("Super", node, opts); -} - -function assertTaggedTemplateExpression(node, opts) { - assert("TaggedTemplateExpression", node, opts); -} - -function assertTemplateElement(node, opts) { - assert("TemplateElement", node, opts); -} - -function assertTemplateLiteral(node, opts) { - assert("TemplateLiteral", node, opts); -} - -function assertYieldExpression(node, opts) { - assert("YieldExpression", node, opts); -} - -function assertAwaitExpression(node, opts) { - assert("AwaitExpression", node, opts); -} - -function assertImport(node, opts) { - assert("Import", node, opts); -} - -function assertBigIntLiteral(node, opts) { - assert("BigIntLiteral", node, opts); -} - -function assertExportNamespaceSpecifier(node, opts) { - assert("ExportNamespaceSpecifier", node, opts); -} - -function assertOptionalMemberExpression(node, opts) { - assert("OptionalMemberExpression", node, opts); -} - -function assertOptionalCallExpression(node, opts) { - assert("OptionalCallExpression", node, opts); -} - -function assertClassProperty(node, opts) { - assert("ClassProperty", node, opts); -} - -function assertClassPrivateProperty(node, opts) { - assert("ClassPrivateProperty", node, opts); -} - -function assertClassPrivateMethod(node, opts) { - assert("ClassPrivateMethod", node, opts); -} - -function assertPrivateName(node, opts) { - assert("PrivateName", node, opts); -} - -function assertAnyTypeAnnotation(node, opts) { - assert("AnyTypeAnnotation", node, opts); -} - -function assertArrayTypeAnnotation(node, opts) { - assert("ArrayTypeAnnotation", node, opts); -} - -function assertBooleanTypeAnnotation(node, opts) { - assert("BooleanTypeAnnotation", node, opts); -} - -function assertBooleanLiteralTypeAnnotation(node, opts) { - assert("BooleanLiteralTypeAnnotation", node, opts); -} - -function assertNullLiteralTypeAnnotation(node, opts) { - assert("NullLiteralTypeAnnotation", node, opts); -} - -function assertClassImplements(node, opts) { - assert("ClassImplements", node, opts); -} - -function assertDeclareClass(node, opts) { - assert("DeclareClass", node, opts); -} - -function assertDeclareFunction(node, opts) { - assert("DeclareFunction", node, opts); -} - -function assertDeclareInterface(node, opts) { - assert("DeclareInterface", node, opts); -} - -function assertDeclareModule(node, opts) { - assert("DeclareModule", node, opts); -} - -function assertDeclareModuleExports(node, opts) { - assert("DeclareModuleExports", node, opts); -} - -function assertDeclareTypeAlias(node, opts) { - assert("DeclareTypeAlias", node, opts); -} - -function assertDeclareOpaqueType(node, opts) { - assert("DeclareOpaqueType", node, opts); -} - -function assertDeclareVariable(node, opts) { - assert("DeclareVariable", node, opts); -} - -function assertDeclareExportDeclaration(node, opts) { - assert("DeclareExportDeclaration", node, opts); -} - -function assertDeclareExportAllDeclaration(node, opts) { - assert("DeclareExportAllDeclaration", node, opts); -} - -function assertDeclaredPredicate(node, opts) { - assert("DeclaredPredicate", node, opts); -} - -function assertExistsTypeAnnotation(node, opts) { - assert("ExistsTypeAnnotation", node, opts); -} - -function assertFunctionTypeAnnotation(node, opts) { - assert("FunctionTypeAnnotation", node, opts); -} - -function assertFunctionTypeParam(node, opts) { - assert("FunctionTypeParam", node, opts); -} - -function assertGenericTypeAnnotation(node, opts) { - assert("GenericTypeAnnotation", node, opts); -} - -function assertInferredPredicate(node, opts) { - assert("InferredPredicate", node, opts); -} - -function assertInterfaceExtends(node, opts) { - assert("InterfaceExtends", node, opts); -} - -function assertInterfaceDeclaration(node, opts) { - assert("InterfaceDeclaration", node, opts); -} - -function assertInterfaceTypeAnnotation(node, opts) { - assert("InterfaceTypeAnnotation", node, opts); -} - -function assertIntersectionTypeAnnotation(node, opts) { - assert("IntersectionTypeAnnotation", node, opts); -} - -function assertMixedTypeAnnotation(node, opts) { - assert("MixedTypeAnnotation", node, opts); -} - -function assertEmptyTypeAnnotation(node, opts) { - assert("EmptyTypeAnnotation", node, opts); -} - -function assertNullableTypeAnnotation(node, opts) { - assert("NullableTypeAnnotation", node, opts); -} - -function assertNumberLiteralTypeAnnotation(node, opts) { - assert("NumberLiteralTypeAnnotation", node, opts); -} - -function assertNumberTypeAnnotation(node, opts) { - assert("NumberTypeAnnotation", node, opts); -} - -function assertObjectTypeAnnotation(node, opts) { - assert("ObjectTypeAnnotation", node, opts); -} - -function assertObjectTypeInternalSlot(node, opts) { - assert("ObjectTypeInternalSlot", node, opts); -} - -function assertObjectTypeCallProperty(node, opts) { - assert("ObjectTypeCallProperty", node, opts); -} - -function assertObjectTypeIndexer(node, opts) { - assert("ObjectTypeIndexer", node, opts); -} - -function assertObjectTypeProperty(node, opts) { - assert("ObjectTypeProperty", node, opts); -} - -function assertObjectTypeSpreadProperty(node, opts) { - assert("ObjectTypeSpreadProperty", node, opts); -} - -function assertOpaqueType(node, opts) { - assert("OpaqueType", node, opts); -} - -function assertQualifiedTypeIdentifier(node, opts) { - assert("QualifiedTypeIdentifier", node, opts); -} - -function assertStringLiteralTypeAnnotation(node, opts) { - assert("StringLiteralTypeAnnotation", node, opts); -} - -function assertStringTypeAnnotation(node, opts) { - assert("StringTypeAnnotation", node, opts); -} - -function assertSymbolTypeAnnotation(node, opts) { - assert("SymbolTypeAnnotation", node, opts); -} - -function assertThisTypeAnnotation(node, opts) { - assert("ThisTypeAnnotation", node, opts); -} - -function assertTupleTypeAnnotation(node, opts) { - assert("TupleTypeAnnotation", node, opts); -} - -function assertTypeofTypeAnnotation(node, opts) { - assert("TypeofTypeAnnotation", node, opts); -} - -function assertTypeAlias(node, opts) { - assert("TypeAlias", node, opts); -} - -function assertTypeAnnotation(node, opts) { - assert("TypeAnnotation", node, opts); -} - -function assertTypeCastExpression(node, opts) { - assert("TypeCastExpression", node, opts); -} - -function assertTypeParameter(node, opts) { - assert("TypeParameter", node, opts); -} - -function assertTypeParameterDeclaration(node, opts) { - assert("TypeParameterDeclaration", node, opts); -} - -function assertTypeParameterInstantiation(node, opts) { - assert("TypeParameterInstantiation", node, opts); -} - -function assertUnionTypeAnnotation(node, opts) { - assert("UnionTypeAnnotation", node, opts); -} - -function assertVariance(node, opts) { - assert("Variance", node, opts); -} - -function assertVoidTypeAnnotation(node, opts) { - assert("VoidTypeAnnotation", node, opts); -} - -function assertEnumDeclaration(node, opts) { - assert("EnumDeclaration", node, opts); -} - -function assertEnumBooleanBody(node, opts) { - assert("EnumBooleanBody", node, opts); -} - -function assertEnumNumberBody(node, opts) { - assert("EnumNumberBody", node, opts); -} - -function assertEnumStringBody(node, opts) { - assert("EnumStringBody", node, opts); -} - -function assertEnumSymbolBody(node, opts) { - assert("EnumSymbolBody", node, opts); -} - -function assertEnumBooleanMember(node, opts) { - assert("EnumBooleanMember", node, opts); -} - -function assertEnumNumberMember(node, opts) { - assert("EnumNumberMember", node, opts); -} - -function assertEnumStringMember(node, opts) { - assert("EnumStringMember", node, opts); -} - -function assertEnumDefaultedMember(node, opts) { - assert("EnumDefaultedMember", node, opts); -} - -function assertIndexedAccessType(node, opts) { - assert("IndexedAccessType", node, opts); -} - -function assertOptionalIndexedAccessType(node, opts) { - assert("OptionalIndexedAccessType", node, opts); -} - -function assertJSXAttribute(node, opts) { - assert("JSXAttribute", node, opts); -} - -function assertJSXClosingElement(node, opts) { - assert("JSXClosingElement", node, opts); -} - -function assertJSXElement(node, opts) { - assert("JSXElement", node, opts); -} - -function assertJSXEmptyExpression(node, opts) { - assert("JSXEmptyExpression", node, opts); -} - -function assertJSXExpressionContainer(node, opts) { - assert("JSXExpressionContainer", node, opts); -} - -function assertJSXSpreadChild(node, opts) { - assert("JSXSpreadChild", node, opts); -} - -function assertJSXIdentifier(node, opts) { - assert("JSXIdentifier", node, opts); -} - -function assertJSXMemberExpression(node, opts) { - assert("JSXMemberExpression", node, opts); -} - -function assertJSXNamespacedName(node, opts) { - assert("JSXNamespacedName", node, opts); -} - -function assertJSXOpeningElement(node, opts) { - assert("JSXOpeningElement", node, opts); -} - -function assertJSXSpreadAttribute(node, opts) { - assert("JSXSpreadAttribute", node, opts); -} - -function assertJSXText(node, opts) { - assert("JSXText", node, opts); -} - -function assertJSXFragment(node, opts) { - assert("JSXFragment", node, opts); -} - -function assertJSXOpeningFragment(node, opts) { - assert("JSXOpeningFragment", node, opts); -} - -function assertJSXClosingFragment(node, opts) { - assert("JSXClosingFragment", node, opts); -} - -function assertNoop(node, opts) { - assert("Noop", node, opts); -} - -function assertPlaceholder(node, opts) { - assert("Placeholder", node, opts); -} - -function assertV8IntrinsicIdentifier(node, opts) { - assert("V8IntrinsicIdentifier", node, opts); -} - -function assertArgumentPlaceholder(node, opts) { - assert("ArgumentPlaceholder", node, opts); -} - -function assertBindExpression(node, opts) { - assert("BindExpression", node, opts); -} - -function assertImportAttribute(node, opts) { - assert("ImportAttribute", node, opts); -} - -function assertDecorator(node, opts) { - assert("Decorator", node, opts); -} - -function assertDoExpression(node, opts) { - assert("DoExpression", node, opts); -} - -function assertExportDefaultSpecifier(node, opts) { - assert("ExportDefaultSpecifier", node, opts); -} - -function assertRecordExpression(node, opts) { - assert("RecordExpression", node, opts); -} - -function assertTupleExpression(node, opts) { - assert("TupleExpression", node, opts); -} - -function assertDecimalLiteral(node, opts) { - assert("DecimalLiteral", node, opts); -} - -function assertStaticBlock(node, opts) { - assert("StaticBlock", node, opts); -} - -function assertModuleExpression(node, opts) { - assert("ModuleExpression", node, opts); -} - -function assertTopicReference(node, opts) { - assert("TopicReference", node, opts); -} - -function assertPipelineTopicExpression(node, opts) { - assert("PipelineTopicExpression", node, opts); -} - -function assertPipelineBareFunction(node, opts) { - assert("PipelineBareFunction", node, opts); -} - -function assertPipelinePrimaryTopicReference(node, opts) { - assert("PipelinePrimaryTopicReference", node, opts); -} - -function assertTSParameterProperty(node, opts) { - assert("TSParameterProperty", node, opts); -} - -function assertTSDeclareFunction(node, opts) { - assert("TSDeclareFunction", node, opts); -} - -function assertTSDeclareMethod(node, opts) { - assert("TSDeclareMethod", node, opts); -} - -function assertTSQualifiedName(node, opts) { - assert("TSQualifiedName", node, opts); -} - -function assertTSCallSignatureDeclaration(node, opts) { - assert("TSCallSignatureDeclaration", node, opts); -} - -function assertTSConstructSignatureDeclaration(node, opts) { - assert("TSConstructSignatureDeclaration", node, opts); -} - -function assertTSPropertySignature(node, opts) { - assert("TSPropertySignature", node, opts); -} - -function assertTSMethodSignature(node, opts) { - assert("TSMethodSignature", node, opts); -} - -function assertTSIndexSignature(node, opts) { - assert("TSIndexSignature", node, opts); -} - -function assertTSAnyKeyword(node, opts) { - assert("TSAnyKeyword", node, opts); -} - -function assertTSBooleanKeyword(node, opts) { - assert("TSBooleanKeyword", node, opts); -} - -function assertTSBigIntKeyword(node, opts) { - assert("TSBigIntKeyword", node, opts); -} - -function assertTSIntrinsicKeyword(node, opts) { - assert("TSIntrinsicKeyword", node, opts); -} - -function assertTSNeverKeyword(node, opts) { - assert("TSNeverKeyword", node, opts); -} - -function assertTSNullKeyword(node, opts) { - assert("TSNullKeyword", node, opts); -} - -function assertTSNumberKeyword(node, opts) { - assert("TSNumberKeyword", node, opts); -} - -function assertTSObjectKeyword(node, opts) { - assert("TSObjectKeyword", node, opts); -} - -function assertTSStringKeyword(node, opts) { - assert("TSStringKeyword", node, opts); -} - -function assertTSSymbolKeyword(node, opts) { - assert("TSSymbolKeyword", node, opts); -} - -function assertTSUndefinedKeyword(node, opts) { - assert("TSUndefinedKeyword", node, opts); -} - -function assertTSUnknownKeyword(node, opts) { - assert("TSUnknownKeyword", node, opts); -} - -function assertTSVoidKeyword(node, opts) { - assert("TSVoidKeyword", node, opts); -} - -function assertTSThisType(node, opts) { - assert("TSThisType", node, opts); -} - -function assertTSFunctionType(node, opts) { - assert("TSFunctionType", node, opts); -} - -function assertTSConstructorType(node, opts) { - assert("TSConstructorType", node, opts); -} - -function assertTSTypeReference(node, opts) { - assert("TSTypeReference", node, opts); -} - -function assertTSTypePredicate(node, opts) { - assert("TSTypePredicate", node, opts); -} - -function assertTSTypeQuery(node, opts) { - assert("TSTypeQuery", node, opts); -} - -function assertTSTypeLiteral(node, opts) { - assert("TSTypeLiteral", node, opts); -} - -function assertTSArrayType(node, opts) { - assert("TSArrayType", node, opts); -} - -function assertTSTupleType(node, opts) { - assert("TSTupleType", node, opts); -} - -function assertTSOptionalType(node, opts) { - assert("TSOptionalType", node, opts); -} - -function assertTSRestType(node, opts) { - assert("TSRestType", node, opts); -} - -function assertTSNamedTupleMember(node, opts) { - assert("TSNamedTupleMember", node, opts); -} - -function assertTSUnionType(node, opts) { - assert("TSUnionType", node, opts); -} - -function assertTSIntersectionType(node, opts) { - assert("TSIntersectionType", node, opts); -} - -function assertTSConditionalType(node, opts) { - assert("TSConditionalType", node, opts); -} - -function assertTSInferType(node, opts) { - assert("TSInferType", node, opts); -} - -function assertTSParenthesizedType(node, opts) { - assert("TSParenthesizedType", node, opts); -} - -function assertTSTypeOperator(node, opts) { - assert("TSTypeOperator", node, opts); -} - -function assertTSIndexedAccessType(node, opts) { - assert("TSIndexedAccessType", node, opts); -} - -function assertTSMappedType(node, opts) { - assert("TSMappedType", node, opts); -} - -function assertTSLiteralType(node, opts) { - assert("TSLiteralType", node, opts); -} - -function assertTSExpressionWithTypeArguments(node, opts) { - assert("TSExpressionWithTypeArguments", node, opts); -} - -function assertTSInterfaceDeclaration(node, opts) { - assert("TSInterfaceDeclaration", node, opts); -} - -function assertTSInterfaceBody(node, opts) { - assert("TSInterfaceBody", node, opts); -} - -function assertTSTypeAliasDeclaration(node, opts) { - assert("TSTypeAliasDeclaration", node, opts); -} - -function assertTSAsExpression(node, opts) { - assert("TSAsExpression", node, opts); -} - -function assertTSTypeAssertion(node, opts) { - assert("TSTypeAssertion", node, opts); -} - -function assertTSEnumDeclaration(node, opts) { - assert("TSEnumDeclaration", node, opts); -} - -function assertTSEnumMember(node, opts) { - assert("TSEnumMember", node, opts); -} - -function assertTSModuleDeclaration(node, opts) { - assert("TSModuleDeclaration", node, opts); -} - -function assertTSModuleBlock(node, opts) { - assert("TSModuleBlock", node, opts); -} - -function assertTSImportType(node, opts) { - assert("TSImportType", node, opts); -} - -function assertTSImportEqualsDeclaration(node, opts) { - assert("TSImportEqualsDeclaration", node, opts); -} - -function assertTSExternalModuleReference(node, opts) { - assert("TSExternalModuleReference", node, opts); -} - -function assertTSNonNullExpression(node, opts) { - assert("TSNonNullExpression", node, opts); -} - -function assertTSExportAssignment(node, opts) { - assert("TSExportAssignment", node, opts); -} - -function assertTSNamespaceExportDeclaration(node, opts) { - assert("TSNamespaceExportDeclaration", node, opts); -} - -function assertTSTypeAnnotation(node, opts) { - assert("TSTypeAnnotation", node, opts); -} - -function assertTSTypeParameterInstantiation(node, opts) { - assert("TSTypeParameterInstantiation", node, opts); -} - -function assertTSTypeParameterDeclaration(node, opts) { - assert("TSTypeParameterDeclaration", node, opts); -} - -function assertTSTypeParameter(node, opts) { - assert("TSTypeParameter", node, opts); -} - -function assertExpression(node, opts) { - assert("Expression", node, opts); -} - -function assertBinary(node, opts) { - assert("Binary", node, opts); -} - -function assertScopable(node, opts) { - assert("Scopable", node, opts); -} - -function assertBlockParent(node, opts) { - assert("BlockParent", node, opts); -} - -function assertBlock(node, opts) { - assert("Block", node, opts); -} - -function assertStatement(node, opts) { - assert("Statement", node, opts); -} - -function assertTerminatorless(node, opts) { - assert("Terminatorless", node, opts); -} - -function assertCompletionStatement(node, opts) { - assert("CompletionStatement", node, opts); -} - -function assertConditional(node, opts) { - assert("Conditional", node, opts); -} - -function assertLoop(node, opts) { - assert("Loop", node, opts); -} - -function assertWhile(node, opts) { - assert("While", node, opts); -} - -function assertExpressionWrapper(node, opts) { - assert("ExpressionWrapper", node, opts); -} - -function assertFor(node, opts) { - assert("For", node, opts); -} - -function assertForXStatement(node, opts) { - assert("ForXStatement", node, opts); -} - -function assertFunction(node, opts) { - assert("Function", node, opts); -} - -function assertFunctionParent(node, opts) { - assert("FunctionParent", node, opts); -} - -function assertPureish(node, opts) { - assert("Pureish", node, opts); -} - -function assertDeclaration(node, opts) { - assert("Declaration", node, opts); -} - -function assertPatternLike(node, opts) { - assert("PatternLike", node, opts); -} - -function assertLVal(node, opts) { - assert("LVal", node, opts); -} - -function assertTSEntityName(node, opts) { - assert("TSEntityName", node, opts); -} - -function assertLiteral(node, opts) { - assert("Literal", node, opts); -} - -function assertImmutable(node, opts) { - assert("Immutable", node, opts); -} - -function assertUserWhitespacable(node, opts) { - assert("UserWhitespacable", node, opts); -} - -function assertMethod(node, opts) { - assert("Method", node, opts); -} - -function assertObjectMember(node, opts) { - assert("ObjectMember", node, opts); -} - -function assertProperty(node, opts) { - assert("Property", node, opts); -} - -function assertUnaryLike(node, opts) { - assert("UnaryLike", node, opts); -} - -function assertPattern(node, opts) { - assert("Pattern", node, opts); -} - -function assertClass(node, opts) { - assert("Class", node, opts); -} - -function assertModuleDeclaration(node, opts) { - assert("ModuleDeclaration", node, opts); -} - -function assertExportDeclaration(node, opts) { - assert("ExportDeclaration", node, opts); -} - -function assertModuleSpecifier(node, opts) { - assert("ModuleSpecifier", node, opts); -} - -function assertPrivate(node, opts) { - assert("Private", node, opts); -} - -function assertFlow(node, opts) { - assert("Flow", node, opts); -} - -function assertFlowType(node, opts) { - assert("FlowType", node, opts); -} - -function assertFlowBaseAnnotation(node, opts) { - assert("FlowBaseAnnotation", node, opts); -} - -function assertFlowDeclaration(node, opts) { - assert("FlowDeclaration", node, opts); -} - -function assertFlowPredicate(node, opts) { - assert("FlowPredicate", node, opts); -} - -function assertEnumBody(node, opts) { - assert("EnumBody", node, opts); -} - -function assertEnumMember(node, opts) { - assert("EnumMember", node, opts); -} - -function assertJSX(node, opts) { - assert("JSX", node, opts); -} - -function assertTSTypeElement(node, opts) { - assert("TSTypeElement", node, opts); -} - -function assertTSType(node, opts) { - assert("TSType", node, opts); -} - -function assertTSBaseType(node, opts) { - assert("TSBaseType", node, opts); -} - -function assertNumberLiteral(node, opts) { - console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - assert("NumberLiteral", node, opts); -} - -function assertRegexLiteral(node, opts) { - console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - assert("RegexLiteral", node, opts); -} - -function assertRestProperty(node, opts) { - console.trace("The node type RestProperty has been renamed to RestElement"); - assert("RestProperty", node, opts); -} - -function assertSpreadProperty(node, opts) { - console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - assert("SpreadProperty", node, opts); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/ast-types/generated/index.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/ast-types/generated/index.js deleted file mode 100644 index e69de29b..00000000 diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/builder.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/builder.js deleted file mode 100644 index b8a01713..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/builder.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = builder; - -var _definitions = require("../definitions"); - -var _validate = require("../validators/validate"); - -function builder(type, ...args) { - const keys = _definitions.BUILDER_KEYS[type]; - const countArgs = args.length; - - if (countArgs > keys.length) { - throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`); - } - - const node = { - type - }; - let i = 0; - keys.forEach(key => { - const field = _definitions.NODE_FIELDS[type][key]; - let arg; - if (i < countArgs) arg = args[i]; - - if (arg === undefined) { - arg = Array.isArray(field.default) ? [] : field.default; - } - - node[key] = arg; - i++; - }); - - for (const key of Object.keys(node)) { - (0, _validate.default)(node, key, node[key]); - } - - return node; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js deleted file mode 100644 index ddf20fdd..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = createFlowUnionType; - -var _generated = require("../generated"); - -var _removeTypeDuplicates = require("../../modifications/flow/removeTypeDuplicates"); - -function createFlowUnionType(types) { - const flattened = (0, _removeTypeDuplicates.default)(types); - - if (flattened.length === 1) { - return flattened[0]; - } else { - return (0, _generated.unionTypeAnnotation)(flattened); - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js deleted file mode 100644 index 7711322e..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = createTypeAnnotationBasedOnTypeof; - -var _generated = require("../generated"); - -function createTypeAnnotationBasedOnTypeof(type) { - if (type === "string") { - return (0, _generated.stringTypeAnnotation)(); - } else if (type === "number") { - return (0, _generated.numberTypeAnnotation)(); - } else if (type === "undefined") { - return (0, _generated.voidTypeAnnotation)(); - } else if (type === "boolean") { - return (0, _generated.booleanTypeAnnotation)(); - } else if (type === "function") { - return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Function")); - } else if (type === "object") { - return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Object")); - } else if (type === "symbol") { - return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Symbol")); - } else if (type === "bigint") { - return (0, _generated.anyTypeAnnotation)(); - } else { - throw new Error("Invalid typeof value: " + type); - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/generated/index.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/generated/index.js deleted file mode 100644 index cb40ee6e..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/generated/index.js +++ /dev/null @@ -1,1261 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.arrayExpression = arrayExpression; -exports.assignmentExpression = assignmentExpression; -exports.binaryExpression = binaryExpression; -exports.interpreterDirective = interpreterDirective; -exports.directive = directive; -exports.directiveLiteral = directiveLiteral; -exports.blockStatement = blockStatement; -exports.breakStatement = breakStatement; -exports.callExpression = callExpression; -exports.catchClause = catchClause; -exports.conditionalExpression = conditionalExpression; -exports.continueStatement = continueStatement; -exports.debuggerStatement = debuggerStatement; -exports.doWhileStatement = doWhileStatement; -exports.emptyStatement = emptyStatement; -exports.expressionStatement = expressionStatement; -exports.file = file; -exports.forInStatement = forInStatement; -exports.forStatement = forStatement; -exports.functionDeclaration = functionDeclaration; -exports.functionExpression = functionExpression; -exports.identifier = identifier; -exports.ifStatement = ifStatement; -exports.labeledStatement = labeledStatement; -exports.stringLiteral = stringLiteral; -exports.numericLiteral = numericLiteral; -exports.nullLiteral = nullLiteral; -exports.booleanLiteral = booleanLiteral; -exports.regExpLiteral = regExpLiteral; -exports.logicalExpression = logicalExpression; -exports.memberExpression = memberExpression; -exports.newExpression = newExpression; -exports.program = program; -exports.objectExpression = objectExpression; -exports.objectMethod = objectMethod; -exports.objectProperty = objectProperty; -exports.restElement = restElement; -exports.returnStatement = returnStatement; -exports.sequenceExpression = sequenceExpression; -exports.parenthesizedExpression = parenthesizedExpression; -exports.switchCase = switchCase; -exports.switchStatement = switchStatement; -exports.thisExpression = thisExpression; -exports.throwStatement = throwStatement; -exports.tryStatement = tryStatement; -exports.unaryExpression = unaryExpression; -exports.updateExpression = updateExpression; -exports.variableDeclaration = variableDeclaration; -exports.variableDeclarator = variableDeclarator; -exports.whileStatement = whileStatement; -exports.withStatement = withStatement; -exports.assignmentPattern = assignmentPattern; -exports.arrayPattern = arrayPattern; -exports.arrowFunctionExpression = arrowFunctionExpression; -exports.classBody = classBody; -exports.classExpression = classExpression; -exports.classDeclaration = classDeclaration; -exports.exportAllDeclaration = exportAllDeclaration; -exports.exportDefaultDeclaration = exportDefaultDeclaration; -exports.exportNamedDeclaration = exportNamedDeclaration; -exports.exportSpecifier = exportSpecifier; -exports.forOfStatement = forOfStatement; -exports.importDeclaration = importDeclaration; -exports.importDefaultSpecifier = importDefaultSpecifier; -exports.importNamespaceSpecifier = importNamespaceSpecifier; -exports.importSpecifier = importSpecifier; -exports.metaProperty = metaProperty; -exports.classMethod = classMethod; -exports.objectPattern = objectPattern; -exports.spreadElement = spreadElement; -exports.super = _super; -exports.taggedTemplateExpression = taggedTemplateExpression; -exports.templateElement = templateElement; -exports.templateLiteral = templateLiteral; -exports.yieldExpression = yieldExpression; -exports.awaitExpression = awaitExpression; -exports.import = _import; -exports.bigIntLiteral = bigIntLiteral; -exports.exportNamespaceSpecifier = exportNamespaceSpecifier; -exports.optionalMemberExpression = optionalMemberExpression; -exports.optionalCallExpression = optionalCallExpression; -exports.classProperty = classProperty; -exports.classPrivateProperty = classPrivateProperty; -exports.classPrivateMethod = classPrivateMethod; -exports.privateName = privateName; -exports.anyTypeAnnotation = anyTypeAnnotation; -exports.arrayTypeAnnotation = arrayTypeAnnotation; -exports.booleanTypeAnnotation = booleanTypeAnnotation; -exports.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation; -exports.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation; -exports.classImplements = classImplements; -exports.declareClass = declareClass; -exports.declareFunction = declareFunction; -exports.declareInterface = declareInterface; -exports.declareModule = declareModule; -exports.declareModuleExports = declareModuleExports; -exports.declareTypeAlias = declareTypeAlias; -exports.declareOpaqueType = declareOpaqueType; -exports.declareVariable = declareVariable; -exports.declareExportDeclaration = declareExportDeclaration; -exports.declareExportAllDeclaration = declareExportAllDeclaration; -exports.declaredPredicate = declaredPredicate; -exports.existsTypeAnnotation = existsTypeAnnotation; -exports.functionTypeAnnotation = functionTypeAnnotation; -exports.functionTypeParam = functionTypeParam; -exports.genericTypeAnnotation = genericTypeAnnotation; -exports.inferredPredicate = inferredPredicate; -exports.interfaceExtends = interfaceExtends; -exports.interfaceDeclaration = interfaceDeclaration; -exports.interfaceTypeAnnotation = interfaceTypeAnnotation; -exports.intersectionTypeAnnotation = intersectionTypeAnnotation; -exports.mixedTypeAnnotation = mixedTypeAnnotation; -exports.emptyTypeAnnotation = emptyTypeAnnotation; -exports.nullableTypeAnnotation = nullableTypeAnnotation; -exports.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation; -exports.numberTypeAnnotation = numberTypeAnnotation; -exports.objectTypeAnnotation = objectTypeAnnotation; -exports.objectTypeInternalSlot = objectTypeInternalSlot; -exports.objectTypeCallProperty = objectTypeCallProperty; -exports.objectTypeIndexer = objectTypeIndexer; -exports.objectTypeProperty = objectTypeProperty; -exports.objectTypeSpreadProperty = objectTypeSpreadProperty; -exports.opaqueType = opaqueType; -exports.qualifiedTypeIdentifier = qualifiedTypeIdentifier; -exports.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation; -exports.stringTypeAnnotation = stringTypeAnnotation; -exports.symbolTypeAnnotation = symbolTypeAnnotation; -exports.thisTypeAnnotation = thisTypeAnnotation; -exports.tupleTypeAnnotation = tupleTypeAnnotation; -exports.typeofTypeAnnotation = typeofTypeAnnotation; -exports.typeAlias = typeAlias; -exports.typeAnnotation = typeAnnotation; -exports.typeCastExpression = typeCastExpression; -exports.typeParameter = typeParameter; -exports.typeParameterDeclaration = typeParameterDeclaration; -exports.typeParameterInstantiation = typeParameterInstantiation; -exports.unionTypeAnnotation = unionTypeAnnotation; -exports.variance = variance; -exports.voidTypeAnnotation = voidTypeAnnotation; -exports.enumDeclaration = enumDeclaration; -exports.enumBooleanBody = enumBooleanBody; -exports.enumNumberBody = enumNumberBody; -exports.enumStringBody = enumStringBody; -exports.enumSymbolBody = enumSymbolBody; -exports.enumBooleanMember = enumBooleanMember; -exports.enumNumberMember = enumNumberMember; -exports.enumStringMember = enumStringMember; -exports.enumDefaultedMember = enumDefaultedMember; -exports.indexedAccessType = indexedAccessType; -exports.optionalIndexedAccessType = optionalIndexedAccessType; -exports.jSXAttribute = exports.jsxAttribute = jsxAttribute; -exports.jSXClosingElement = exports.jsxClosingElement = jsxClosingElement; -exports.jSXElement = exports.jsxElement = jsxElement; -exports.jSXEmptyExpression = exports.jsxEmptyExpression = jsxEmptyExpression; -exports.jSXExpressionContainer = exports.jsxExpressionContainer = jsxExpressionContainer; -exports.jSXSpreadChild = exports.jsxSpreadChild = jsxSpreadChild; -exports.jSXIdentifier = exports.jsxIdentifier = jsxIdentifier; -exports.jSXMemberExpression = exports.jsxMemberExpression = jsxMemberExpression; -exports.jSXNamespacedName = exports.jsxNamespacedName = jsxNamespacedName; -exports.jSXOpeningElement = exports.jsxOpeningElement = jsxOpeningElement; -exports.jSXSpreadAttribute = exports.jsxSpreadAttribute = jsxSpreadAttribute; -exports.jSXText = exports.jsxText = jsxText; -exports.jSXFragment = exports.jsxFragment = jsxFragment; -exports.jSXOpeningFragment = exports.jsxOpeningFragment = jsxOpeningFragment; -exports.jSXClosingFragment = exports.jsxClosingFragment = jsxClosingFragment; -exports.noop = noop; -exports.placeholder = placeholder; -exports.v8IntrinsicIdentifier = v8IntrinsicIdentifier; -exports.argumentPlaceholder = argumentPlaceholder; -exports.bindExpression = bindExpression; -exports.importAttribute = importAttribute; -exports.decorator = decorator; -exports.doExpression = doExpression; -exports.exportDefaultSpecifier = exportDefaultSpecifier; -exports.recordExpression = recordExpression; -exports.tupleExpression = tupleExpression; -exports.decimalLiteral = decimalLiteral; -exports.staticBlock = staticBlock; -exports.moduleExpression = moduleExpression; -exports.topicReference = topicReference; -exports.pipelineTopicExpression = pipelineTopicExpression; -exports.pipelineBareFunction = pipelineBareFunction; -exports.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference; -exports.tSParameterProperty = exports.tsParameterProperty = tsParameterProperty; -exports.tSDeclareFunction = exports.tsDeclareFunction = tsDeclareFunction; -exports.tSDeclareMethod = exports.tsDeclareMethod = tsDeclareMethod; -exports.tSQualifiedName = exports.tsQualifiedName = tsQualifiedName; -exports.tSCallSignatureDeclaration = exports.tsCallSignatureDeclaration = tsCallSignatureDeclaration; -exports.tSConstructSignatureDeclaration = exports.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration; -exports.tSPropertySignature = exports.tsPropertySignature = tsPropertySignature; -exports.tSMethodSignature = exports.tsMethodSignature = tsMethodSignature; -exports.tSIndexSignature = exports.tsIndexSignature = tsIndexSignature; -exports.tSAnyKeyword = exports.tsAnyKeyword = tsAnyKeyword; -exports.tSBooleanKeyword = exports.tsBooleanKeyword = tsBooleanKeyword; -exports.tSBigIntKeyword = exports.tsBigIntKeyword = tsBigIntKeyword; -exports.tSIntrinsicKeyword = exports.tsIntrinsicKeyword = tsIntrinsicKeyword; -exports.tSNeverKeyword = exports.tsNeverKeyword = tsNeverKeyword; -exports.tSNullKeyword = exports.tsNullKeyword = tsNullKeyword; -exports.tSNumberKeyword = exports.tsNumberKeyword = tsNumberKeyword; -exports.tSObjectKeyword = exports.tsObjectKeyword = tsObjectKeyword; -exports.tSStringKeyword = exports.tsStringKeyword = tsStringKeyword; -exports.tSSymbolKeyword = exports.tsSymbolKeyword = tsSymbolKeyword; -exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = tsUndefinedKeyword; -exports.tSUnknownKeyword = exports.tsUnknownKeyword = tsUnknownKeyword; -exports.tSVoidKeyword = exports.tsVoidKeyword = tsVoidKeyword; -exports.tSThisType = exports.tsThisType = tsThisType; -exports.tSFunctionType = exports.tsFunctionType = tsFunctionType; -exports.tSConstructorType = exports.tsConstructorType = tsConstructorType; -exports.tSTypeReference = exports.tsTypeReference = tsTypeReference; -exports.tSTypePredicate = exports.tsTypePredicate = tsTypePredicate; -exports.tSTypeQuery = exports.tsTypeQuery = tsTypeQuery; -exports.tSTypeLiteral = exports.tsTypeLiteral = tsTypeLiteral; -exports.tSArrayType = exports.tsArrayType = tsArrayType; -exports.tSTupleType = exports.tsTupleType = tsTupleType; -exports.tSOptionalType = exports.tsOptionalType = tsOptionalType; -exports.tSRestType = exports.tsRestType = tsRestType; -exports.tSNamedTupleMember = exports.tsNamedTupleMember = tsNamedTupleMember; -exports.tSUnionType = exports.tsUnionType = tsUnionType; -exports.tSIntersectionType = exports.tsIntersectionType = tsIntersectionType; -exports.tSConditionalType = exports.tsConditionalType = tsConditionalType; -exports.tSInferType = exports.tsInferType = tsInferType; -exports.tSParenthesizedType = exports.tsParenthesizedType = tsParenthesizedType; -exports.tSTypeOperator = exports.tsTypeOperator = tsTypeOperator; -exports.tSIndexedAccessType = exports.tsIndexedAccessType = tsIndexedAccessType; -exports.tSMappedType = exports.tsMappedType = tsMappedType; -exports.tSLiteralType = exports.tsLiteralType = tsLiteralType; -exports.tSExpressionWithTypeArguments = exports.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments; -exports.tSInterfaceDeclaration = exports.tsInterfaceDeclaration = tsInterfaceDeclaration; -exports.tSInterfaceBody = exports.tsInterfaceBody = tsInterfaceBody; -exports.tSTypeAliasDeclaration = exports.tsTypeAliasDeclaration = tsTypeAliasDeclaration; -exports.tSAsExpression = exports.tsAsExpression = tsAsExpression; -exports.tSTypeAssertion = exports.tsTypeAssertion = tsTypeAssertion; -exports.tSEnumDeclaration = exports.tsEnumDeclaration = tsEnumDeclaration; -exports.tSEnumMember = exports.tsEnumMember = tsEnumMember; -exports.tSModuleDeclaration = exports.tsModuleDeclaration = tsModuleDeclaration; -exports.tSModuleBlock = exports.tsModuleBlock = tsModuleBlock; -exports.tSImportType = exports.tsImportType = tsImportType; -exports.tSImportEqualsDeclaration = exports.tsImportEqualsDeclaration = tsImportEqualsDeclaration; -exports.tSExternalModuleReference = exports.tsExternalModuleReference = tsExternalModuleReference; -exports.tSNonNullExpression = exports.tsNonNullExpression = tsNonNullExpression; -exports.tSExportAssignment = exports.tsExportAssignment = tsExportAssignment; -exports.tSNamespaceExportDeclaration = exports.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration; -exports.tSTypeAnnotation = exports.tsTypeAnnotation = tsTypeAnnotation; -exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = tsTypeParameterInstantiation; -exports.tSTypeParameterDeclaration = exports.tsTypeParameterDeclaration = tsTypeParameterDeclaration; -exports.tSTypeParameter = exports.tsTypeParameter = tsTypeParameter; -exports.numberLiteral = NumberLiteral; -exports.regexLiteral = RegexLiteral; -exports.restProperty = RestProperty; -exports.spreadProperty = SpreadProperty; - -var _builder = require("../builder"); - -function arrayExpression(elements) { - return (0, _builder.default)("ArrayExpression", ...arguments); -} - -function assignmentExpression(operator, left, right) { - return (0, _builder.default)("AssignmentExpression", ...arguments); -} - -function binaryExpression(operator, left, right) { - return (0, _builder.default)("BinaryExpression", ...arguments); -} - -function interpreterDirective(value) { - return (0, _builder.default)("InterpreterDirective", ...arguments); -} - -function directive(value) { - return (0, _builder.default)("Directive", ...arguments); -} - -function directiveLiteral(value) { - return (0, _builder.default)("DirectiveLiteral", ...arguments); -} - -function blockStatement(body, directives) { - return (0, _builder.default)("BlockStatement", ...arguments); -} - -function breakStatement(label) { - return (0, _builder.default)("BreakStatement", ...arguments); -} - -function callExpression(callee, _arguments) { - return (0, _builder.default)("CallExpression", ...arguments); -} - -function catchClause(param, body) { - return (0, _builder.default)("CatchClause", ...arguments); -} - -function conditionalExpression(test, consequent, alternate) { - return (0, _builder.default)("ConditionalExpression", ...arguments); -} - -function continueStatement(label) { - return (0, _builder.default)("ContinueStatement", ...arguments); -} - -function debuggerStatement() { - return (0, _builder.default)("DebuggerStatement", ...arguments); -} - -function doWhileStatement(test, body) { - return (0, _builder.default)("DoWhileStatement", ...arguments); -} - -function emptyStatement() { - return (0, _builder.default)("EmptyStatement", ...arguments); -} - -function expressionStatement(expression) { - return (0, _builder.default)("ExpressionStatement", ...arguments); -} - -function file(program, comments, tokens) { - return (0, _builder.default)("File", ...arguments); -} - -function forInStatement(left, right, body) { - return (0, _builder.default)("ForInStatement", ...arguments); -} - -function forStatement(init, test, update, body) { - return (0, _builder.default)("ForStatement", ...arguments); -} - -function functionDeclaration(id, params, body, generator, async) { - return (0, _builder.default)("FunctionDeclaration", ...arguments); -} - -function functionExpression(id, params, body, generator, async) { - return (0, _builder.default)("FunctionExpression", ...arguments); -} - -function identifier(name) { - return (0, _builder.default)("Identifier", ...arguments); -} - -function ifStatement(test, consequent, alternate) { - return (0, _builder.default)("IfStatement", ...arguments); -} - -function labeledStatement(label, body) { - return (0, _builder.default)("LabeledStatement", ...arguments); -} - -function stringLiteral(value) { - return (0, _builder.default)("StringLiteral", ...arguments); -} - -function numericLiteral(value) { - return (0, _builder.default)("NumericLiteral", ...arguments); -} - -function nullLiteral() { - return (0, _builder.default)("NullLiteral", ...arguments); -} - -function booleanLiteral(value) { - return (0, _builder.default)("BooleanLiteral", ...arguments); -} - -function regExpLiteral(pattern, flags) { - return (0, _builder.default)("RegExpLiteral", ...arguments); -} - -function logicalExpression(operator, left, right) { - return (0, _builder.default)("LogicalExpression", ...arguments); -} - -function memberExpression(object, property, computed, optional) { - return (0, _builder.default)("MemberExpression", ...arguments); -} - -function newExpression(callee, _arguments) { - return (0, _builder.default)("NewExpression", ...arguments); -} - -function program(body, directives, sourceType, interpreter) { - return (0, _builder.default)("Program", ...arguments); -} - -function objectExpression(properties) { - return (0, _builder.default)("ObjectExpression", ...arguments); -} - -function objectMethod(kind, key, params, body, computed, generator, async) { - return (0, _builder.default)("ObjectMethod", ...arguments); -} - -function objectProperty(key, value, computed, shorthand, decorators) { - return (0, _builder.default)("ObjectProperty", ...arguments); -} - -function restElement(argument) { - return (0, _builder.default)("RestElement", ...arguments); -} - -function returnStatement(argument) { - return (0, _builder.default)("ReturnStatement", ...arguments); -} - -function sequenceExpression(expressions) { - return (0, _builder.default)("SequenceExpression", ...arguments); -} - -function parenthesizedExpression(expression) { - return (0, _builder.default)("ParenthesizedExpression", ...arguments); -} - -function switchCase(test, consequent) { - return (0, _builder.default)("SwitchCase", ...arguments); -} - -function switchStatement(discriminant, cases) { - return (0, _builder.default)("SwitchStatement", ...arguments); -} - -function thisExpression() { - return (0, _builder.default)("ThisExpression", ...arguments); -} - -function throwStatement(argument) { - return (0, _builder.default)("ThrowStatement", ...arguments); -} - -function tryStatement(block, handler, finalizer) { - return (0, _builder.default)("TryStatement", ...arguments); -} - -function unaryExpression(operator, argument, prefix) { - return (0, _builder.default)("UnaryExpression", ...arguments); -} - -function updateExpression(operator, argument, prefix) { - return (0, _builder.default)("UpdateExpression", ...arguments); -} - -function variableDeclaration(kind, declarations) { - return (0, _builder.default)("VariableDeclaration", ...arguments); -} - -function variableDeclarator(id, init) { - return (0, _builder.default)("VariableDeclarator", ...arguments); -} - -function whileStatement(test, body) { - return (0, _builder.default)("WhileStatement", ...arguments); -} - -function withStatement(object, body) { - return (0, _builder.default)("WithStatement", ...arguments); -} - -function assignmentPattern(left, right) { - return (0, _builder.default)("AssignmentPattern", ...arguments); -} - -function arrayPattern(elements) { - return (0, _builder.default)("ArrayPattern", ...arguments); -} - -function arrowFunctionExpression(params, body, async) { - return (0, _builder.default)("ArrowFunctionExpression", ...arguments); -} - -function classBody(body) { - return (0, _builder.default)("ClassBody", ...arguments); -} - -function classExpression(id, superClass, body, decorators) { - return (0, _builder.default)("ClassExpression", ...arguments); -} - -function classDeclaration(id, superClass, body, decorators) { - return (0, _builder.default)("ClassDeclaration", ...arguments); -} - -function exportAllDeclaration(source) { - return (0, _builder.default)("ExportAllDeclaration", ...arguments); -} - -function exportDefaultDeclaration(declaration) { - return (0, _builder.default)("ExportDefaultDeclaration", ...arguments); -} - -function exportNamedDeclaration(declaration, specifiers, source) { - return (0, _builder.default)("ExportNamedDeclaration", ...arguments); -} - -function exportSpecifier(local, exported) { - return (0, _builder.default)("ExportSpecifier", ...arguments); -} - -function forOfStatement(left, right, body, _await) { - return (0, _builder.default)("ForOfStatement", ...arguments); -} - -function importDeclaration(specifiers, source) { - return (0, _builder.default)("ImportDeclaration", ...arguments); -} - -function importDefaultSpecifier(local) { - return (0, _builder.default)("ImportDefaultSpecifier", ...arguments); -} - -function importNamespaceSpecifier(local) { - return (0, _builder.default)("ImportNamespaceSpecifier", ...arguments); -} - -function importSpecifier(local, imported) { - return (0, _builder.default)("ImportSpecifier", ...arguments); -} - -function metaProperty(meta, property) { - return (0, _builder.default)("MetaProperty", ...arguments); -} - -function classMethod(kind, key, params, body, computed, _static, generator, async) { - return (0, _builder.default)("ClassMethod", ...arguments); -} - -function objectPattern(properties) { - return (0, _builder.default)("ObjectPattern", ...arguments); -} - -function spreadElement(argument) { - return (0, _builder.default)("SpreadElement", ...arguments); -} - -function _super() { - return (0, _builder.default)("Super", ...arguments); -} - -function taggedTemplateExpression(tag, quasi) { - return (0, _builder.default)("TaggedTemplateExpression", ...arguments); -} - -function templateElement(value, tail) { - return (0, _builder.default)("TemplateElement", ...arguments); -} - -function templateLiteral(quasis, expressions) { - return (0, _builder.default)("TemplateLiteral", ...arguments); -} - -function yieldExpression(argument, delegate) { - return (0, _builder.default)("YieldExpression", ...arguments); -} - -function awaitExpression(argument) { - return (0, _builder.default)("AwaitExpression", ...arguments); -} - -function _import() { - return (0, _builder.default)("Import", ...arguments); -} - -function bigIntLiteral(value) { - return (0, _builder.default)("BigIntLiteral", ...arguments); -} - -function exportNamespaceSpecifier(exported) { - return (0, _builder.default)("ExportNamespaceSpecifier", ...arguments); -} - -function optionalMemberExpression(object, property, computed, optional) { - return (0, _builder.default)("OptionalMemberExpression", ...arguments); -} - -function optionalCallExpression(callee, _arguments, optional) { - return (0, _builder.default)("OptionalCallExpression", ...arguments); -} - -function classProperty(key, value, typeAnnotation, decorators, computed, _static) { - return (0, _builder.default)("ClassProperty", ...arguments); -} - -function classPrivateProperty(key, value, decorators, _static) { - return (0, _builder.default)("ClassPrivateProperty", ...arguments); -} - -function classPrivateMethod(kind, key, params, body, _static) { - return (0, _builder.default)("ClassPrivateMethod", ...arguments); -} - -function privateName(id) { - return (0, _builder.default)("PrivateName", ...arguments); -} - -function anyTypeAnnotation() { - return (0, _builder.default)("AnyTypeAnnotation", ...arguments); -} - -function arrayTypeAnnotation(elementType) { - return (0, _builder.default)("ArrayTypeAnnotation", ...arguments); -} - -function booleanTypeAnnotation() { - return (0, _builder.default)("BooleanTypeAnnotation", ...arguments); -} - -function booleanLiteralTypeAnnotation(value) { - return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...arguments); -} - -function nullLiteralTypeAnnotation() { - return (0, _builder.default)("NullLiteralTypeAnnotation", ...arguments); -} - -function classImplements(id, typeParameters) { - return (0, _builder.default)("ClassImplements", ...arguments); -} - -function declareClass(id, typeParameters, _extends, body) { - return (0, _builder.default)("DeclareClass", ...arguments); -} - -function declareFunction(id) { - return (0, _builder.default)("DeclareFunction", ...arguments); -} - -function declareInterface(id, typeParameters, _extends, body) { - return (0, _builder.default)("DeclareInterface", ...arguments); -} - -function declareModule(id, body, kind) { - return (0, _builder.default)("DeclareModule", ...arguments); -} - -function declareModuleExports(typeAnnotation) { - return (0, _builder.default)("DeclareModuleExports", ...arguments); -} - -function declareTypeAlias(id, typeParameters, right) { - return (0, _builder.default)("DeclareTypeAlias", ...arguments); -} - -function declareOpaqueType(id, typeParameters, supertype) { - return (0, _builder.default)("DeclareOpaqueType", ...arguments); -} - -function declareVariable(id) { - return (0, _builder.default)("DeclareVariable", ...arguments); -} - -function declareExportDeclaration(declaration, specifiers, source) { - return (0, _builder.default)("DeclareExportDeclaration", ...arguments); -} - -function declareExportAllDeclaration(source) { - return (0, _builder.default)("DeclareExportAllDeclaration", ...arguments); -} - -function declaredPredicate(value) { - return (0, _builder.default)("DeclaredPredicate", ...arguments); -} - -function existsTypeAnnotation() { - return (0, _builder.default)("ExistsTypeAnnotation", ...arguments); -} - -function functionTypeAnnotation(typeParameters, params, rest, returnType) { - return (0, _builder.default)("FunctionTypeAnnotation", ...arguments); -} - -function functionTypeParam(name, typeAnnotation) { - return (0, _builder.default)("FunctionTypeParam", ...arguments); -} - -function genericTypeAnnotation(id, typeParameters) { - return (0, _builder.default)("GenericTypeAnnotation", ...arguments); -} - -function inferredPredicate() { - return (0, _builder.default)("InferredPredicate", ...arguments); -} - -function interfaceExtends(id, typeParameters) { - return (0, _builder.default)("InterfaceExtends", ...arguments); -} - -function interfaceDeclaration(id, typeParameters, _extends, body) { - return (0, _builder.default)("InterfaceDeclaration", ...arguments); -} - -function interfaceTypeAnnotation(_extends, body) { - return (0, _builder.default)("InterfaceTypeAnnotation", ...arguments); -} - -function intersectionTypeAnnotation(types) { - return (0, _builder.default)("IntersectionTypeAnnotation", ...arguments); -} - -function mixedTypeAnnotation() { - return (0, _builder.default)("MixedTypeAnnotation", ...arguments); -} - -function emptyTypeAnnotation() { - return (0, _builder.default)("EmptyTypeAnnotation", ...arguments); -} - -function nullableTypeAnnotation(typeAnnotation) { - return (0, _builder.default)("NullableTypeAnnotation", ...arguments); -} - -function numberLiteralTypeAnnotation(value) { - return (0, _builder.default)("NumberLiteralTypeAnnotation", ...arguments); -} - -function numberTypeAnnotation() { - return (0, _builder.default)("NumberTypeAnnotation", ...arguments); -} - -function objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact) { - return (0, _builder.default)("ObjectTypeAnnotation", ...arguments); -} - -function objectTypeInternalSlot(id, value, optional, _static, method) { - return (0, _builder.default)("ObjectTypeInternalSlot", ...arguments); -} - -function objectTypeCallProperty(value) { - return (0, _builder.default)("ObjectTypeCallProperty", ...arguments); -} - -function objectTypeIndexer(id, key, value, variance) { - return (0, _builder.default)("ObjectTypeIndexer", ...arguments); -} - -function objectTypeProperty(key, value, variance) { - return (0, _builder.default)("ObjectTypeProperty", ...arguments); -} - -function objectTypeSpreadProperty(argument) { - return (0, _builder.default)("ObjectTypeSpreadProperty", ...arguments); -} - -function opaqueType(id, typeParameters, supertype, impltype) { - return (0, _builder.default)("OpaqueType", ...arguments); -} - -function qualifiedTypeIdentifier(id, qualification) { - return (0, _builder.default)("QualifiedTypeIdentifier", ...arguments); -} - -function stringLiteralTypeAnnotation(value) { - return (0, _builder.default)("StringLiteralTypeAnnotation", ...arguments); -} - -function stringTypeAnnotation() { - return (0, _builder.default)("StringTypeAnnotation", ...arguments); -} - -function symbolTypeAnnotation() { - return (0, _builder.default)("SymbolTypeAnnotation", ...arguments); -} - -function thisTypeAnnotation() { - return (0, _builder.default)("ThisTypeAnnotation", ...arguments); -} - -function tupleTypeAnnotation(types) { - return (0, _builder.default)("TupleTypeAnnotation", ...arguments); -} - -function typeofTypeAnnotation(argument) { - return (0, _builder.default)("TypeofTypeAnnotation", ...arguments); -} - -function typeAlias(id, typeParameters, right) { - return (0, _builder.default)("TypeAlias", ...arguments); -} - -function typeAnnotation(typeAnnotation) { - return (0, _builder.default)("TypeAnnotation", ...arguments); -} - -function typeCastExpression(expression, typeAnnotation) { - return (0, _builder.default)("TypeCastExpression", ...arguments); -} - -function typeParameter(bound, _default, variance) { - return (0, _builder.default)("TypeParameter", ...arguments); -} - -function typeParameterDeclaration(params) { - return (0, _builder.default)("TypeParameterDeclaration", ...arguments); -} - -function typeParameterInstantiation(params) { - return (0, _builder.default)("TypeParameterInstantiation", ...arguments); -} - -function unionTypeAnnotation(types) { - return (0, _builder.default)("UnionTypeAnnotation", ...arguments); -} - -function variance(kind) { - return (0, _builder.default)("Variance", ...arguments); -} - -function voidTypeAnnotation() { - return (0, _builder.default)("VoidTypeAnnotation", ...arguments); -} - -function enumDeclaration(id, body) { - return (0, _builder.default)("EnumDeclaration", ...arguments); -} - -function enumBooleanBody(members) { - return (0, _builder.default)("EnumBooleanBody", ...arguments); -} - -function enumNumberBody(members) { - return (0, _builder.default)("EnumNumberBody", ...arguments); -} - -function enumStringBody(members) { - return (0, _builder.default)("EnumStringBody", ...arguments); -} - -function enumSymbolBody(members) { - return (0, _builder.default)("EnumSymbolBody", ...arguments); -} - -function enumBooleanMember(id) { - return (0, _builder.default)("EnumBooleanMember", ...arguments); -} - -function enumNumberMember(id, init) { - return (0, _builder.default)("EnumNumberMember", ...arguments); -} - -function enumStringMember(id, init) { - return (0, _builder.default)("EnumStringMember", ...arguments); -} - -function enumDefaultedMember(id) { - return (0, _builder.default)("EnumDefaultedMember", ...arguments); -} - -function indexedAccessType(objectType, indexType) { - return (0, _builder.default)("IndexedAccessType", ...arguments); -} - -function optionalIndexedAccessType(objectType, indexType) { - return (0, _builder.default)("OptionalIndexedAccessType", ...arguments); -} - -function jsxAttribute(name, value) { - return (0, _builder.default)("JSXAttribute", ...arguments); -} - -function jsxClosingElement(name) { - return (0, _builder.default)("JSXClosingElement", ...arguments); -} - -function jsxElement(openingElement, closingElement, children, selfClosing) { - return (0, _builder.default)("JSXElement", ...arguments); -} - -function jsxEmptyExpression() { - return (0, _builder.default)("JSXEmptyExpression", ...arguments); -} - -function jsxExpressionContainer(expression) { - return (0, _builder.default)("JSXExpressionContainer", ...arguments); -} - -function jsxSpreadChild(expression) { - return (0, _builder.default)("JSXSpreadChild", ...arguments); -} - -function jsxIdentifier(name) { - return (0, _builder.default)("JSXIdentifier", ...arguments); -} - -function jsxMemberExpression(object, property) { - return (0, _builder.default)("JSXMemberExpression", ...arguments); -} - -function jsxNamespacedName(namespace, name) { - return (0, _builder.default)("JSXNamespacedName", ...arguments); -} - -function jsxOpeningElement(name, attributes, selfClosing) { - return (0, _builder.default)("JSXOpeningElement", ...arguments); -} - -function jsxSpreadAttribute(argument) { - return (0, _builder.default)("JSXSpreadAttribute", ...arguments); -} - -function jsxText(value) { - return (0, _builder.default)("JSXText", ...arguments); -} - -function jsxFragment(openingFragment, closingFragment, children) { - return (0, _builder.default)("JSXFragment", ...arguments); -} - -function jsxOpeningFragment() { - return (0, _builder.default)("JSXOpeningFragment", ...arguments); -} - -function jsxClosingFragment() { - return (0, _builder.default)("JSXClosingFragment", ...arguments); -} - -function noop() { - return (0, _builder.default)("Noop", ...arguments); -} - -function placeholder(expectedNode, name) { - return (0, _builder.default)("Placeholder", ...arguments); -} - -function v8IntrinsicIdentifier(name) { - return (0, _builder.default)("V8IntrinsicIdentifier", ...arguments); -} - -function argumentPlaceholder() { - return (0, _builder.default)("ArgumentPlaceholder", ...arguments); -} - -function bindExpression(object, callee) { - return (0, _builder.default)("BindExpression", ...arguments); -} - -function importAttribute(key, value) { - return (0, _builder.default)("ImportAttribute", ...arguments); -} - -function decorator(expression) { - return (0, _builder.default)("Decorator", ...arguments); -} - -function doExpression(body, async) { - return (0, _builder.default)("DoExpression", ...arguments); -} - -function exportDefaultSpecifier(exported) { - return (0, _builder.default)("ExportDefaultSpecifier", ...arguments); -} - -function recordExpression(properties) { - return (0, _builder.default)("RecordExpression", ...arguments); -} - -function tupleExpression(elements) { - return (0, _builder.default)("TupleExpression", ...arguments); -} - -function decimalLiteral(value) { - return (0, _builder.default)("DecimalLiteral", ...arguments); -} - -function staticBlock(body) { - return (0, _builder.default)("StaticBlock", ...arguments); -} - -function moduleExpression(body) { - return (0, _builder.default)("ModuleExpression", ...arguments); -} - -function topicReference() { - return (0, _builder.default)("TopicReference", ...arguments); -} - -function pipelineTopicExpression(expression) { - return (0, _builder.default)("PipelineTopicExpression", ...arguments); -} - -function pipelineBareFunction(callee) { - return (0, _builder.default)("PipelineBareFunction", ...arguments); -} - -function pipelinePrimaryTopicReference() { - return (0, _builder.default)("PipelinePrimaryTopicReference", ...arguments); -} - -function tsParameterProperty(parameter) { - return (0, _builder.default)("TSParameterProperty", ...arguments); -} - -function tsDeclareFunction(id, typeParameters, params, returnType) { - return (0, _builder.default)("TSDeclareFunction", ...arguments); -} - -function tsDeclareMethod(decorators, key, typeParameters, params, returnType) { - return (0, _builder.default)("TSDeclareMethod", ...arguments); -} - -function tsQualifiedName(left, right) { - return (0, _builder.default)("TSQualifiedName", ...arguments); -} - -function tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation) { - return (0, _builder.default)("TSCallSignatureDeclaration", ...arguments); -} - -function tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation) { - return (0, _builder.default)("TSConstructSignatureDeclaration", ...arguments); -} - -function tsPropertySignature(key, typeAnnotation, initializer) { - return (0, _builder.default)("TSPropertySignature", ...arguments); -} - -function tsMethodSignature(key, typeParameters, parameters, typeAnnotation) { - return (0, _builder.default)("TSMethodSignature", ...arguments); -} - -function tsIndexSignature(parameters, typeAnnotation) { - return (0, _builder.default)("TSIndexSignature", ...arguments); -} - -function tsAnyKeyword() { - return (0, _builder.default)("TSAnyKeyword", ...arguments); -} - -function tsBooleanKeyword() { - return (0, _builder.default)("TSBooleanKeyword", ...arguments); -} - -function tsBigIntKeyword() { - return (0, _builder.default)("TSBigIntKeyword", ...arguments); -} - -function tsIntrinsicKeyword() { - return (0, _builder.default)("TSIntrinsicKeyword", ...arguments); -} - -function tsNeverKeyword() { - return (0, _builder.default)("TSNeverKeyword", ...arguments); -} - -function tsNullKeyword() { - return (0, _builder.default)("TSNullKeyword", ...arguments); -} - -function tsNumberKeyword() { - return (0, _builder.default)("TSNumberKeyword", ...arguments); -} - -function tsObjectKeyword() { - return (0, _builder.default)("TSObjectKeyword", ...arguments); -} - -function tsStringKeyword() { - return (0, _builder.default)("TSStringKeyword", ...arguments); -} - -function tsSymbolKeyword() { - return (0, _builder.default)("TSSymbolKeyword", ...arguments); -} - -function tsUndefinedKeyword() { - return (0, _builder.default)("TSUndefinedKeyword", ...arguments); -} - -function tsUnknownKeyword() { - return (0, _builder.default)("TSUnknownKeyword", ...arguments); -} - -function tsVoidKeyword() { - return (0, _builder.default)("TSVoidKeyword", ...arguments); -} - -function tsThisType() { - return (0, _builder.default)("TSThisType", ...arguments); -} - -function tsFunctionType(typeParameters, parameters, typeAnnotation) { - return (0, _builder.default)("TSFunctionType", ...arguments); -} - -function tsConstructorType(typeParameters, parameters, typeAnnotation) { - return (0, _builder.default)("TSConstructorType", ...arguments); -} - -function tsTypeReference(typeName, typeParameters) { - return (0, _builder.default)("TSTypeReference", ...arguments); -} - -function tsTypePredicate(parameterName, typeAnnotation, asserts) { - return (0, _builder.default)("TSTypePredicate", ...arguments); -} - -function tsTypeQuery(exprName) { - return (0, _builder.default)("TSTypeQuery", ...arguments); -} - -function tsTypeLiteral(members) { - return (0, _builder.default)("TSTypeLiteral", ...arguments); -} - -function tsArrayType(elementType) { - return (0, _builder.default)("TSArrayType", ...arguments); -} - -function tsTupleType(elementTypes) { - return (0, _builder.default)("TSTupleType", ...arguments); -} - -function tsOptionalType(typeAnnotation) { - return (0, _builder.default)("TSOptionalType", ...arguments); -} - -function tsRestType(typeAnnotation) { - return (0, _builder.default)("TSRestType", ...arguments); -} - -function tsNamedTupleMember(label, elementType, optional) { - return (0, _builder.default)("TSNamedTupleMember", ...arguments); -} - -function tsUnionType(types) { - return (0, _builder.default)("TSUnionType", ...arguments); -} - -function tsIntersectionType(types) { - return (0, _builder.default)("TSIntersectionType", ...arguments); -} - -function tsConditionalType(checkType, extendsType, trueType, falseType) { - return (0, _builder.default)("TSConditionalType", ...arguments); -} - -function tsInferType(typeParameter) { - return (0, _builder.default)("TSInferType", ...arguments); -} - -function tsParenthesizedType(typeAnnotation) { - return (0, _builder.default)("TSParenthesizedType", ...arguments); -} - -function tsTypeOperator(typeAnnotation) { - return (0, _builder.default)("TSTypeOperator", ...arguments); -} - -function tsIndexedAccessType(objectType, indexType) { - return (0, _builder.default)("TSIndexedAccessType", ...arguments); -} - -function tsMappedType(typeParameter, typeAnnotation, nameType) { - return (0, _builder.default)("TSMappedType", ...arguments); -} - -function tsLiteralType(literal) { - return (0, _builder.default)("TSLiteralType", ...arguments); -} - -function tsExpressionWithTypeArguments(expression, typeParameters) { - return (0, _builder.default)("TSExpressionWithTypeArguments", ...arguments); -} - -function tsInterfaceDeclaration(id, typeParameters, _extends, body) { - return (0, _builder.default)("TSInterfaceDeclaration", ...arguments); -} - -function tsInterfaceBody(body) { - return (0, _builder.default)("TSInterfaceBody", ...arguments); -} - -function tsTypeAliasDeclaration(id, typeParameters, typeAnnotation) { - return (0, _builder.default)("TSTypeAliasDeclaration", ...arguments); -} - -function tsAsExpression(expression, typeAnnotation) { - return (0, _builder.default)("TSAsExpression", ...arguments); -} - -function tsTypeAssertion(typeAnnotation, expression) { - return (0, _builder.default)("TSTypeAssertion", ...arguments); -} - -function tsEnumDeclaration(id, members) { - return (0, _builder.default)("TSEnumDeclaration", ...arguments); -} - -function tsEnumMember(id, initializer) { - return (0, _builder.default)("TSEnumMember", ...arguments); -} - -function tsModuleDeclaration(id, body) { - return (0, _builder.default)("TSModuleDeclaration", ...arguments); -} - -function tsModuleBlock(body) { - return (0, _builder.default)("TSModuleBlock", ...arguments); -} - -function tsImportType(argument, qualifier, typeParameters) { - return (0, _builder.default)("TSImportType", ...arguments); -} - -function tsImportEqualsDeclaration(id, moduleReference) { - return (0, _builder.default)("TSImportEqualsDeclaration", ...arguments); -} - -function tsExternalModuleReference(expression) { - return (0, _builder.default)("TSExternalModuleReference", ...arguments); -} - -function tsNonNullExpression(expression) { - return (0, _builder.default)("TSNonNullExpression", ...arguments); -} - -function tsExportAssignment(expression) { - return (0, _builder.default)("TSExportAssignment", ...arguments); -} - -function tsNamespaceExportDeclaration(id) { - return (0, _builder.default)("TSNamespaceExportDeclaration", ...arguments); -} - -function tsTypeAnnotation(typeAnnotation) { - return (0, _builder.default)("TSTypeAnnotation", ...arguments); -} - -function tsTypeParameterInstantiation(params) { - return (0, _builder.default)("TSTypeParameterInstantiation", ...arguments); -} - -function tsTypeParameterDeclaration(params) { - return (0, _builder.default)("TSTypeParameterDeclaration", ...arguments); -} - -function tsTypeParameter(constraint, _default, name) { - return (0, _builder.default)("TSTypeParameter", ...arguments); -} - -function NumberLiteral(...args) { - console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - return (0, _builder.default)("NumberLiteral", ...args); -} - -function RegexLiteral(...args) { - console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - return (0, _builder.default)("RegexLiteral", ...args); -} - -function RestProperty(...args) { - console.trace("The node type RestProperty has been renamed to RestElement"); - return (0, _builder.default)("RestProperty", ...args); -} - -function SpreadProperty(...args) { - console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - return (0, _builder.default)("SpreadProperty", ...args); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/generated/uppercase.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/generated/uppercase.js deleted file mode 100644 index e2ad08d8..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/generated/uppercase.js +++ /dev/null @@ -1,1507 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "ArrayExpression", { - enumerable: true, - get: function () { - return _index.arrayExpression; - } -}); -Object.defineProperty(exports, "AssignmentExpression", { - enumerable: true, - get: function () { - return _index.assignmentExpression; - } -}); -Object.defineProperty(exports, "BinaryExpression", { - enumerable: true, - get: function () { - return _index.binaryExpression; - } -}); -Object.defineProperty(exports, "InterpreterDirective", { - enumerable: true, - get: function () { - return _index.interpreterDirective; - } -}); -Object.defineProperty(exports, "Directive", { - enumerable: true, - get: function () { - return _index.directive; - } -}); -Object.defineProperty(exports, "DirectiveLiteral", { - enumerable: true, - get: function () { - return _index.directiveLiteral; - } -}); -Object.defineProperty(exports, "BlockStatement", { - enumerable: true, - get: function () { - return _index.blockStatement; - } -}); -Object.defineProperty(exports, "BreakStatement", { - enumerable: true, - get: function () { - return _index.breakStatement; - } -}); -Object.defineProperty(exports, "CallExpression", { - enumerable: true, - get: function () { - return _index.callExpression; - } -}); -Object.defineProperty(exports, "CatchClause", { - enumerable: true, - get: function () { - return _index.catchClause; - } -}); -Object.defineProperty(exports, "ConditionalExpression", { - enumerable: true, - get: function () { - return _index.conditionalExpression; - } -}); -Object.defineProperty(exports, "ContinueStatement", { - enumerable: true, - get: function () { - return _index.continueStatement; - } -}); -Object.defineProperty(exports, "DebuggerStatement", { - enumerable: true, - get: function () { - return _index.debuggerStatement; - } -}); -Object.defineProperty(exports, "DoWhileStatement", { - enumerable: true, - get: function () { - return _index.doWhileStatement; - } -}); -Object.defineProperty(exports, "EmptyStatement", { - enumerable: true, - get: function () { - return _index.emptyStatement; - } -}); -Object.defineProperty(exports, "ExpressionStatement", { - enumerable: true, - get: function () { - return _index.expressionStatement; - } -}); -Object.defineProperty(exports, "File", { - enumerable: true, - get: function () { - return _index.file; - } -}); -Object.defineProperty(exports, "ForInStatement", { - enumerable: true, - get: function () { - return _index.forInStatement; - } -}); -Object.defineProperty(exports, "ForStatement", { - enumerable: true, - get: function () { - return _index.forStatement; - } -}); -Object.defineProperty(exports, "FunctionDeclaration", { - enumerable: true, - get: function () { - return _index.functionDeclaration; - } -}); -Object.defineProperty(exports, "FunctionExpression", { - enumerable: true, - get: function () { - return _index.functionExpression; - } -}); -Object.defineProperty(exports, "Identifier", { - enumerable: true, - get: function () { - return _index.identifier; - } -}); -Object.defineProperty(exports, "IfStatement", { - enumerable: true, - get: function () { - return _index.ifStatement; - } -}); -Object.defineProperty(exports, "LabeledStatement", { - enumerable: true, - get: function () { - return _index.labeledStatement; - } -}); -Object.defineProperty(exports, "StringLiteral", { - enumerable: true, - get: function () { - return _index.stringLiteral; - } -}); -Object.defineProperty(exports, "NumericLiteral", { - enumerable: true, - get: function () { - return _index.numericLiteral; - } -}); -Object.defineProperty(exports, "NullLiteral", { - enumerable: true, - get: function () { - return _index.nullLiteral; - } -}); -Object.defineProperty(exports, "BooleanLiteral", { - enumerable: true, - get: function () { - return _index.booleanLiteral; - } -}); -Object.defineProperty(exports, "RegExpLiteral", { - enumerable: true, - get: function () { - return _index.regExpLiteral; - } -}); -Object.defineProperty(exports, "LogicalExpression", { - enumerable: true, - get: function () { - return _index.logicalExpression; - } -}); -Object.defineProperty(exports, "MemberExpression", { - enumerable: true, - get: function () { - return _index.memberExpression; - } -}); -Object.defineProperty(exports, "NewExpression", { - enumerable: true, - get: function () { - return _index.newExpression; - } -}); -Object.defineProperty(exports, "Program", { - enumerable: true, - get: function () { - return _index.program; - } -}); -Object.defineProperty(exports, "ObjectExpression", { - enumerable: true, - get: function () { - return _index.objectExpression; - } -}); -Object.defineProperty(exports, "ObjectMethod", { - enumerable: true, - get: function () { - return _index.objectMethod; - } -}); -Object.defineProperty(exports, "ObjectProperty", { - enumerable: true, - get: function () { - return _index.objectProperty; - } -}); -Object.defineProperty(exports, "RestElement", { - enumerable: true, - get: function () { - return _index.restElement; - } -}); -Object.defineProperty(exports, "ReturnStatement", { - enumerable: true, - get: function () { - return _index.returnStatement; - } -}); -Object.defineProperty(exports, "SequenceExpression", { - enumerable: true, - get: function () { - return _index.sequenceExpression; - } -}); -Object.defineProperty(exports, "ParenthesizedExpression", { - enumerable: true, - get: function () { - return _index.parenthesizedExpression; - } -}); -Object.defineProperty(exports, "SwitchCase", { - enumerable: true, - get: function () { - return _index.switchCase; - } -}); -Object.defineProperty(exports, "SwitchStatement", { - enumerable: true, - get: function () { - return _index.switchStatement; - } -}); -Object.defineProperty(exports, "ThisExpression", { - enumerable: true, - get: function () { - return _index.thisExpression; - } -}); -Object.defineProperty(exports, "ThrowStatement", { - enumerable: true, - get: function () { - return _index.throwStatement; - } -}); -Object.defineProperty(exports, "TryStatement", { - enumerable: true, - get: function () { - return _index.tryStatement; - } -}); -Object.defineProperty(exports, "UnaryExpression", { - enumerable: true, - get: function () { - return _index.unaryExpression; - } -}); -Object.defineProperty(exports, "UpdateExpression", { - enumerable: true, - get: function () { - return _index.updateExpression; - } -}); -Object.defineProperty(exports, "VariableDeclaration", { - enumerable: true, - get: function () { - return _index.variableDeclaration; - } -}); -Object.defineProperty(exports, "VariableDeclarator", { - enumerable: true, - get: function () { - return _index.variableDeclarator; - } -}); -Object.defineProperty(exports, "WhileStatement", { - enumerable: true, - get: function () { - return _index.whileStatement; - } -}); -Object.defineProperty(exports, "WithStatement", { - enumerable: true, - get: function () { - return _index.withStatement; - } -}); -Object.defineProperty(exports, "AssignmentPattern", { - enumerable: true, - get: function () { - return _index.assignmentPattern; - } -}); -Object.defineProperty(exports, "ArrayPattern", { - enumerable: true, - get: function () { - return _index.arrayPattern; - } -}); -Object.defineProperty(exports, "ArrowFunctionExpression", { - enumerable: true, - get: function () { - return _index.arrowFunctionExpression; - } -}); -Object.defineProperty(exports, "ClassBody", { - enumerable: true, - get: function () { - return _index.classBody; - } -}); -Object.defineProperty(exports, "ClassExpression", { - enumerable: true, - get: function () { - return _index.classExpression; - } -}); -Object.defineProperty(exports, "ClassDeclaration", { - enumerable: true, - get: function () { - return _index.classDeclaration; - } -}); -Object.defineProperty(exports, "ExportAllDeclaration", { - enumerable: true, - get: function () { - return _index.exportAllDeclaration; - } -}); -Object.defineProperty(exports, "ExportDefaultDeclaration", { - enumerable: true, - get: function () { - return _index.exportDefaultDeclaration; - } -}); -Object.defineProperty(exports, "ExportNamedDeclaration", { - enumerable: true, - get: function () { - return _index.exportNamedDeclaration; - } -}); -Object.defineProperty(exports, "ExportSpecifier", { - enumerable: true, - get: function () { - return _index.exportSpecifier; - } -}); -Object.defineProperty(exports, "ForOfStatement", { - enumerable: true, - get: function () { - return _index.forOfStatement; - } -}); -Object.defineProperty(exports, "ImportDeclaration", { - enumerable: true, - get: function () { - return _index.importDeclaration; - } -}); -Object.defineProperty(exports, "ImportDefaultSpecifier", { - enumerable: true, - get: function () { - return _index.importDefaultSpecifier; - } -}); -Object.defineProperty(exports, "ImportNamespaceSpecifier", { - enumerable: true, - get: function () { - return _index.importNamespaceSpecifier; - } -}); -Object.defineProperty(exports, "ImportSpecifier", { - enumerable: true, - get: function () { - return _index.importSpecifier; - } -}); -Object.defineProperty(exports, "MetaProperty", { - enumerable: true, - get: function () { - return _index.metaProperty; - } -}); -Object.defineProperty(exports, "ClassMethod", { - enumerable: true, - get: function () { - return _index.classMethod; - } -}); -Object.defineProperty(exports, "ObjectPattern", { - enumerable: true, - get: function () { - return _index.objectPattern; - } -}); -Object.defineProperty(exports, "SpreadElement", { - enumerable: true, - get: function () { - return _index.spreadElement; - } -}); -Object.defineProperty(exports, "Super", { - enumerable: true, - get: function () { - return _index.super; - } -}); -Object.defineProperty(exports, "TaggedTemplateExpression", { - enumerable: true, - get: function () { - return _index.taggedTemplateExpression; - } -}); -Object.defineProperty(exports, "TemplateElement", { - enumerable: true, - get: function () { - return _index.templateElement; - } -}); -Object.defineProperty(exports, "TemplateLiteral", { - enumerable: true, - get: function () { - return _index.templateLiteral; - } -}); -Object.defineProperty(exports, "YieldExpression", { - enumerable: true, - get: function () { - return _index.yieldExpression; - } -}); -Object.defineProperty(exports, "AwaitExpression", { - enumerable: true, - get: function () { - return _index.awaitExpression; - } -}); -Object.defineProperty(exports, "Import", { - enumerable: true, - get: function () { - return _index.import; - } -}); -Object.defineProperty(exports, "BigIntLiteral", { - enumerable: true, - get: function () { - return _index.bigIntLiteral; - } -}); -Object.defineProperty(exports, "ExportNamespaceSpecifier", { - enumerable: true, - get: function () { - return _index.exportNamespaceSpecifier; - } -}); -Object.defineProperty(exports, "OptionalMemberExpression", { - enumerable: true, - get: function () { - return _index.optionalMemberExpression; - } -}); -Object.defineProperty(exports, "OptionalCallExpression", { - enumerable: true, - get: function () { - return _index.optionalCallExpression; - } -}); -Object.defineProperty(exports, "ClassProperty", { - enumerable: true, - get: function () { - return _index.classProperty; - } -}); -Object.defineProperty(exports, "ClassPrivateProperty", { - enumerable: true, - get: function () { - return _index.classPrivateProperty; - } -}); -Object.defineProperty(exports, "ClassPrivateMethod", { - enumerable: true, - get: function () { - return _index.classPrivateMethod; - } -}); -Object.defineProperty(exports, "PrivateName", { - enumerable: true, - get: function () { - return _index.privateName; - } -}); -Object.defineProperty(exports, "AnyTypeAnnotation", { - enumerable: true, - get: function () { - return _index.anyTypeAnnotation; - } -}); -Object.defineProperty(exports, "ArrayTypeAnnotation", { - enumerable: true, - get: function () { - return _index.arrayTypeAnnotation; - } -}); -Object.defineProperty(exports, "BooleanTypeAnnotation", { - enumerable: true, - get: function () { - return _index.booleanTypeAnnotation; - } -}); -Object.defineProperty(exports, "BooleanLiteralTypeAnnotation", { - enumerable: true, - get: function () { - return _index.booleanLiteralTypeAnnotation; - } -}); -Object.defineProperty(exports, "NullLiteralTypeAnnotation", { - enumerable: true, - get: function () { - return _index.nullLiteralTypeAnnotation; - } -}); -Object.defineProperty(exports, "ClassImplements", { - enumerable: true, - get: function () { - return _index.classImplements; - } -}); -Object.defineProperty(exports, "DeclareClass", { - enumerable: true, - get: function () { - return _index.declareClass; - } -}); -Object.defineProperty(exports, "DeclareFunction", { - enumerable: true, - get: function () { - return _index.declareFunction; - } -}); -Object.defineProperty(exports, "DeclareInterface", { - enumerable: true, - get: function () { - return _index.declareInterface; - } -}); -Object.defineProperty(exports, "DeclareModule", { - enumerable: true, - get: function () { - return _index.declareModule; - } -}); -Object.defineProperty(exports, "DeclareModuleExports", { - enumerable: true, - get: function () { - return _index.declareModuleExports; - } -}); -Object.defineProperty(exports, "DeclareTypeAlias", { - enumerable: true, - get: function () { - return _index.declareTypeAlias; - } -}); -Object.defineProperty(exports, "DeclareOpaqueType", { - enumerable: true, - get: function () { - return _index.declareOpaqueType; - } -}); -Object.defineProperty(exports, "DeclareVariable", { - enumerable: true, - get: function () { - return _index.declareVariable; - } -}); -Object.defineProperty(exports, "DeclareExportDeclaration", { - enumerable: true, - get: function () { - return _index.declareExportDeclaration; - } -}); -Object.defineProperty(exports, "DeclareExportAllDeclaration", { - enumerable: true, - get: function () { - return _index.declareExportAllDeclaration; - } -}); -Object.defineProperty(exports, "DeclaredPredicate", { - enumerable: true, - get: function () { - return _index.declaredPredicate; - } -}); -Object.defineProperty(exports, "ExistsTypeAnnotation", { - enumerable: true, - get: function () { - return _index.existsTypeAnnotation; - } -}); -Object.defineProperty(exports, "FunctionTypeAnnotation", { - enumerable: true, - get: function () { - return _index.functionTypeAnnotation; - } -}); -Object.defineProperty(exports, "FunctionTypeParam", { - enumerable: true, - get: function () { - return _index.functionTypeParam; - } -}); -Object.defineProperty(exports, "GenericTypeAnnotation", { - enumerable: true, - get: function () { - return _index.genericTypeAnnotation; - } -}); -Object.defineProperty(exports, "InferredPredicate", { - enumerable: true, - get: function () { - return _index.inferredPredicate; - } -}); -Object.defineProperty(exports, "InterfaceExtends", { - enumerable: true, - get: function () { - return _index.interfaceExtends; - } -}); -Object.defineProperty(exports, "InterfaceDeclaration", { - enumerable: true, - get: function () { - return _index.interfaceDeclaration; - } -}); -Object.defineProperty(exports, "InterfaceTypeAnnotation", { - enumerable: true, - get: function () { - return _index.interfaceTypeAnnotation; - } -}); -Object.defineProperty(exports, "IntersectionTypeAnnotation", { - enumerable: true, - get: function () { - return _index.intersectionTypeAnnotation; - } -}); -Object.defineProperty(exports, "MixedTypeAnnotation", { - enumerable: true, - get: function () { - return _index.mixedTypeAnnotation; - } -}); -Object.defineProperty(exports, "EmptyTypeAnnotation", { - enumerable: true, - get: function () { - return _index.emptyTypeAnnotation; - } -}); -Object.defineProperty(exports, "NullableTypeAnnotation", { - enumerable: true, - get: function () { - return _index.nullableTypeAnnotation; - } -}); -Object.defineProperty(exports, "NumberLiteralTypeAnnotation", { - enumerable: true, - get: function () { - return _index.numberLiteralTypeAnnotation; - } -}); -Object.defineProperty(exports, "NumberTypeAnnotation", { - enumerable: true, - get: function () { - return _index.numberTypeAnnotation; - } -}); -Object.defineProperty(exports, "ObjectTypeAnnotation", { - enumerable: true, - get: function () { - return _index.objectTypeAnnotation; - } -}); -Object.defineProperty(exports, "ObjectTypeInternalSlot", { - enumerable: true, - get: function () { - return _index.objectTypeInternalSlot; - } -}); -Object.defineProperty(exports, "ObjectTypeCallProperty", { - enumerable: true, - get: function () { - return _index.objectTypeCallProperty; - } -}); -Object.defineProperty(exports, "ObjectTypeIndexer", { - enumerable: true, - get: function () { - return _index.objectTypeIndexer; - } -}); -Object.defineProperty(exports, "ObjectTypeProperty", { - enumerable: true, - get: function () { - return _index.objectTypeProperty; - } -}); -Object.defineProperty(exports, "ObjectTypeSpreadProperty", { - enumerable: true, - get: function () { - return _index.objectTypeSpreadProperty; - } -}); -Object.defineProperty(exports, "OpaqueType", { - enumerable: true, - get: function () { - return _index.opaqueType; - } -}); -Object.defineProperty(exports, "QualifiedTypeIdentifier", { - enumerable: true, - get: function () { - return _index.qualifiedTypeIdentifier; - } -}); -Object.defineProperty(exports, "StringLiteralTypeAnnotation", { - enumerable: true, - get: function () { - return _index.stringLiteralTypeAnnotation; - } -}); -Object.defineProperty(exports, "StringTypeAnnotation", { - enumerable: true, - get: function () { - return _index.stringTypeAnnotation; - } -}); -Object.defineProperty(exports, "SymbolTypeAnnotation", { - enumerable: true, - get: function () { - return _index.symbolTypeAnnotation; - } -}); -Object.defineProperty(exports, "ThisTypeAnnotation", { - enumerable: true, - get: function () { - return _index.thisTypeAnnotation; - } -}); -Object.defineProperty(exports, "TupleTypeAnnotation", { - enumerable: true, - get: function () { - return _index.tupleTypeAnnotation; - } -}); -Object.defineProperty(exports, "TypeofTypeAnnotation", { - enumerable: true, - get: function () { - return _index.typeofTypeAnnotation; - } -}); -Object.defineProperty(exports, "TypeAlias", { - enumerable: true, - get: function () { - return _index.typeAlias; - } -}); -Object.defineProperty(exports, "TypeAnnotation", { - enumerable: true, - get: function () { - return _index.typeAnnotation; - } -}); -Object.defineProperty(exports, "TypeCastExpression", { - enumerable: true, - get: function () { - return _index.typeCastExpression; - } -}); -Object.defineProperty(exports, "TypeParameter", { - enumerable: true, - get: function () { - return _index.typeParameter; - } -}); -Object.defineProperty(exports, "TypeParameterDeclaration", { - enumerable: true, - get: function () { - return _index.typeParameterDeclaration; - } -}); -Object.defineProperty(exports, "TypeParameterInstantiation", { - enumerable: true, - get: function () { - return _index.typeParameterInstantiation; - } -}); -Object.defineProperty(exports, "UnionTypeAnnotation", { - enumerable: true, - get: function () { - return _index.unionTypeAnnotation; - } -}); -Object.defineProperty(exports, "Variance", { - enumerable: true, - get: function () { - return _index.variance; - } -}); -Object.defineProperty(exports, "VoidTypeAnnotation", { - enumerable: true, - get: function () { - return _index.voidTypeAnnotation; - } -}); -Object.defineProperty(exports, "EnumDeclaration", { - enumerable: true, - get: function () { - return _index.enumDeclaration; - } -}); -Object.defineProperty(exports, "EnumBooleanBody", { - enumerable: true, - get: function () { - return _index.enumBooleanBody; - } -}); -Object.defineProperty(exports, "EnumNumberBody", { - enumerable: true, - get: function () { - return _index.enumNumberBody; - } -}); -Object.defineProperty(exports, "EnumStringBody", { - enumerable: true, - get: function () { - return _index.enumStringBody; - } -}); -Object.defineProperty(exports, "EnumSymbolBody", { - enumerable: true, - get: function () { - return _index.enumSymbolBody; - } -}); -Object.defineProperty(exports, "EnumBooleanMember", { - enumerable: true, - get: function () { - return _index.enumBooleanMember; - } -}); -Object.defineProperty(exports, "EnumNumberMember", { - enumerable: true, - get: function () { - return _index.enumNumberMember; - } -}); -Object.defineProperty(exports, "EnumStringMember", { - enumerable: true, - get: function () { - return _index.enumStringMember; - } -}); -Object.defineProperty(exports, "EnumDefaultedMember", { - enumerable: true, - get: function () { - return _index.enumDefaultedMember; - } -}); -Object.defineProperty(exports, "IndexedAccessType", { - enumerable: true, - get: function () { - return _index.indexedAccessType; - } -}); -Object.defineProperty(exports, "OptionalIndexedAccessType", { - enumerable: true, - get: function () { - return _index.optionalIndexedAccessType; - } -}); -Object.defineProperty(exports, "JSXAttribute", { - enumerable: true, - get: function () { - return _index.jsxAttribute; - } -}); -Object.defineProperty(exports, "JSXClosingElement", { - enumerable: true, - get: function () { - return _index.jsxClosingElement; - } -}); -Object.defineProperty(exports, "JSXElement", { - enumerable: true, - get: function () { - return _index.jsxElement; - } -}); -Object.defineProperty(exports, "JSXEmptyExpression", { - enumerable: true, - get: function () { - return _index.jsxEmptyExpression; - } -}); -Object.defineProperty(exports, "JSXExpressionContainer", { - enumerable: true, - get: function () { - return _index.jsxExpressionContainer; - } -}); -Object.defineProperty(exports, "JSXSpreadChild", { - enumerable: true, - get: function () { - return _index.jsxSpreadChild; - } -}); -Object.defineProperty(exports, "JSXIdentifier", { - enumerable: true, - get: function () { - return _index.jsxIdentifier; - } -}); -Object.defineProperty(exports, "JSXMemberExpression", { - enumerable: true, - get: function () { - return _index.jsxMemberExpression; - } -}); -Object.defineProperty(exports, "JSXNamespacedName", { - enumerable: true, - get: function () { - return _index.jsxNamespacedName; - } -}); -Object.defineProperty(exports, "JSXOpeningElement", { - enumerable: true, - get: function () { - return _index.jsxOpeningElement; - } -}); -Object.defineProperty(exports, "JSXSpreadAttribute", { - enumerable: true, - get: function () { - return _index.jsxSpreadAttribute; - } -}); -Object.defineProperty(exports, "JSXText", { - enumerable: true, - get: function () { - return _index.jsxText; - } -}); -Object.defineProperty(exports, "JSXFragment", { - enumerable: true, - get: function () { - return _index.jsxFragment; - } -}); -Object.defineProperty(exports, "JSXOpeningFragment", { - enumerable: true, - get: function () { - return _index.jsxOpeningFragment; - } -}); -Object.defineProperty(exports, "JSXClosingFragment", { - enumerable: true, - get: function () { - return _index.jsxClosingFragment; - } -}); -Object.defineProperty(exports, "Noop", { - enumerable: true, - get: function () { - return _index.noop; - } -}); -Object.defineProperty(exports, "Placeholder", { - enumerable: true, - get: function () { - return _index.placeholder; - } -}); -Object.defineProperty(exports, "V8IntrinsicIdentifier", { - enumerable: true, - get: function () { - return _index.v8IntrinsicIdentifier; - } -}); -Object.defineProperty(exports, "ArgumentPlaceholder", { - enumerable: true, - get: function () { - return _index.argumentPlaceholder; - } -}); -Object.defineProperty(exports, "BindExpression", { - enumerable: true, - get: function () { - return _index.bindExpression; - } -}); -Object.defineProperty(exports, "ImportAttribute", { - enumerable: true, - get: function () { - return _index.importAttribute; - } -}); -Object.defineProperty(exports, "Decorator", { - enumerable: true, - get: function () { - return _index.decorator; - } -}); -Object.defineProperty(exports, "DoExpression", { - enumerable: true, - get: function () { - return _index.doExpression; - } -}); -Object.defineProperty(exports, "ExportDefaultSpecifier", { - enumerable: true, - get: function () { - return _index.exportDefaultSpecifier; - } -}); -Object.defineProperty(exports, "RecordExpression", { - enumerable: true, - get: function () { - return _index.recordExpression; - } -}); -Object.defineProperty(exports, "TupleExpression", { - enumerable: true, - get: function () { - return _index.tupleExpression; - } -}); -Object.defineProperty(exports, "DecimalLiteral", { - enumerable: true, - get: function () { - return _index.decimalLiteral; - } -}); -Object.defineProperty(exports, "StaticBlock", { - enumerable: true, - get: function () { - return _index.staticBlock; - } -}); -Object.defineProperty(exports, "ModuleExpression", { - enumerable: true, - get: function () { - return _index.moduleExpression; - } -}); -Object.defineProperty(exports, "TopicReference", { - enumerable: true, - get: function () { - return _index.topicReference; - } -}); -Object.defineProperty(exports, "PipelineTopicExpression", { - enumerable: true, - get: function () { - return _index.pipelineTopicExpression; - } -}); -Object.defineProperty(exports, "PipelineBareFunction", { - enumerable: true, - get: function () { - return _index.pipelineBareFunction; - } -}); -Object.defineProperty(exports, "PipelinePrimaryTopicReference", { - enumerable: true, - get: function () { - return _index.pipelinePrimaryTopicReference; - } -}); -Object.defineProperty(exports, "TSParameterProperty", { - enumerable: true, - get: function () { - return _index.tsParameterProperty; - } -}); -Object.defineProperty(exports, "TSDeclareFunction", { - enumerable: true, - get: function () { - return _index.tsDeclareFunction; - } -}); -Object.defineProperty(exports, "TSDeclareMethod", { - enumerable: true, - get: function () { - return _index.tsDeclareMethod; - } -}); -Object.defineProperty(exports, "TSQualifiedName", { - enumerable: true, - get: function () { - return _index.tsQualifiedName; - } -}); -Object.defineProperty(exports, "TSCallSignatureDeclaration", { - enumerable: true, - get: function () { - return _index.tsCallSignatureDeclaration; - } -}); -Object.defineProperty(exports, "TSConstructSignatureDeclaration", { - enumerable: true, - get: function () { - return _index.tsConstructSignatureDeclaration; - } -}); -Object.defineProperty(exports, "TSPropertySignature", { - enumerable: true, - get: function () { - return _index.tsPropertySignature; - } -}); -Object.defineProperty(exports, "TSMethodSignature", { - enumerable: true, - get: function () { - return _index.tsMethodSignature; - } -}); -Object.defineProperty(exports, "TSIndexSignature", { - enumerable: true, - get: function () { - return _index.tsIndexSignature; - } -}); -Object.defineProperty(exports, "TSAnyKeyword", { - enumerable: true, - get: function () { - return _index.tsAnyKeyword; - } -}); -Object.defineProperty(exports, "TSBooleanKeyword", { - enumerable: true, - get: function () { - return _index.tsBooleanKeyword; - } -}); -Object.defineProperty(exports, "TSBigIntKeyword", { - enumerable: true, - get: function () { - return _index.tsBigIntKeyword; - } -}); -Object.defineProperty(exports, "TSIntrinsicKeyword", { - enumerable: true, - get: function () { - return _index.tsIntrinsicKeyword; - } -}); -Object.defineProperty(exports, "TSNeverKeyword", { - enumerable: true, - get: function () { - return _index.tsNeverKeyword; - } -}); -Object.defineProperty(exports, "TSNullKeyword", { - enumerable: true, - get: function () { - return _index.tsNullKeyword; - } -}); -Object.defineProperty(exports, "TSNumberKeyword", { - enumerable: true, - get: function () { - return _index.tsNumberKeyword; - } -}); -Object.defineProperty(exports, "TSObjectKeyword", { - enumerable: true, - get: function () { - return _index.tsObjectKeyword; - } -}); -Object.defineProperty(exports, "TSStringKeyword", { - enumerable: true, - get: function () { - return _index.tsStringKeyword; - } -}); -Object.defineProperty(exports, "TSSymbolKeyword", { - enumerable: true, - get: function () { - return _index.tsSymbolKeyword; - } -}); -Object.defineProperty(exports, "TSUndefinedKeyword", { - enumerable: true, - get: function () { - return _index.tsUndefinedKeyword; - } -}); -Object.defineProperty(exports, "TSUnknownKeyword", { - enumerable: true, - get: function () { - return _index.tsUnknownKeyword; - } -}); -Object.defineProperty(exports, "TSVoidKeyword", { - enumerable: true, - get: function () { - return _index.tsVoidKeyword; - } -}); -Object.defineProperty(exports, "TSThisType", { - enumerable: true, - get: function () { - return _index.tsThisType; - } -}); -Object.defineProperty(exports, "TSFunctionType", { - enumerable: true, - get: function () { - return _index.tsFunctionType; - } -}); -Object.defineProperty(exports, "TSConstructorType", { - enumerable: true, - get: function () { - return _index.tsConstructorType; - } -}); -Object.defineProperty(exports, "TSTypeReference", { - enumerable: true, - get: function () { - return _index.tsTypeReference; - } -}); -Object.defineProperty(exports, "TSTypePredicate", { - enumerable: true, - get: function () { - return _index.tsTypePredicate; - } -}); -Object.defineProperty(exports, "TSTypeQuery", { - enumerable: true, - get: function () { - return _index.tsTypeQuery; - } -}); -Object.defineProperty(exports, "TSTypeLiteral", { - enumerable: true, - get: function () { - return _index.tsTypeLiteral; - } -}); -Object.defineProperty(exports, "TSArrayType", { - enumerable: true, - get: function () { - return _index.tsArrayType; - } -}); -Object.defineProperty(exports, "TSTupleType", { - enumerable: true, - get: function () { - return _index.tsTupleType; - } -}); -Object.defineProperty(exports, "TSOptionalType", { - enumerable: true, - get: function () { - return _index.tsOptionalType; - } -}); -Object.defineProperty(exports, "TSRestType", { - enumerable: true, - get: function () { - return _index.tsRestType; - } -}); -Object.defineProperty(exports, "TSNamedTupleMember", { - enumerable: true, - get: function () { - return _index.tsNamedTupleMember; - } -}); -Object.defineProperty(exports, "TSUnionType", { - enumerable: true, - get: function () { - return _index.tsUnionType; - } -}); -Object.defineProperty(exports, "TSIntersectionType", { - enumerable: true, - get: function () { - return _index.tsIntersectionType; - } -}); -Object.defineProperty(exports, "TSConditionalType", { - enumerable: true, - get: function () { - return _index.tsConditionalType; - } -}); -Object.defineProperty(exports, "TSInferType", { - enumerable: true, - get: function () { - return _index.tsInferType; - } -}); -Object.defineProperty(exports, "TSParenthesizedType", { - enumerable: true, - get: function () { - return _index.tsParenthesizedType; - } -}); -Object.defineProperty(exports, "TSTypeOperator", { - enumerable: true, - get: function () { - return _index.tsTypeOperator; - } -}); -Object.defineProperty(exports, "TSIndexedAccessType", { - enumerable: true, - get: function () { - return _index.tsIndexedAccessType; - } -}); -Object.defineProperty(exports, "TSMappedType", { - enumerable: true, - get: function () { - return _index.tsMappedType; - } -}); -Object.defineProperty(exports, "TSLiteralType", { - enumerable: true, - get: function () { - return _index.tsLiteralType; - } -}); -Object.defineProperty(exports, "TSExpressionWithTypeArguments", { - enumerable: true, - get: function () { - return _index.tsExpressionWithTypeArguments; - } -}); -Object.defineProperty(exports, "TSInterfaceDeclaration", { - enumerable: true, - get: function () { - return _index.tsInterfaceDeclaration; - } -}); -Object.defineProperty(exports, "TSInterfaceBody", { - enumerable: true, - get: function () { - return _index.tsInterfaceBody; - } -}); -Object.defineProperty(exports, "TSTypeAliasDeclaration", { - enumerable: true, - get: function () { - return _index.tsTypeAliasDeclaration; - } -}); -Object.defineProperty(exports, "TSAsExpression", { - enumerable: true, - get: function () { - return _index.tsAsExpression; - } -}); -Object.defineProperty(exports, "TSTypeAssertion", { - enumerable: true, - get: function () { - return _index.tsTypeAssertion; - } -}); -Object.defineProperty(exports, "TSEnumDeclaration", { - enumerable: true, - get: function () { - return _index.tsEnumDeclaration; - } -}); -Object.defineProperty(exports, "TSEnumMember", { - enumerable: true, - get: function () { - return _index.tsEnumMember; - } -}); -Object.defineProperty(exports, "TSModuleDeclaration", { - enumerable: true, - get: function () { - return _index.tsModuleDeclaration; - } -}); -Object.defineProperty(exports, "TSModuleBlock", { - enumerable: true, - get: function () { - return _index.tsModuleBlock; - } -}); -Object.defineProperty(exports, "TSImportType", { - enumerable: true, - get: function () { - return _index.tsImportType; - } -}); -Object.defineProperty(exports, "TSImportEqualsDeclaration", { - enumerable: true, - get: function () { - return _index.tsImportEqualsDeclaration; - } -}); -Object.defineProperty(exports, "TSExternalModuleReference", { - enumerable: true, - get: function () { - return _index.tsExternalModuleReference; - } -}); -Object.defineProperty(exports, "TSNonNullExpression", { - enumerable: true, - get: function () { - return _index.tsNonNullExpression; - } -}); -Object.defineProperty(exports, "TSExportAssignment", { - enumerable: true, - get: function () { - return _index.tsExportAssignment; - } -}); -Object.defineProperty(exports, "TSNamespaceExportDeclaration", { - enumerable: true, - get: function () { - return _index.tsNamespaceExportDeclaration; - } -}); -Object.defineProperty(exports, "TSTypeAnnotation", { - enumerable: true, - get: function () { - return _index.tsTypeAnnotation; - } -}); -Object.defineProperty(exports, "TSTypeParameterInstantiation", { - enumerable: true, - get: function () { - return _index.tsTypeParameterInstantiation; - } -}); -Object.defineProperty(exports, "TSTypeParameterDeclaration", { - enumerable: true, - get: function () { - return _index.tsTypeParameterDeclaration; - } -}); -Object.defineProperty(exports, "TSTypeParameter", { - enumerable: true, - get: function () { - return _index.tsTypeParameter; - } -}); -Object.defineProperty(exports, "NumberLiteral", { - enumerable: true, - get: function () { - return _index.numberLiteral; - } -}); -Object.defineProperty(exports, "RegexLiteral", { - enumerable: true, - get: function () { - return _index.regexLiteral; - } -}); -Object.defineProperty(exports, "RestProperty", { - enumerable: true, - get: function () { - return _index.restProperty; - } -}); -Object.defineProperty(exports, "SpreadProperty", { - enumerable: true, - get: function () { - return _index.spreadProperty; - } -}); - -var _index = require("./index"); \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/react/buildChildren.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/react/buildChildren.js deleted file mode 100644 index 20a194b6..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/react/buildChildren.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildChildren; - -var _generated = require("../../validators/generated"); - -var _cleanJSXElementLiteralChild = require("../../utils/react/cleanJSXElementLiteralChild"); - -function buildChildren(node) { - const elements = []; - - for (let i = 0; i < node.children.length; i++) { - let child = node.children[i]; - - if ((0, _generated.isJSXText)(child)) { - (0, _cleanJSXElementLiteralChild.default)(child, elements); - continue; - } - - if ((0, _generated.isJSXExpressionContainer)(child)) child = child.expression; - if ((0, _generated.isJSXEmptyExpression)(child)) continue; - elements.push(child); - } - - return elements; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js deleted file mode 100644 index 9b53be29..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = createTSUnionType; - -var _generated = require("../generated"); - -var _removeTypeDuplicates = require("../../modifications/typescript/removeTypeDuplicates"); - -function createTSUnionType(typeAnnotations) { - const types = typeAnnotations.map(type => type.typeAnnotation); - const flattened = (0, _removeTypeDuplicates.default)(types); - - if (flattened.length === 1) { - return flattened[0]; - } else { - return (0, _generated.tsUnionType)(flattened); - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/clone.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/clone.js deleted file mode 100644 index e262c632..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/clone.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = clone; - -var _cloneNode = require("./cloneNode"); - -function clone(node) { - return (0, _cloneNode.default)(node, false); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneDeep.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneDeep.js deleted file mode 100644 index 9067e7b7..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneDeep.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cloneDeep; - -var _cloneNode = require("./cloneNode"); - -function cloneDeep(node) { - return (0, _cloneNode.default)(node); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js deleted file mode 100644 index a8c53dd4..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cloneDeepWithoutLoc; - -var _cloneNode = require("./cloneNode"); - -function cloneDeepWithoutLoc(node) { - return (0, _cloneNode.default)(node, true, true); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneNode.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneNode.js deleted file mode 100644 index 5980f2d1..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneNode.js +++ /dev/null @@ -1,114 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cloneNode; - -var _definitions = require("../definitions"); - -var _generated = require("../validators/generated"); - -const has = Function.call.bind(Object.prototype.hasOwnProperty); - -function cloneIfNode(obj, deep, withoutLoc) { - if (obj && typeof obj.type === "string") { - return cloneNode(obj, deep, withoutLoc); - } - - return obj; -} - -function cloneIfNodeOrArray(obj, deep, withoutLoc) { - if (Array.isArray(obj)) { - return obj.map(node => cloneIfNode(node, deep, withoutLoc)); - } - - return cloneIfNode(obj, deep, withoutLoc); -} - -function cloneNode(node, deep = true, withoutLoc = false) { - if (!node) return node; - const { - type - } = node; - const newNode = { - type: node.type - }; - - if ((0, _generated.isIdentifier)(node)) { - newNode.name = node.name; - - if (has(node, "optional") && typeof node.optional === "boolean") { - newNode.optional = node.optional; - } - - if (has(node, "typeAnnotation")) { - newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation; - } - } else if (!has(_definitions.NODE_FIELDS, type)) { - throw new Error(`Unknown node type: "${type}"`); - } else { - for (const field of Object.keys(_definitions.NODE_FIELDS[type])) { - if (has(node, field)) { - if (deep) { - newNode[field] = (0, _generated.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc); - } else { - newNode[field] = node[field]; - } - } - } - } - - if (has(node, "loc")) { - if (withoutLoc) { - newNode.loc = null; - } else { - newNode.loc = node.loc; - } - } - - if (has(node, "leadingComments")) { - newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc); - } - - if (has(node, "innerComments")) { - newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc); - } - - if (has(node, "trailingComments")) { - newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc); - } - - if (has(node, "extra")) { - newNode.extra = Object.assign({}, node.extra); - } - - return newNode; -} - -function maybeCloneComments(comments, deep, withoutLoc) { - if (!comments || !deep) { - return comments; - } - - return comments.map(({ - type, - value, - loc - }) => { - if (withoutLoc) { - return { - type, - value, - loc: null - }; - } - - return { - type, - value, - loc - }; - }); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js deleted file mode 100644 index d0420b1c..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cloneWithoutLoc; - -var _cloneNode = require("./cloneNode"); - -function cloneWithoutLoc(node) { - return (0, _cloneNode.default)(node, false, true); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/addComment.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/addComment.js deleted file mode 100644 index de19ab74..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/addComment.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = addComment; - -var _addComments = require("./addComments"); - -function addComment(node, type, content, line) { - return (0, _addComments.default)(node, type, [{ - type: line ? "CommentLine" : "CommentBlock", - value: content - }]); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/addComments.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/addComments.js deleted file mode 100644 index 26c456fc..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/addComments.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = addComments; - -function addComments(node, type, comments) { - if (!comments || !node) return node; - const key = `${type}Comments`; - - if (node[key]) { - if (type === "leading") { - node[key] = comments.concat(node[key]); - } else { - node[key].push(...comments); - } - } else { - node[key] = comments; - } - - return node; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritInnerComments.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritInnerComments.js deleted file mode 100644 index 4b5dc9ca..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritInnerComments.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inheritInnerComments; - -var _inherit = require("../utils/inherit"); - -function inheritInnerComments(child, parent) { - (0, _inherit.default)("innerComments", child, parent); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritLeadingComments.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritLeadingComments.js deleted file mode 100644 index 6aa2b250..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritLeadingComments.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inheritLeadingComments; - -var _inherit = require("../utils/inherit"); - -function inheritLeadingComments(child, parent) { - (0, _inherit.default)("leadingComments", child, parent); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritTrailingComments.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritTrailingComments.js deleted file mode 100644 index 934ef0b9..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritTrailingComments.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inheritTrailingComments; - -var _inherit = require("../utils/inherit"); - -function inheritTrailingComments(child, parent) { - (0, _inherit.default)("trailingComments", child, parent); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritsComments.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritsComments.js deleted file mode 100644 index 49476cff..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/inheritsComments.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inheritsComments; - -var _inheritTrailingComments = require("./inheritTrailingComments"); - -var _inheritLeadingComments = require("./inheritLeadingComments"); - -var _inheritInnerComments = require("./inheritInnerComments"); - -function inheritsComments(child, parent) { - (0, _inheritTrailingComments.default)(child, parent); - (0, _inheritLeadingComments.default)(child, parent); - (0, _inheritInnerComments.default)(child, parent); - return child; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/removeComments.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/removeComments.js deleted file mode 100644 index fe34f1a8..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/comments/removeComments.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removeComments; - -var _constants = require("../constants"); - -function removeComments(node) { - _constants.COMMENT_KEYS.forEach(key => { - node[key] = null; - }); - - return node; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/constants/generated/index.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/constants/generated/index.js deleted file mode 100644 index 5c590000..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/constants/generated/index.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TSBASETYPE_TYPES = exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.JSX_TYPES = exports.ENUMMEMBER_TYPES = exports.ENUMBODY_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.FLOWTYPE_TYPES = exports.FLOW_TYPES = exports.PRIVATE_TYPES = exports.MODULESPECIFIER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = exports.CLASS_TYPES = exports.PATTERN_TYPES = exports.UNARYLIKE_TYPES = exports.PROPERTY_TYPES = exports.OBJECTMEMBER_TYPES = exports.METHOD_TYPES = exports.USERWHITESPACABLE_TYPES = exports.IMMUTABLE_TYPES = exports.LITERAL_TYPES = exports.TSENTITYNAME_TYPES = exports.LVAL_TYPES = exports.PATTERNLIKE_TYPES = exports.DECLARATION_TYPES = exports.PUREISH_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTION_TYPES = exports.FORXSTATEMENT_TYPES = exports.FOR_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.WHILE_TYPES = exports.LOOP_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.SCOPABLE_TYPES = exports.BINARY_TYPES = exports.EXPRESSION_TYPES = void 0; - -var _definitions = require("../../definitions"); - -const EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Expression"]; -exports.EXPRESSION_TYPES = EXPRESSION_TYPES; -const BINARY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Binary"]; -exports.BINARY_TYPES = BINARY_TYPES; -const SCOPABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Scopable"]; -exports.SCOPABLE_TYPES = SCOPABLE_TYPES; -const BLOCKPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["BlockParent"]; -exports.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES; -const BLOCK_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Block"]; -exports.BLOCK_TYPES = BLOCK_TYPES; -const STATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Statement"]; -exports.STATEMENT_TYPES = STATEMENT_TYPES; -const TERMINATORLESS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Terminatorless"]; -exports.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES; -const COMPLETIONSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["CompletionStatement"]; -exports.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES; -const CONDITIONAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Conditional"]; -exports.CONDITIONAL_TYPES = CONDITIONAL_TYPES; -const LOOP_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Loop"]; -exports.LOOP_TYPES = LOOP_TYPES; -const WHILE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["While"]; -exports.WHILE_TYPES = WHILE_TYPES; -const EXPRESSIONWRAPPER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExpressionWrapper"]; -exports.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES; -const FOR_TYPES = _definitions.FLIPPED_ALIAS_KEYS["For"]; -exports.FOR_TYPES = FOR_TYPES; -const FORXSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ForXStatement"]; -exports.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES; -const FUNCTION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Function"]; -exports.FUNCTION_TYPES = FUNCTION_TYPES; -const FUNCTIONPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FunctionParent"]; -exports.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES; -const PUREISH_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pureish"]; -exports.PUREISH_TYPES = PUREISH_TYPES; -const DECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Declaration"]; -exports.DECLARATION_TYPES = DECLARATION_TYPES; -const PATTERNLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["PatternLike"]; -exports.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES; -const LVAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["LVal"]; -exports.LVAL_TYPES = LVAL_TYPES; -const TSENTITYNAME_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSEntityName"]; -exports.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES; -const LITERAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Literal"]; -exports.LITERAL_TYPES = LITERAL_TYPES; -const IMMUTABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Immutable"]; -exports.IMMUTABLE_TYPES = IMMUTABLE_TYPES; -const USERWHITESPACABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UserWhitespacable"]; -exports.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES; -const METHOD_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Method"]; -exports.METHOD_TYPES = METHOD_TYPES; -const OBJECTMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ObjectMember"]; -exports.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES; -const PROPERTY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Property"]; -exports.PROPERTY_TYPES = PROPERTY_TYPES; -const UNARYLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UnaryLike"]; -exports.UNARYLIKE_TYPES = UNARYLIKE_TYPES; -const PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pattern"]; -exports.PATTERN_TYPES = PATTERN_TYPES; -const CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Class"]; -exports.CLASS_TYPES = CLASS_TYPES; -const MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleDeclaration"]; -exports.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES; -const EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExportDeclaration"]; -exports.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES; -const MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleSpecifier"]; -exports.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES; -const PRIVATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Private"]; -exports.PRIVATE_TYPES = PRIVATE_TYPES; -const FLOW_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Flow"]; -exports.FLOW_TYPES = FLOW_TYPES; -const FLOWTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowType"]; -exports.FLOWTYPE_TYPES = FLOWTYPE_TYPES; -const FLOWBASEANNOTATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"]; -exports.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES; -const FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowDeclaration"]; -exports.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES; -const FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowPredicate"]; -exports.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES; -const ENUMBODY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["EnumBody"]; -exports.ENUMBODY_TYPES = ENUMBODY_TYPES; -const ENUMMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["EnumMember"]; -exports.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES; -const JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS["JSX"]; -exports.JSX_TYPES = JSX_TYPES; -const TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSTypeElement"]; -exports.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES; -const TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"]; -exports.TSTYPE_TYPES = TSTYPE_TYPES; -const TSBASETYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSBaseType"]; -exports.TSBASETYPE_TYPES = TSBASETYPE_TYPES; \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/constants/index.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/constants/index.js deleted file mode 100644 index 7553162c..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/constants/index.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.ASSIGNMENT_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0; -const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; -exports.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS; -const FLATTENABLE_KEYS = ["body", "expressions"]; -exports.FLATTENABLE_KEYS = FLATTENABLE_KEYS; -const FOR_INIT_KEYS = ["left", "init"]; -exports.FOR_INIT_KEYS = FOR_INIT_KEYS; -const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; -exports.COMMENT_KEYS = COMMENT_KEYS; -const LOGICAL_OPERATORS = ["||", "&&", "??"]; -exports.LOGICAL_OPERATORS = LOGICAL_OPERATORS; -const UPDATE_OPERATORS = ["++", "--"]; -exports.UPDATE_OPERATORS = UPDATE_OPERATORS; -const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; -exports.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS; -const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="]; -exports.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS; -const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"]; -exports.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS; -const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS]; -exports.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS; -const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; -exports.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS; -const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS]; -exports.BINARY_OPERATORS = BINARY_OPERATORS; -const ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map(op => op + "="), ...LOGICAL_OPERATORS.map(op => op + "=")]; -exports.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS; -const BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; -exports.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS; -const NUMBER_UNARY_OPERATORS = ["+", "-", "~"]; -exports.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS; -const STRING_UNARY_OPERATORS = ["typeof"]; -exports.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS; -const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS]; -exports.UNARY_OPERATORS = UNARY_OPERATORS; -const INHERIT_KEYS = { - optional: ["typeAnnotation", "typeParameters", "returnType"], - force: ["start", "loc", "end"] -}; -exports.INHERIT_KEYS = INHERIT_KEYS; -const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); -exports.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL; -const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding"); -exports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING; \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/Scope.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/Scope.js deleted file mode 100644 index e69de29b..00000000 diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/ensureBlock.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/ensureBlock.js deleted file mode 100644 index 56fdf1fd..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/ensureBlock.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = ensureBlock; - -var _toBlock = require("./toBlock"); - -function ensureBlock(node, key = "body") { - return node[key] = (0, _toBlock.default)(node[key], node); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js deleted file mode 100644 index 379e5ffe..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = gatherSequenceExpressions; - -var _getBindingIdentifiers = require("../retrievers/getBindingIdentifiers"); - -var _generated = require("../validators/generated"); - -var _generated2 = require("../builders/generated"); - -var _cloneNode = require("../clone/cloneNode"); - -function gatherSequenceExpressions(nodes, scope, declars) { - const exprs = []; - let ensureLastUndefined = true; - - for (const node of nodes) { - if (!(0, _generated.isEmptyStatement)(node)) { - ensureLastUndefined = false; - } - - if ((0, _generated.isExpression)(node)) { - exprs.push(node); - } else if ((0, _generated.isExpressionStatement)(node)) { - exprs.push(node.expression); - } else if ((0, _generated.isVariableDeclaration)(node)) { - if (node.kind !== "var") return; - - for (const declar of node.declarations) { - const bindings = (0, _getBindingIdentifiers.default)(declar); - - for (const key of Object.keys(bindings)) { - declars.push({ - kind: node.kind, - id: (0, _cloneNode.default)(bindings[key]) - }); - } - - if (declar.init) { - exprs.push((0, _generated2.assignmentExpression)("=", declar.id, declar.init)); - } - } - - ensureLastUndefined = true; - } else if ((0, _generated.isIfStatement)(node)) { - const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode(); - const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode(); - if (!consequent || !alternate) return; - exprs.push((0, _generated2.conditionalExpression)(node.test, consequent, alternate)); - } else if ((0, _generated.isBlockStatement)(node)) { - const body = gatherSequenceExpressions(node.body, scope, declars); - if (!body) return; - exprs.push(body); - } else if ((0, _generated.isEmptyStatement)(node)) { - if (nodes.indexOf(node) === 0) { - ensureLastUndefined = true; - } - } else { - return; - } - } - - if (ensureLastUndefined) { - exprs.push(scope.buildUndefinedNode()); - } - - if (exprs.length === 1) { - return exprs[0]; - } else { - return (0, _generated2.sequenceExpression)(exprs); - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js deleted file mode 100644 index 6bbce6e5..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toBindingIdentifierName; - -var _toIdentifier = require("./toIdentifier"); - -function toBindingIdentifierName(name) { - name = (0, _toIdentifier.default)(name); - if (name === "eval" || name === "arguments") name = "_" + name; - return name; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toBlock.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toBlock.js deleted file mode 100644 index 19886833..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toBlock.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toBlock; - -var _generated = require("../validators/generated"); - -var _generated2 = require("../builders/generated"); - -function toBlock(node, parent) { - if ((0, _generated.isBlockStatement)(node)) { - return node; - } - - let blockNodes = []; - - if ((0, _generated.isEmptyStatement)(node)) { - blockNodes = []; - } else { - if (!(0, _generated.isStatement)(node)) { - if ((0, _generated.isFunction)(parent)) { - node = (0, _generated2.returnStatement)(node); - } else { - node = (0, _generated2.expressionStatement)(node); - } - } - - blockNodes = [node]; - } - - return (0, _generated2.blockStatement)(blockNodes); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toComputedKey.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toComputedKey.js deleted file mode 100644 index 31e6770f..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toComputedKey.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toComputedKey; - -var _generated = require("../validators/generated"); - -var _generated2 = require("../builders/generated"); - -function toComputedKey(node, key = node.key || node.property) { - if (!node.computed && (0, _generated.isIdentifier)(key)) key = (0, _generated2.stringLiteral)(key.name); - return key; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toExpression.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toExpression.js deleted file mode 100644 index 2d944f0e..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toExpression.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _generated = require("../validators/generated"); - -var _default = toExpression; -exports.default = _default; - -function toExpression(node) { - if ((0, _generated.isExpressionStatement)(node)) { - node = node.expression; - } - - if ((0, _generated.isExpression)(node)) { - return node; - } - - if ((0, _generated.isClass)(node)) { - node.type = "ClassExpression"; - } else if ((0, _generated.isFunction)(node)) { - node.type = "FunctionExpression"; - } - - if (!(0, _generated.isExpression)(node)) { - throw new Error(`cannot turn ${node.type} to an expression`); - } - - return node; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toIdentifier.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toIdentifier.js deleted file mode 100644 index 2fd4028d..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toIdentifier.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toIdentifier; - -var _isValidIdentifier = require("../validators/isValidIdentifier"); - -var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); - -function toIdentifier(input) { - input = input + ""; - let name = ""; - - for (const c of input) { - name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-"; - } - - name = name.replace(/^[-0-9]+/, ""); - name = name.replace(/[-\s]+(.)?/g, function (match, c) { - return c ? c.toUpperCase() : ""; - }); - - if (!(0, _isValidIdentifier.default)(name)) { - name = `_${name}`; - } - - return name || "_"; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toKeyAlias.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toKeyAlias.js deleted file mode 100644 index 49ef4b8a..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toKeyAlias.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toKeyAlias; - -var _generated = require("../validators/generated"); - -var _cloneNode = require("../clone/cloneNode"); - -var _removePropertiesDeep = require("../modifications/removePropertiesDeep"); - -function toKeyAlias(node, key = node.key) { - let alias; - - if (node.kind === "method") { - return toKeyAlias.increment() + ""; - } else if ((0, _generated.isIdentifier)(key)) { - alias = key.name; - } else if ((0, _generated.isStringLiteral)(key)) { - alias = JSON.stringify(key.value); - } else { - alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key))); - } - - if (node.computed) { - alias = `[${alias}]`; - } - - if (node.static) { - alias = `static:${alias}`; - } - - return alias; -} - -toKeyAlias.uid = 0; - -toKeyAlias.increment = function () { - if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) { - return toKeyAlias.uid = 0; - } else { - return toKeyAlias.uid++; - } -}; \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toSequenceExpression.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toSequenceExpression.js deleted file mode 100644 index c3d3133e..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toSequenceExpression.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toSequenceExpression; - -var _gatherSequenceExpressions = require("./gatherSequenceExpressions"); - -function toSequenceExpression(nodes, scope) { - if (!(nodes != null && nodes.length)) return; - const declars = []; - const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars); - if (!result) return; - - for (const declar of declars) { - scope.push(declar); - } - - return result; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toStatement.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toStatement.js deleted file mode 100644 index da020a61..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/toStatement.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _generated = require("../validators/generated"); - -var _generated2 = require("../builders/generated"); - -var _default = toStatement; -exports.default = _default; - -function toStatement(node, ignore) { - if ((0, _generated.isStatement)(node)) { - return node; - } - - let mustHaveId = false; - let newType; - - if ((0, _generated.isClass)(node)) { - mustHaveId = true; - newType = "ClassDeclaration"; - } else if ((0, _generated.isFunction)(node)) { - mustHaveId = true; - newType = "FunctionDeclaration"; - } else if ((0, _generated.isAssignmentExpression)(node)) { - return (0, _generated2.expressionStatement)(node); - } - - if (mustHaveId && !node.id) { - newType = false; - } - - if (!newType) { - if (ignore) { - return false; - } else { - throw new Error(`cannot turn ${node.type} to a statement`); - } - } - - node.type = newType; - return node; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/valueToNode.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/valueToNode.js deleted file mode 100644 index b3e531b3..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/converters/valueToNode.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _isValidIdentifier = require("../validators/isValidIdentifier"); - -var _generated = require("../builders/generated"); - -var _default = valueToNode; -exports.default = _default; -const objectToString = Function.call.bind(Object.prototype.toString); - -function isRegExp(value) { - return objectToString(value) === "[object RegExp]"; -} - -function isPlainObject(value) { - if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") { - return false; - } - - const proto = Object.getPrototypeOf(value); - return proto === null || Object.getPrototypeOf(proto) === null; -} - -function valueToNode(value) { - if (value === undefined) { - return (0, _generated.identifier)("undefined"); - } - - if (value === true || value === false) { - return (0, _generated.booleanLiteral)(value); - } - - if (value === null) { - return (0, _generated.nullLiteral)(); - } - - if (typeof value === "string") { - return (0, _generated.stringLiteral)(value); - } - - if (typeof value === "number") { - let result; - - if (Number.isFinite(value)) { - result = (0, _generated.numericLiteral)(Math.abs(value)); - } else { - let numerator; - - if (Number.isNaN(value)) { - numerator = (0, _generated.numericLiteral)(0); - } else { - numerator = (0, _generated.numericLiteral)(1); - } - - result = (0, _generated.binaryExpression)("/", numerator, (0, _generated.numericLiteral)(0)); - } - - if (value < 0 || Object.is(value, -0)) { - result = (0, _generated.unaryExpression)("-", result); - } - - return result; - } - - if (isRegExp(value)) { - const pattern = value.source; - const flags = value.toString().match(/\/([a-z]+|)$/)[1]; - return (0, _generated.regExpLiteral)(pattern, flags); - } - - if (Array.isArray(value)) { - return (0, _generated.arrayExpression)(value.map(valueToNode)); - } - - if (isPlainObject(value)) { - const props = []; - - for (const key of Object.keys(value)) { - let nodeKey; - - if ((0, _isValidIdentifier.default)(key)) { - nodeKey = (0, _generated.identifier)(key); - } else { - nodeKey = (0, _generated.stringLiteral)(key); - } - - props.push((0, _generated.objectProperty)(nodeKey, valueToNode(value[key]))); - } - - return (0, _generated.objectExpression)(props); - } - - throw new Error("don't know how to turn this value into a node"); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/core.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/core.js deleted file mode 100644 index c90f6dfa..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/core.js +++ /dev/null @@ -1,1590 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0; - -var _is = require("../validators/is"); - -var _isValidIdentifier = require("../validators/isValidIdentifier"); - -var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); - -var _constants = require("../constants"); - -var _utils = require("./utils"); - -(0, _utils.default)("ArrayExpression", { - fields: { - elements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))), - default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined - } - }, - visitor: ["elements"], - aliases: ["Expression"] -}); -(0, _utils.default)("AssignmentExpression", { - fields: { - operator: { - validate: function () { - if (!process.env.BABEL_TYPES_8_BREAKING) { - return (0, _utils.assertValueType)("string"); - } - - const identifier = (0, _utils.assertOneOf)(..._constants.ASSIGNMENT_OPERATORS); - const pattern = (0, _utils.assertOneOf)("="); - return function (node, key, val) { - const validator = (0, _is.default)("Pattern", node.left) ? pattern : identifier; - validator(node, key, val); - }; - }() - }, - left: { - validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - builder: ["operator", "left", "right"], - visitor: ["left", "right"], - aliases: ["Expression"] -}); -(0, _utils.default)("BinaryExpression", { - builder: ["operator", "left", "right"], - fields: { - operator: { - validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS) - }, - left: { - validate: function () { - const expression = (0, _utils.assertNodeType)("Expression"); - const inOp = (0, _utils.assertNodeType)("Expression", "PrivateName"); - - const validator = function (node, key, val) { - const validator = node.operator === "in" ? inOp : expression; - validator(node, key, val); - }; - - validator.oneOfNodeTypes = ["Expression", "PrivateName"]; - return validator; - }() - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - visitor: ["left", "right"], - aliases: ["Binary", "Expression"] -}); -(0, _utils.default)("InterpreterDirective", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("Directive", { - visitor: ["value"], - fields: { - value: { - validate: (0, _utils.assertNodeType)("DirectiveLiteral") - } - } -}); -(0, _utils.default)("DirectiveLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("BlockStatement", { - builder: ["body", "directives"], - visitor: ["directives", "body"], - fields: { - directives: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))), - default: [] - }, - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - }, - aliases: ["Scopable", "BlockParent", "Block", "Statement"] -}); -(0, _utils.default)("BreakStatement", { - visitor: ["label"], - fields: { - label: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - } - }, - aliases: ["Statement", "Terminatorless", "CompletionStatement"] -}); -(0, _utils.default)("CallExpression", { - visitor: ["callee", "arguments", "typeParameters", "typeArguments"], - builder: ["callee", "arguments"], - aliases: ["Expression"], - fields: Object.assign({ - callee: { - validate: (0, _utils.assertNodeType)("Expression", "V8IntrinsicIdentifier") - }, - arguments: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder"))) - } - }, !process.env.BABEL_TYPES_8_BREAKING ? { - optional: { - validate: (0, _utils.assertOneOf)(true, false), - optional: true - } - } : {}, { - typeArguments: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), - optional: true - } - }) -}); -(0, _utils.default)("CatchClause", { - visitor: ["param", "body"], - fields: { - param: { - validate: (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }, - aliases: ["Scopable", "BlockParent"] -}); -(0, _utils.default)("ConditionalExpression", { - visitor: ["test", "consequent", "alternate"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - consequent: { - validate: (0, _utils.assertNodeType)("Expression") - }, - alternate: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - aliases: ["Expression", "Conditional"] -}); -(0, _utils.default)("ContinueStatement", { - visitor: ["label"], - fields: { - label: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - } - }, - aliases: ["Statement", "Terminatorless", "CompletionStatement"] -}); -(0, _utils.default)("DebuggerStatement", { - aliases: ["Statement"] -}); -(0, _utils.default)("DoWhileStatement", { - visitor: ["test", "body"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - }, - aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"] -}); -(0, _utils.default)("EmptyStatement", { - aliases: ["Statement"] -}); -(0, _utils.default)("ExpressionStatement", { - visitor: ["expression"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - aliases: ["Statement", "ExpressionWrapper"] -}); -(0, _utils.default)("File", { - builder: ["program", "comments", "tokens"], - visitor: ["program"], - fields: { - program: { - validate: (0, _utils.assertNodeType)("Program") - }, - comments: { - validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, { - each: { - oneOfNodeTypes: ["CommentBlock", "CommentLine"] - } - }) : (0, _utils.assertEach)((0, _utils.assertNodeType)("CommentBlock", "CommentLine")), - optional: true - }, - tokens: { - validate: (0, _utils.assertEach)(Object.assign(() => {}, { - type: "any" - })), - optional: true - } - } -}); -(0, _utils.default)("ForInStatement", { - visitor: ["left", "right", "body"], - aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], - fields: { - left: { - validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("ForStatement", { - visitor: ["init", "test", "update", "body"], - aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"], - fields: { - init: { - validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"), - optional: true - }, - test: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - update: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -const functionCommon = { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement"))) - }, - generator: { - default: false - }, - async: { - default: false - } -}; -exports.functionCommon = functionCommon; -const functionTypeAnnotationCommon = { - returnType: { - validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), - optional: true - } -}; -exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon; -const functionDeclarationCommon = Object.assign({}, functionCommon, { - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - id: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - } -}); -exports.functionDeclarationCommon = functionDeclarationCommon; -(0, _utils.default)("FunctionDeclaration", { - builder: ["id", "params", "body", "generator", "async"], - visitor: ["id", "params", "body", "returnType", "typeParameters"], - fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, { - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }), - aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"], - validate: function () { - if (!process.env.BABEL_TYPES_8_BREAKING) return () => {}; - const identifier = (0, _utils.assertNodeType)("Identifier"); - return function (parent, key, node) { - if (!(0, _is.default)("ExportDefaultDeclaration", parent)) { - identifier(node, "id", node.id); - } - }; - }() -}); -(0, _utils.default)("FunctionExpression", { - inherits: "FunctionDeclaration", - aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], - fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { - id: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }) -}); -const patternLikeCommon = { - typeAnnotation: { - validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))) - } -}; -exports.patternLikeCommon = patternLikeCommon; -(0, _utils.default)("Identifier", { - builder: ["name"], - visitor: ["typeAnnotation", "decorators"], - aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"], - fields: Object.assign({}, patternLikeCommon, { - name: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - - if (!(0, _isValidIdentifier.default)(val, false)) { - throw new TypeError(`"${val}" is not a valid identifier name`); - } - }, { - type: "string" - })) - }, - optional: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - } - }), - - validate(parent, key, node) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - const match = /\.(\w+)$/.exec(key); - if (!match) return; - const [, parentKey] = match; - const nonComp = { - computed: false - }; - - if (parentKey === "property") { - if ((0, _is.default)("MemberExpression", parent, nonComp)) return; - if ((0, _is.default)("OptionalMemberExpression", parent, nonComp)) return; - } else if (parentKey === "key") { - if ((0, _is.default)("Property", parent, nonComp)) return; - if ((0, _is.default)("Method", parent, nonComp)) return; - } else if (parentKey === "exported") { - if ((0, _is.default)("ExportSpecifier", parent)) return; - } else if (parentKey === "imported") { - if ((0, _is.default)("ImportSpecifier", parent, { - imported: node - })) return; - } else if (parentKey === "meta") { - if ((0, _is.default)("MetaProperty", parent, { - meta: node - })) return; - } - - if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name, false)) && node.name !== "this") { - throw new TypeError(`"${node.name}" is not a valid identifier`); - } - } - -}); -(0, _utils.default)("IfStatement", { - visitor: ["test", "consequent", "alternate"], - aliases: ["Statement", "Conditional"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - consequent: { - validate: (0, _utils.assertNodeType)("Statement") - }, - alternate: { - optional: true, - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("LabeledStatement", { - visitor: ["label", "body"], - aliases: ["Statement"], - fields: { - label: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("StringLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("NumericLiteral", { - builder: ["value"], - deprecatedAlias: "NumberLiteral", - fields: { - value: { - validate: (0, _utils.assertValueType)("number") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("NullLiteral", { - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("BooleanLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("boolean") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("RegExpLiteral", { - builder: ["pattern", "flags"], - deprecatedAlias: "RegexLiteral", - aliases: ["Expression", "Pureish", "Literal"], - fields: { - pattern: { - validate: (0, _utils.assertValueType)("string") - }, - flags: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - const invalid = /[^gimsuy]/.exec(val); - - if (invalid) { - throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`); - } - }, { - type: "string" - })), - default: "" - } - } -}); -(0, _utils.default)("LogicalExpression", { - builder: ["operator", "left", "right"], - visitor: ["left", "right"], - aliases: ["Binary", "Expression"], - fields: { - operator: { - validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS) - }, - left: { - validate: (0, _utils.assertNodeType)("Expression") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("MemberExpression", { - builder: ["object", "property", "computed", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["optional"] : [])], - visitor: ["object", "property"], - aliases: ["Expression", "LVal"], - fields: Object.assign({ - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - property: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName"); - const computed = (0, _utils.assertNodeType)("Expression"); - - const validator = function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - - validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"]; - return validator; - }() - }, - computed: { - default: false - } - }, !process.env.BABEL_TYPES_8_BREAKING ? { - optional: { - validate: (0, _utils.assertOneOf)(true, false), - optional: true - } - } : {}) -}); -(0, _utils.default)("NewExpression", { - inherits: "CallExpression" -}); -(0, _utils.default)("Program", { - visitor: ["directives", "body"], - builder: ["body", "directives", "sourceType", "interpreter"], - fields: { - sourceFile: { - validate: (0, _utils.assertValueType)("string") - }, - sourceType: { - validate: (0, _utils.assertOneOf)("script", "module"), - default: "script" - }, - interpreter: { - validate: (0, _utils.assertNodeType)("InterpreterDirective"), - default: null, - optional: true - }, - directives: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))), - default: [] - }, - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - }, - aliases: ["Scopable", "BlockParent", "Block"] -}); -(0, _utils.default)("ObjectExpression", { - visitor: ["properties"], - aliases: ["Expression"], - fields: { - properties: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement"))) - } - } -}); -(0, _utils.default)("ObjectMethod", { - builder: ["kind", "key", "params", "body", "computed", "generator", "async"], - fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { - kind: Object.assign({ - validate: (0, _utils.assertOneOf)("method", "get", "set") - }, !process.env.BABEL_TYPES_8_BREAKING ? { - default: "method" - } : {}), - computed: { - default: false - }, - key: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - const computed = (0, _utils.assertNodeType)("Expression"); - - const validator = function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - - validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"]; - return validator; - }() - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }), - visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], - aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"] -}); -(0, _utils.default)("ObjectProperty", { - builder: ["key", "value", "computed", "shorthand", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : [])], - fields: { - computed: { - default: false - }, - key: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - const computed = (0, _utils.assertNodeType)("Expression"); - - const validator = function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - - validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"]; - return validator; - }() - }, - value: { - validate: (0, _utils.assertNodeType)("Expression", "PatternLike") - }, - shorthand: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - - if (val && node.computed) { - throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true"); - } - }, { - type: "boolean" - }), function (node, key, val) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - - if (val && !(0, _is.default)("Identifier", node.key)) { - throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier"); - } - }), - default: false - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } - }, - visitor: ["key", "value", "decorators"], - aliases: ["UserWhitespacable", "Property", "ObjectMember"], - validate: function () { - const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern"); - const expression = (0, _utils.assertNodeType)("Expression"); - return function (parent, key, node) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - const validator = (0, _is.default)("ObjectPattern", parent) ? pattern : expression; - validator(node, "value", node.value); - }; - }() -}); -(0, _utils.default)("RestElement", { - visitor: ["argument", "typeAnnotation"], - builder: ["argument"], - aliases: ["LVal", "PatternLike"], - deprecatedAlias: "RestProperty", - fields: Object.assign({}, patternLikeCommon, { - argument: { - validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal") : (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression") - }, - optional: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - } - }), - - validate(parent, key) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - const match = /(\w+)\[(\d+)\]/.exec(key); - if (!match) throw new Error("Internal Babel error: malformed key."); - const [, listKey, index] = match; - - if (parent[listKey].length > index + 1) { - throw new TypeError(`RestElement must be last element of ${listKey}`); - } - } - -}); -(0, _utils.default)("ReturnStatement", { - visitor: ["argument"], - aliases: ["Statement", "Terminatorless", "CompletionStatement"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - } - } -}); -(0, _utils.default)("SequenceExpression", { - visitor: ["expressions"], - fields: { - expressions: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression"))) - } - }, - aliases: ["Expression"] -}); -(0, _utils.default)("ParenthesizedExpression", { - visitor: ["expression"], - aliases: ["Expression", "ExpressionWrapper"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("SwitchCase", { - visitor: ["test", "consequent"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - consequent: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - } -}); -(0, _utils.default)("SwitchStatement", { - visitor: ["discriminant", "cases"], - aliases: ["Statement", "BlockParent", "Scopable"], - fields: { - discriminant: { - validate: (0, _utils.assertNodeType)("Expression") - }, - cases: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase"))) - } - } -}); -(0, _utils.default)("ThisExpression", { - aliases: ["Expression"] -}); -(0, _utils.default)("ThrowStatement", { - visitor: ["argument"], - aliases: ["Statement", "Terminatorless", "CompletionStatement"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("TryStatement", { - visitor: ["block", "handler", "finalizer"], - aliases: ["Statement"], - fields: { - block: { - validate: (0, _utils.chain)((0, _utils.assertNodeType)("BlockStatement"), Object.assign(function (node) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - - if (!node.handler && !node.finalizer) { - throw new TypeError("TryStatement expects either a handler or finalizer, or both"); - } - }, { - oneOfNodeTypes: ["BlockStatement"] - })) - }, - handler: { - optional: true, - validate: (0, _utils.assertNodeType)("CatchClause") - }, - finalizer: { - optional: true, - validate: (0, _utils.assertNodeType)("BlockStatement") - } - } -}); -(0, _utils.default)("UnaryExpression", { - builder: ["operator", "argument", "prefix"], - fields: { - prefix: { - default: true - }, - argument: { - validate: (0, _utils.assertNodeType)("Expression") - }, - operator: { - validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS) - } - }, - visitor: ["argument"], - aliases: ["UnaryLike", "Expression"] -}); -(0, _utils.default)("UpdateExpression", { - builder: ["operator", "argument", "prefix"], - fields: { - prefix: { - default: false - }, - argument: { - validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Expression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression") - }, - operator: { - validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS) - } - }, - visitor: ["argument"], - aliases: ["Expression"] -}); -(0, _utils.default)("VariableDeclaration", { - builder: ["kind", "declarations"], - visitor: ["declarations"], - aliases: ["Statement", "Declaration"], - fields: { - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - kind: { - validate: (0, _utils.assertOneOf)("var", "let", "const") - }, - declarations: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator"))) - } - }, - - validate(parent, key, node) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - if (!(0, _is.default)("ForXStatement", parent, { - left: node - })) return; - - if (node.declarations.length !== 1) { - throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`); - } - } - -}); -(0, _utils.default)("VariableDeclarator", { - visitor: ["id", "init"], - fields: { - id: { - validate: function () { - if (!process.env.BABEL_TYPES_8_BREAKING) { - return (0, _utils.assertNodeType)("LVal"); - } - - const normal = (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"); - const without = (0, _utils.assertNodeType)("Identifier"); - return function (node, key, val) { - const validator = node.init ? normal : without; - validator(node, key, val); - }; - }() - }, - definite: { - optional: true, - validate: (0, _utils.assertValueType)("boolean") - }, - init: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("WhileStatement", { - visitor: ["test", "body"], - aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"], - fields: { - test: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("WithStatement", { - visitor: ["object", "body"], - aliases: ["Statement"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - } - } -}); -(0, _utils.default)("AssignmentPattern", { - visitor: ["left", "right", "decorators"], - builder: ["left", "right"], - aliases: ["Pattern", "PatternLike", "LVal"], - fields: Object.assign({}, patternLikeCommon, { - left: { - validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression") - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } - }) -}); -(0, _utils.default)("ArrayPattern", { - visitor: ["elements", "typeAnnotation"], - builder: ["elements"], - aliases: ["Pattern", "PatternLike", "LVal"], - fields: Object.assign({}, patternLikeCommon, { - elements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "PatternLike"))) - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - }, - optional: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - } - }) -}); -(0, _utils.default)("ArrowFunctionExpression", { - builder: ["params", "body", "async"], - visitor: ["params", "body", "returnType", "typeParameters"], - aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], - fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { - expression: { - validate: (0, _utils.assertValueType)("boolean") - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement", "Expression") - } - }) -}); -(0, _utils.default)("ClassBody", { - visitor: ["body"], - fields: { - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature"))) - } - } -}); -(0, _utils.default)("ClassExpression", { - builder: ["id", "superClass", "body", "decorators"], - visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"], - aliases: ["Scopable", "Class", "Expression"], - fields: { - id: { - validate: (0, _utils.assertNodeType)("Identifier"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("ClassBody") - }, - superClass: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - }, - superTypeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), - optional: true - }, - implements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - }, - mixins: { - validate: (0, _utils.assertNodeType)("InterfaceExtends"), - optional: true - } - } -}); -(0, _utils.default)("ClassDeclaration", { - inherits: "ClassExpression", - aliases: ["Scopable", "Class", "Statement", "Declaration"], - fields: { - id: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), - optional: true - }, - body: { - validate: (0, _utils.assertNodeType)("ClassBody") - }, - superClass: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - }, - superTypeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), - optional: true - }, - implements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - }, - mixins: { - validate: (0, _utils.assertNodeType)("InterfaceExtends"), - optional: true - }, - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - abstract: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - } - }, - validate: function () { - const identifier = (0, _utils.assertNodeType)("Identifier"); - return function (parent, key, node) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - - if (!(0, _is.default)("ExportDefaultDeclaration", parent)) { - identifier(node, "id", node.id); - } - }; - }() -}); -(0, _utils.default)("ExportAllDeclaration", { - visitor: ["source"], - aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], - fields: { - source: { - validate: (0, _utils.assertNodeType)("StringLiteral") - }, - exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")), - assertions: { - optional: true, - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute"))) - } - } -}); -(0, _utils.default)("ExportDefaultDeclaration", { - visitor: ["declaration"], - aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], - fields: { - declaration: { - validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression") - }, - exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("value")) - } -}); -(0, _utils.default)("ExportNamedDeclaration", { - visitor: ["declaration", "specifiers", "source"], - aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], - fields: { - declaration: { - optional: true, - validate: (0, _utils.chain)((0, _utils.assertNodeType)("Declaration"), Object.assign(function (node, key, val) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - - if (val && node.specifiers.length) { - throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration"); - } - }, { - oneOfNodeTypes: ["Declaration"] - }), function (node, key, val) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - - if (val && node.source) { - throw new TypeError("Cannot export a declaration from a source"); - } - }) - }, - assertions: { - optional: true, - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute"))) - }, - specifiers: { - default: [], - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)(function () { - const sourced = (0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier"); - const sourceless = (0, _utils.assertNodeType)("ExportSpecifier"); - if (!process.env.BABEL_TYPES_8_BREAKING) return sourced; - return function (node, key, val) { - const validator = node.source ? sourced : sourceless; - validator(node, key, val); - }; - }())) - }, - source: { - validate: (0, _utils.assertNodeType)("StringLiteral"), - optional: true - }, - exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) - } -}); -(0, _utils.default)("ExportSpecifier", { - visitor: ["local", "exported"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - exported: { - validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral") - } - } -}); -(0, _utils.default)("ForOfStatement", { - visitor: ["left", "right", "body"], - builder: ["left", "right", "body", "await"], - aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], - fields: { - left: { - validate: function () { - if (!process.env.BABEL_TYPES_8_BREAKING) { - return (0, _utils.assertNodeType)("VariableDeclaration", "LVal"); - } - - const declaration = (0, _utils.assertNodeType)("VariableDeclaration"); - const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern"); - return function (node, key, val) { - if ((0, _is.default)("VariableDeclaration", val)) { - declaration(node, key, val); - } else { - lval(node, key, val); - } - }; - }() - }, - right: { - validate: (0, _utils.assertNodeType)("Expression") - }, - body: { - validate: (0, _utils.assertNodeType)("Statement") - }, - await: { - default: false - } - } -}); -(0, _utils.default)("ImportDeclaration", { - visitor: ["specifiers", "source"], - aliases: ["Statement", "Declaration", "ModuleDeclaration"], - fields: { - assertions: { - optional: true, - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportAttribute"))) - }, - specifiers: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"))) - }, - source: { - validate: (0, _utils.assertNodeType)("StringLiteral") - }, - importKind: { - validate: (0, _utils.assertOneOf)("type", "typeof", "value"), - optional: true - } - } -}); -(0, _utils.default)("ImportDefaultSpecifier", { - visitor: ["local"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("ImportNamespaceSpecifier", { - visitor: ["local"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("ImportSpecifier", { - visitor: ["local", "imported"], - aliases: ["ModuleSpecifier"], - fields: { - local: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - imported: { - validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral") - }, - importKind: { - validate: (0, _utils.assertOneOf)("type", "typeof"), - optional: true - } - } -}); -(0, _utils.default)("MetaProperty", { - visitor: ["meta", "property"], - aliases: ["Expression"], - fields: { - meta: { - validate: (0, _utils.chain)((0, _utils.assertNodeType)("Identifier"), Object.assign(function (node, key, val) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - let property; - - switch (val.name) { - case "function": - property = "sent"; - break; - - case "new": - property = "target"; - break; - - case "import": - property = "meta"; - break; - } - - if (!(0, _is.default)("Identifier", node.property, { - name: property - })) { - throw new TypeError("Unrecognised MetaProperty"); - } - }, { - oneOfNodeTypes: ["Identifier"] - })) - }, - property: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -const classMethodOrPropertyCommon = { - abstract: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - accessibility: { - validate: (0, _utils.assertOneOf)("public", "private", "protected"), - optional: true - }, - static: { - default: false - }, - override: { - default: false - }, - computed: { - default: false - }, - optional: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - key: { - validate: (0, _utils.chain)(function () { - const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); - const computed = (0, _utils.assertNodeType)("Expression"); - return function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression")) - } -}; -exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon; -const classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, classMethodOrPropertyCommon, { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty"))) - }, - kind: { - validate: (0, _utils.assertOneOf)("get", "set", "method", "constructor"), - default: "method" - }, - access: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } -}); -exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; -(0, _utils.default)("ClassMethod", { - aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"], - builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"], - visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], - fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, { - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }) -}); -(0, _utils.default)("ObjectPattern", { - visitor: ["properties", "typeAnnotation", "decorators"], - builder: ["properties"], - aliases: ["Pattern", "PatternLike", "LVal"], - fields: Object.assign({}, patternLikeCommon, { - properties: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty"))) - } - }) -}); -(0, _utils.default)("SpreadElement", { - visitor: ["argument"], - aliases: ["UnaryLike"], - deprecatedAlias: "SpreadProperty", - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("Super", { - aliases: ["Expression"] -}); -(0, _utils.default)("TaggedTemplateExpression", { - visitor: ["tag", "quasi", "typeParameters"], - builder: ["tag", "quasi"], - aliases: ["Expression"], - fields: { - tag: { - validate: (0, _utils.assertNodeType)("Expression") - }, - quasi: { - validate: (0, _utils.assertNodeType)("TemplateLiteral") - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), - optional: true - } - } -}); -(0, _utils.default)("TemplateElement", { - builder: ["value", "tail"], - fields: { - value: { - validate: (0, _utils.assertShape)({ - raw: { - validate: (0, _utils.assertValueType)("string") - }, - cooked: { - validate: (0, _utils.assertValueType)("string"), - optional: true - } - }) - }, - tail: { - default: false - } - } -}); -(0, _utils.default)("TemplateLiteral", { - visitor: ["quasis", "expressions"], - aliases: ["Expression", "Literal"], - fields: { - quasis: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement"))) - }, - expressions: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "TSType")), function (node, key, val) { - if (node.quasis.length !== val.length + 1) { - throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`); - } - }) - } - } -}); -(0, _utils.default)("YieldExpression", { - builder: ["argument", "delegate"], - visitor: ["argument"], - aliases: ["Expression", "Terminatorless"], - fields: { - delegate: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) { - if (!process.env.BABEL_TYPES_8_BREAKING) return; - - if (val && !node.argument) { - throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument"); - } - }, { - type: "boolean" - })), - default: false - }, - argument: { - optional: true, - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("AwaitExpression", { - builder: ["argument"], - visitor: ["argument"], - aliases: ["Expression", "Terminatorless"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("Import", { - aliases: ["Expression"] -}); -(0, _utils.default)("BigIntLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("ExportNamespaceSpecifier", { - visitor: ["exported"], - aliases: ["ModuleSpecifier"], - fields: { - exported: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("OptionalMemberExpression", { - builder: ["object", "property", "computed", "optional"], - visitor: ["object", "property"], - aliases: ["Expression"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - property: { - validate: function () { - const normal = (0, _utils.assertNodeType)("Identifier"); - const computed = (0, _utils.assertNodeType)("Expression"); - - const validator = function (node, key, val) { - const validator = node.computed ? computed : normal; - validator(node, key, val); - }; - - validator.oneOfNodeTypes = ["Expression", "Identifier"]; - return validator; - }() - }, - computed: { - default: false - }, - optional: { - validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)()) - } - } -}); -(0, _utils.default)("OptionalCallExpression", { - visitor: ["callee", "arguments", "typeParameters", "typeArguments"], - builder: ["callee", "arguments", "optional"], - aliases: ["Expression"], - fields: { - callee: { - validate: (0, _utils.assertNodeType)("Expression") - }, - arguments: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder"))) - }, - optional: { - validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)()) - }, - typeArguments: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), - optional: true - } - } -}); -(0, _utils.default)("ClassProperty", { - visitor: ["key", "value", "typeAnnotation", "decorators"], - builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"], - aliases: ["Property"], - fields: Object.assign({}, classMethodOrPropertyCommon, { - value: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - definite: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - typeAnnotation: { - validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - }, - readonly: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - declare: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - variance: { - validate: (0, _utils.assertNodeType)("Variance"), - optional: true - } - }) -}); -(0, _utils.default)("ClassPrivateProperty", { - visitor: ["key", "value", "decorators", "typeAnnotation"], - builder: ["key", "value", "decorators", "static"], - aliases: ["Property", "Private"], - fields: { - key: { - validate: (0, _utils.assertNodeType)("PrivateName") - }, - value: { - validate: (0, _utils.assertNodeType)("Expression"), - optional: true - }, - typeAnnotation: { - validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - }, - readonly: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - definite: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - variance: { - validate: (0, _utils.assertNodeType)("Variance"), - optional: true - } - } -}); -(0, _utils.default)("ClassPrivateMethod", { - builder: ["kind", "key", "params", "body", "static"], - visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], - aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"], - fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, { - key: { - validate: (0, _utils.assertNodeType)("PrivateName") - }, - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - } - }) -}); -(0, _utils.default)("PrivateName", { - visitor: ["id"], - aliases: ["Private"], - fields: { - id: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/experimental.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/experimental.js deleted file mode 100644 index 6a8e14ea..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/experimental.js +++ /dev/null @@ -1,142 +0,0 @@ -"use strict"; - -var _utils = require("./utils"); - -(0, _utils.default)("ArgumentPlaceholder", {}); -(0, _utils.default)("BindExpression", { - visitor: ["object", "callee"], - aliases: ["Expression"], - fields: !process.env.BABEL_TYPES_8_BREAKING ? { - object: { - validate: Object.assign(() => {}, { - oneOfNodeTypes: ["Expression"] - }) - }, - callee: { - validate: Object.assign(() => {}, { - oneOfNodeTypes: ["Expression"] - }) - } - } : { - object: { - validate: (0, _utils.assertNodeType)("Expression") - }, - callee: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("ImportAttribute", { - visitor: ["key", "value"], - fields: { - key: { - validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral") - }, - value: { - validate: (0, _utils.assertNodeType)("StringLiteral") - } - } -}); -(0, _utils.default)("Decorator", { - visitor: ["expression"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("DoExpression", { - visitor: ["body"], - builder: ["body", "async"], - aliases: ["Expression"], - fields: { - body: { - validate: (0, _utils.assertNodeType)("BlockStatement") - }, - async: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - } - } -}); -(0, _utils.default)("ExportDefaultSpecifier", { - visitor: ["exported"], - aliases: ["ModuleSpecifier"], - fields: { - exported: { - validate: (0, _utils.assertNodeType)("Identifier") - } - } -}); -(0, _utils.default)("RecordExpression", { - visitor: ["properties"], - aliases: ["Expression"], - fields: { - properties: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectProperty", "SpreadElement"))) - } - } -}); -(0, _utils.default)("TupleExpression", { - fields: { - elements: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement"))), - default: [] - } - }, - visitor: ["elements"], - aliases: ["Expression"] -}); -(0, _utils.default)("DecimalLiteral", { - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - }, - aliases: ["Expression", "Pureish", "Literal", "Immutable"] -}); -(0, _utils.default)("StaticBlock", { - visitor: ["body"], - fields: { - body: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement"))) - } - }, - aliases: ["Scopable", "BlockParent"] -}); -(0, _utils.default)("ModuleExpression", { - visitor: ["body"], - fields: { - body: { - validate: (0, _utils.assertNodeType)("Program") - } - }, - aliases: ["Expression"] -}); -(0, _utils.default)("TopicReference", { - aliases: ["Expression"] -}); -(0, _utils.default)("PipelineTopicExpression", { - builder: ["expression"], - visitor: ["expression"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - aliases: ["Expression"] -}); -(0, _utils.default)("PipelineBareFunction", { - builder: ["callee"], - visitor: ["callee"], - fields: { - callee: { - validate: (0, _utils.assertNodeType)("Expression") - } - }, - aliases: ["Expression"] -}); -(0, _utils.default)("PipelinePrimaryTopicReference", { - aliases: ["Expression"] -}); \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/flow.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/flow.js deleted file mode 100644 index e658a91d..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/flow.js +++ /dev/null @@ -1,481 +0,0 @@ -"use strict"; - -var _utils = require("./utils"); - -const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => { - (0, _utils.default)(name, { - builder: ["id", "typeParameters", "extends", "body"], - visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)(typeParameterType), - extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), - mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), - implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements")), - body: (0, _utils.validateType)("ObjectTypeAnnotation") - } - }); -}; - -(0, _utils.default)("AnyTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("ArrayTypeAnnotation", { - visitor: ["elementType"], - aliases: ["Flow", "FlowType"], - fields: { - elementType: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("BooleanTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("BooleanLiteralTypeAnnotation", { - builder: ["value"], - aliases: ["Flow", "FlowType"], - fields: { - value: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("NullLiteralTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("ClassImplements", { - visitor: ["id", "typeParameters"], - aliases: ["Flow"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") - } -}); -defineInterfaceishType("DeclareClass"); -(0, _utils.default)("DeclareFunction", { - visitor: ["id"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - predicate: (0, _utils.validateOptionalType)("DeclaredPredicate") - } -}); -defineInterfaceishType("DeclareInterface"); -(0, _utils.default)("DeclareModule", { - builder: ["id", "body", "kind"], - visitor: ["id", "body"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), - body: (0, _utils.validateType)("BlockStatement"), - kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES")) - } -}); -(0, _utils.default)("DeclareModuleExports", { - visitor: ["typeAnnotation"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - typeAnnotation: (0, _utils.validateType)("TypeAnnotation") - } -}); -(0, _utils.default)("DeclareTypeAlias", { - visitor: ["id", "typeParameters", "right"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - right: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("DeclareOpaqueType", { - visitor: ["id", "typeParameters", "supertype"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - supertype: (0, _utils.validateOptionalType)("FlowType"), - impltype: (0, _utils.validateOptionalType)("FlowType") - } -}); -(0, _utils.default)("DeclareVariable", { - visitor: ["id"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier") - } -}); -(0, _utils.default)("DeclareExportDeclaration", { - visitor: ["declaration", "specifiers", "source"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - declaration: (0, _utils.validateOptionalType)("Flow"), - specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])), - source: (0, _utils.validateOptionalType)("StringLiteral"), - default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("DeclareExportAllDeclaration", { - visitor: ["source"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - source: (0, _utils.validateType)("StringLiteral"), - exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) - } -}); -(0, _utils.default)("DeclaredPredicate", { - visitor: ["value"], - aliases: ["Flow", "FlowPredicate"], - fields: { - value: (0, _utils.validateType)("Flow") - } -}); -(0, _utils.default)("ExistsTypeAnnotation", { - aliases: ["Flow", "FlowType"] -}); -(0, _utils.default)("FunctionTypeAnnotation", { - visitor: ["typeParameters", "params", "rest", "returnType"], - aliases: ["Flow", "FlowType"], - fields: { - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - params: (0, _utils.validate)((0, _utils.arrayOfType)("FunctionTypeParam")), - rest: (0, _utils.validateOptionalType)("FunctionTypeParam"), - this: (0, _utils.validateOptionalType)("FunctionTypeParam"), - returnType: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("FunctionTypeParam", { - visitor: ["name", "typeAnnotation"], - aliases: ["Flow"], - fields: { - name: (0, _utils.validateOptionalType)("Identifier"), - typeAnnotation: (0, _utils.validateType)("FlowType"), - optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("GenericTypeAnnotation", { - visitor: ["id", "typeParameters"], - aliases: ["Flow", "FlowType"], - fields: { - id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") - } -}); -(0, _utils.default)("InferredPredicate", { - aliases: ["Flow", "FlowPredicate"] -}); -(0, _utils.default)("InterfaceExtends", { - visitor: ["id", "typeParameters"], - aliases: ["Flow"], - fields: { - id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") - } -}); -defineInterfaceishType("InterfaceDeclaration"); -(0, _utils.default)("InterfaceTypeAnnotation", { - visitor: ["extends", "body"], - aliases: ["Flow", "FlowType"], - fields: { - extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), - body: (0, _utils.validateType)("ObjectTypeAnnotation") - } -}); -(0, _utils.default)("IntersectionTypeAnnotation", { - visitor: ["types"], - aliases: ["Flow", "FlowType"], - fields: { - types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) - } -}); -(0, _utils.default)("MixedTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("EmptyTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("NullableTypeAnnotation", { - visitor: ["typeAnnotation"], - aliases: ["Flow", "FlowType"], - fields: { - typeAnnotation: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("NumberLiteralTypeAnnotation", { - builder: ["value"], - aliases: ["Flow", "FlowType"], - fields: { - value: (0, _utils.validate)((0, _utils.assertValueType)("number")) - } -}); -(0, _utils.default)("NumberTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("ObjectTypeAnnotation", { - visitor: ["properties", "indexers", "callProperties", "internalSlots"], - aliases: ["Flow", "FlowType"], - builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"], - fields: { - properties: (0, _utils.validate)((0, _utils.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])), - indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeIndexer")), - callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeCallProperty")), - internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeInternalSlot")), - exact: { - validate: (0, _utils.assertValueType)("boolean"), - default: false - }, - inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("ObjectTypeInternalSlot", { - visitor: ["id", "value", "optional", "static", "method"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - id: (0, _utils.validateType)("Identifier"), - value: (0, _utils.validateType)("FlowType"), - optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - method: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("ObjectTypeCallProperty", { - visitor: ["value"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - value: (0, _utils.validateType)("FlowType"), - static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("ObjectTypeIndexer", { - visitor: ["id", "key", "value", "variance"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - id: (0, _utils.validateOptionalType)("Identifier"), - key: (0, _utils.validateType)("FlowType"), - value: (0, _utils.validateType)("FlowType"), - static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - variance: (0, _utils.validateOptionalType)("Variance") - } -}); -(0, _utils.default)("ObjectTypeProperty", { - visitor: ["key", "value", "variance"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - key: (0, _utils.validateType)(["Identifier", "StringLiteral"]), - value: (0, _utils.validateType)("FlowType"), - kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")), - static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - variance: (0, _utils.validateOptionalType)("Variance"), - method: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("ObjectTypeSpreadProperty", { - visitor: ["argument"], - aliases: ["Flow", "UserWhitespacable"], - fields: { - argument: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("OpaqueType", { - visitor: ["id", "typeParameters", "supertype", "impltype"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - supertype: (0, _utils.validateOptionalType)("FlowType"), - impltype: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("QualifiedTypeIdentifier", { - visitor: ["id", "qualification"], - aliases: ["Flow"], - fields: { - id: (0, _utils.validateType)("Identifier"), - qualification: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]) - } -}); -(0, _utils.default)("StringLiteralTypeAnnotation", { - builder: ["value"], - aliases: ["Flow", "FlowType"], - fields: { - value: (0, _utils.validate)((0, _utils.assertValueType)("string")) - } -}); -(0, _utils.default)("StringTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("SymbolTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("ThisTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("TupleTypeAnnotation", { - visitor: ["types"], - aliases: ["Flow", "FlowType"], - fields: { - types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) - } -}); -(0, _utils.default)("TypeofTypeAnnotation", { - visitor: ["argument"], - aliases: ["Flow", "FlowType"], - fields: { - argument: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("TypeAlias", { - visitor: ["id", "typeParameters", "right"], - aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], - fields: { - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), - right: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("TypeAnnotation", { - aliases: ["Flow"], - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("TypeCastExpression", { - visitor: ["expression", "typeAnnotation"], - aliases: ["Flow", "ExpressionWrapper", "Expression"], - fields: { - expression: (0, _utils.validateType)("Expression"), - typeAnnotation: (0, _utils.validateType)("TypeAnnotation") - } -}); -(0, _utils.default)("TypeParameter", { - aliases: ["Flow"], - visitor: ["bound", "default", "variance"], - fields: { - name: (0, _utils.validate)((0, _utils.assertValueType)("string")), - bound: (0, _utils.validateOptionalType)("TypeAnnotation"), - default: (0, _utils.validateOptionalType)("FlowType"), - variance: (0, _utils.validateOptionalType)("Variance") - } -}); -(0, _utils.default)("TypeParameterDeclaration", { - aliases: ["Flow"], - visitor: ["params"], - fields: { - params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter")) - } -}); -(0, _utils.default)("TypeParameterInstantiation", { - aliases: ["Flow"], - visitor: ["params"], - fields: { - params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) - } -}); -(0, _utils.default)("UnionTypeAnnotation", { - visitor: ["types"], - aliases: ["Flow", "FlowType"], - fields: { - types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) - } -}); -(0, _utils.default)("Variance", { - aliases: ["Flow"], - builder: ["kind"], - fields: { - kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus")) - } -}); -(0, _utils.default)("VoidTypeAnnotation", { - aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] -}); -(0, _utils.default)("EnumDeclaration", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "body"], - fields: { - id: (0, _utils.validateType)("Identifier"), - body: (0, _utils.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"]) - } -}); -(0, _utils.default)("EnumBooleanBody", { - aliases: ["EnumBody"], - visitor: ["members"], - fields: { - explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - members: (0, _utils.validateArrayOfType)("EnumBooleanMember"), - hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("EnumNumberBody", { - aliases: ["EnumBody"], - visitor: ["members"], - fields: { - explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - members: (0, _utils.validateArrayOfType)("EnumNumberMember"), - hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("EnumStringBody", { - aliases: ["EnumBody"], - visitor: ["members"], - fields: { - explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), - members: (0, _utils.validateArrayOfType)(["EnumStringMember", "EnumDefaultedMember"]), - hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("EnumSymbolBody", { - aliases: ["EnumBody"], - visitor: ["members"], - fields: { - members: (0, _utils.validateArrayOfType)("EnumDefaultedMember"), - hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); -(0, _utils.default)("EnumBooleanMember", { - aliases: ["EnumMember"], - visitor: ["id"], - fields: { - id: (0, _utils.validateType)("Identifier"), - init: (0, _utils.validateType)("BooleanLiteral") - } -}); -(0, _utils.default)("EnumNumberMember", { - aliases: ["EnumMember"], - visitor: ["id", "init"], - fields: { - id: (0, _utils.validateType)("Identifier"), - init: (0, _utils.validateType)("NumericLiteral") - } -}); -(0, _utils.default)("EnumStringMember", { - aliases: ["EnumMember"], - visitor: ["id", "init"], - fields: { - id: (0, _utils.validateType)("Identifier"), - init: (0, _utils.validateType)("StringLiteral") - } -}); -(0, _utils.default)("EnumDefaultedMember", { - aliases: ["EnumMember"], - visitor: ["id"], - fields: { - id: (0, _utils.validateType)("Identifier") - } -}); -(0, _utils.default)("IndexedAccessType", { - visitor: ["objectType", "indexType"], - aliases: ["Flow", "FlowType"], - fields: { - objectType: (0, _utils.validateType)("FlowType"), - indexType: (0, _utils.validateType)("FlowType") - } -}); -(0, _utils.default)("OptionalIndexedAccessType", { - visitor: ["objectType", "indexType"], - aliases: ["Flow", "FlowType"], - fields: { - objectType: (0, _utils.validateType)("FlowType"), - indexType: (0, _utils.validateType)("FlowType"), - optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) - } -}); \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/index.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/index.js deleted file mode 100644 index 897fc24d..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/index.js +++ /dev/null @@ -1,103 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "VISITOR_KEYS", { - enumerable: true, - get: function () { - return _utils.VISITOR_KEYS; - } -}); -Object.defineProperty(exports, "ALIAS_KEYS", { - enumerable: true, - get: function () { - return _utils.ALIAS_KEYS; - } -}); -Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", { - enumerable: true, - get: function () { - return _utils.FLIPPED_ALIAS_KEYS; - } -}); -Object.defineProperty(exports, "NODE_FIELDS", { - enumerable: true, - get: function () { - return _utils.NODE_FIELDS; - } -}); -Object.defineProperty(exports, "BUILDER_KEYS", { - enumerable: true, - get: function () { - return _utils.BUILDER_KEYS; - } -}); -Object.defineProperty(exports, "DEPRECATED_KEYS", { - enumerable: true, - get: function () { - return _utils.DEPRECATED_KEYS; - } -}); -Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", { - enumerable: true, - get: function () { - return _utils.NODE_PARENT_VALIDATIONS; - } -}); -Object.defineProperty(exports, "PLACEHOLDERS", { - enumerable: true, - get: function () { - return _placeholders.PLACEHOLDERS; - } -}); -Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", { - enumerable: true, - get: function () { - return _placeholders.PLACEHOLDERS_ALIAS; - } -}); -Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", { - enumerable: true, - get: function () { - return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS; - } -}); -exports.TYPES = void 0; - -var _toFastProperties = require("to-fast-properties"); - -require("./core"); - -require("./flow"); - -require("./jsx"); - -require("./misc"); - -require("./experimental"); - -require("./typescript"); - -var _utils = require("./utils"); - -var _placeholders = require("./placeholders"); - -_toFastProperties(_utils.VISITOR_KEYS); - -_toFastProperties(_utils.ALIAS_KEYS); - -_toFastProperties(_utils.FLIPPED_ALIAS_KEYS); - -_toFastProperties(_utils.NODE_FIELDS); - -_toFastProperties(_utils.BUILDER_KEYS); - -_toFastProperties(_utils.DEPRECATED_KEYS); - -_toFastProperties(_placeholders.PLACEHOLDERS_ALIAS); - -_toFastProperties(_placeholders.PLACEHOLDERS_FLIPPED_ALIAS); - -const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS)); -exports.TYPES = TYPES; \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/jsx.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/jsx.js deleted file mode 100644 index fc8e9071..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/jsx.js +++ /dev/null @@ -1,161 +0,0 @@ -"use strict"; - -var _utils = require("./utils"); - -(0, _utils.default)("JSXAttribute", { - visitor: ["name", "value"], - aliases: ["JSX", "Immutable"], - fields: { - name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXNamespacedName") - }, - value: { - optional: true, - validate: (0, _utils.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer") - } - } -}); -(0, _utils.default)("JSXClosingElement", { - visitor: ["name"], - aliases: ["JSX", "Immutable"], - fields: { - name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName") - } - } -}); -(0, _utils.default)("JSXElement", { - builder: ["openingElement", "closingElement", "children", "selfClosing"], - visitor: ["openingElement", "children", "closingElement"], - aliases: ["JSX", "Immutable", "Expression"], - fields: { - openingElement: { - validate: (0, _utils.assertNodeType)("JSXOpeningElement") - }, - closingElement: { - optional: true, - validate: (0, _utils.assertNodeType)("JSXClosingElement") - }, - children: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment"))) - }, - selfClosing: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - } - } -}); -(0, _utils.default)("JSXEmptyExpression", { - aliases: ["JSX"] -}); -(0, _utils.default)("JSXExpressionContainer", { - visitor: ["expression"], - aliases: ["JSX", "Immutable"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression") - } - } -}); -(0, _utils.default)("JSXSpreadChild", { - visitor: ["expression"], - aliases: ["JSX", "Immutable"], - fields: { - expression: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("JSXIdentifier", { - builder: ["name"], - aliases: ["JSX"], - fields: { - name: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("JSXMemberExpression", { - visitor: ["object", "property"], - aliases: ["JSX"], - fields: { - object: { - validate: (0, _utils.assertNodeType)("JSXMemberExpression", "JSXIdentifier") - }, - property: { - validate: (0, _utils.assertNodeType)("JSXIdentifier") - } - } -}); -(0, _utils.default)("JSXNamespacedName", { - visitor: ["namespace", "name"], - aliases: ["JSX"], - fields: { - namespace: { - validate: (0, _utils.assertNodeType)("JSXIdentifier") - }, - name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier") - } - } -}); -(0, _utils.default)("JSXOpeningElement", { - builder: ["name", "attributes", "selfClosing"], - visitor: ["name", "attributes"], - aliases: ["JSX", "Immutable"], - fields: { - name: { - validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName") - }, - selfClosing: { - default: false - }, - attributes: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXAttribute", "JSXSpreadAttribute"))) - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), - optional: true - } - } -}); -(0, _utils.default)("JSXSpreadAttribute", { - visitor: ["argument"], - aliases: ["JSX"], - fields: { - argument: { - validate: (0, _utils.assertNodeType)("Expression") - } - } -}); -(0, _utils.default)("JSXText", { - aliases: ["JSX", "Immutable"], - builder: ["value"], - fields: { - value: { - validate: (0, _utils.assertValueType)("string") - } - } -}); -(0, _utils.default)("JSXFragment", { - builder: ["openingFragment", "closingFragment", "children"], - visitor: ["openingFragment", "children", "closingFragment"], - aliases: ["JSX", "Immutable", "Expression"], - fields: { - openingFragment: { - validate: (0, _utils.assertNodeType)("JSXOpeningFragment") - }, - closingFragment: { - validate: (0, _utils.assertNodeType)("JSXClosingFragment") - }, - children: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment"))) - } - } -}); -(0, _utils.default)("JSXOpeningFragment", { - aliases: ["JSX", "Immutable"] -}); -(0, _utils.default)("JSXClosingFragment", { - aliases: ["JSX", "Immutable"] -}); \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/misc.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/misc.js deleted file mode 100644 index d8d79b96..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/misc.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -var _utils = require("./utils"); - -var _placeholders = require("./placeholders"); - -{ - (0, _utils.default)("Noop", { - visitor: [] - }); -} -(0, _utils.default)("Placeholder", { - visitor: [], - builder: ["expectedNode", "name"], - fields: { - name: { - validate: (0, _utils.assertNodeType)("Identifier") - }, - expectedNode: { - validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS) - } - } -}); -(0, _utils.default)("V8IntrinsicIdentifier", { - builder: ["name"], - fields: { - name: { - validate: (0, _utils.assertValueType)("string") - } - } -}); \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/placeholders.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/placeholders.js deleted file mode 100644 index 7277239a..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/placeholders.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS = void 0; - -var _utils = require("./utils"); - -const PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"]; -exports.PLACEHOLDERS = PLACEHOLDERS; -const PLACEHOLDERS_ALIAS = { - Declaration: ["Statement"], - Pattern: ["PatternLike", "LVal"] -}; -exports.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS; - -for (const type of PLACEHOLDERS) { - const alias = _utils.ALIAS_KEYS[type]; - if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias; -} - -const PLACEHOLDERS_FLIPPED_ALIAS = {}; -exports.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS; -Object.keys(PLACEHOLDERS_ALIAS).forEach(type => { - PLACEHOLDERS_ALIAS[type].forEach(alias => { - if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) { - PLACEHOLDERS_FLIPPED_ALIAS[alias] = []; - } - - PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type); - }); -}); \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/typescript.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/typescript.js deleted file mode 100644 index 7abbf046..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/typescript.js +++ /dev/null @@ -1,469 +0,0 @@ -"use strict"; - -var _utils = require("./utils"); - -var _core = require("./core"); - -var _is = require("../validators/is"); - -const bool = (0, _utils.assertValueType)("boolean"); -const tSFunctionTypeAnnotationCommon = { - returnType: { - validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"), - optional: true - }, - typeParameters: { - validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"), - optional: true - } -}; -(0, _utils.default)("TSParameterProperty", { - aliases: ["LVal"], - visitor: ["parameter"], - fields: { - accessibility: { - validate: (0, _utils.assertOneOf)("public", "private", "protected"), - optional: true - }, - readonly: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - parameter: { - validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern") - }, - override: { - validate: (0, _utils.assertValueType)("boolean"), - optional: true - }, - decorators: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))), - optional: true - } - } -}); -(0, _utils.default)("TSDeclareFunction", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "typeParameters", "params", "returnType"], - fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon) -}); -(0, _utils.default)("TSDeclareMethod", { - visitor: ["decorators", "key", "typeParameters", "params", "returnType"], - fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon) -}); -(0, _utils.default)("TSQualifiedName", { - aliases: ["TSEntityName"], - visitor: ["left", "right"], - fields: { - left: (0, _utils.validateType)("TSEntityName"), - right: (0, _utils.validateType)("Identifier") - } -}); -const signatureDeclarationCommon = { - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), - parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]), - typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation") -}; -const callConstructSignatureDeclaration = { - aliases: ["TSTypeElement"], - visitor: ["typeParameters", "parameters", "typeAnnotation"], - fields: signatureDeclarationCommon -}; -(0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration); -(0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration); -const namedTypeElementCommon = { - key: (0, _utils.validateType)("Expression"), - computed: (0, _utils.validate)(bool), - optional: (0, _utils.validateOptional)(bool) -}; -(0, _utils.default)("TSPropertySignature", { - aliases: ["TSTypeElement"], - visitor: ["key", "typeAnnotation", "initializer"], - fields: Object.assign({}, namedTypeElementCommon, { - readonly: (0, _utils.validateOptional)(bool), - typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"), - initializer: (0, _utils.validateOptionalType)("Expression"), - kind: { - validate: (0, _utils.assertOneOf)("get", "set") - } - }) -}); -(0, _utils.default)("TSMethodSignature", { - aliases: ["TSTypeElement"], - visitor: ["key", "typeParameters", "parameters", "typeAnnotation"], - fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon, { - kind: { - validate: (0, _utils.assertOneOf)("method", "get", "set") - } - }) -}); -(0, _utils.default)("TSIndexSignature", { - aliases: ["TSTypeElement"], - visitor: ["parameters", "typeAnnotation"], - fields: { - readonly: (0, _utils.validateOptional)(bool), - static: (0, _utils.validateOptional)(bool), - parameters: (0, _utils.validateArrayOfType)("Identifier"), - typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation") - } -}); -const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"]; - -for (const type of tsKeywordTypes) { - (0, _utils.default)(type, { - aliases: ["TSType", "TSBaseType"], - visitor: [], - fields: {} - }); -} - -(0, _utils.default)("TSThisType", { - aliases: ["TSType", "TSBaseType"], - visitor: [], - fields: {} -}); -const fnOrCtrBase = { - aliases: ["TSType"], - visitor: ["typeParameters", "parameters", "typeAnnotation"] -}; -(0, _utils.default)("TSFunctionType", Object.assign({}, fnOrCtrBase, { - fields: signatureDeclarationCommon -})); -(0, _utils.default)("TSConstructorType", Object.assign({}, fnOrCtrBase, { - fields: Object.assign({}, signatureDeclarationCommon, { - abstract: (0, _utils.validateOptional)(bool) - }) -})); -(0, _utils.default)("TSTypeReference", { - aliases: ["TSType"], - visitor: ["typeName", "typeParameters"], - fields: { - typeName: (0, _utils.validateType)("TSEntityName"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") - } -}); -(0, _utils.default)("TSTypePredicate", { - aliases: ["TSType"], - visitor: ["parameterName", "typeAnnotation"], - builder: ["parameterName", "typeAnnotation", "asserts"], - fields: { - parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]), - typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"), - asserts: (0, _utils.validateOptional)(bool) - } -}); -(0, _utils.default)("TSTypeQuery", { - aliases: ["TSType"], - visitor: ["exprName"], - fields: { - exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"]) - } -}); -(0, _utils.default)("TSTypeLiteral", { - aliases: ["TSType"], - visitor: ["members"], - fields: { - members: (0, _utils.validateArrayOfType)("TSTypeElement") - } -}); -(0, _utils.default)("TSArrayType", { - aliases: ["TSType"], - visitor: ["elementType"], - fields: { - elementType: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSTupleType", { - aliases: ["TSType"], - visitor: ["elementTypes"], - fields: { - elementTypes: (0, _utils.validateArrayOfType)(["TSType", "TSNamedTupleMember"]) - } -}); -(0, _utils.default)("TSOptionalType", { - aliases: ["TSType"], - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSRestType", { - aliases: ["TSType"], - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSNamedTupleMember", { - visitor: ["label", "elementType"], - builder: ["label", "elementType", "optional"], - fields: { - label: (0, _utils.validateType)("Identifier"), - optional: { - validate: bool, - default: false - }, - elementType: (0, _utils.validateType)("TSType") - } -}); -const unionOrIntersection = { - aliases: ["TSType"], - visitor: ["types"], - fields: { - types: (0, _utils.validateArrayOfType)("TSType") - } -}; -(0, _utils.default)("TSUnionType", unionOrIntersection); -(0, _utils.default)("TSIntersectionType", unionOrIntersection); -(0, _utils.default)("TSConditionalType", { - aliases: ["TSType"], - visitor: ["checkType", "extendsType", "trueType", "falseType"], - fields: { - checkType: (0, _utils.validateType)("TSType"), - extendsType: (0, _utils.validateType)("TSType"), - trueType: (0, _utils.validateType)("TSType"), - falseType: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSInferType", { - aliases: ["TSType"], - visitor: ["typeParameter"], - fields: { - typeParameter: (0, _utils.validateType)("TSTypeParameter") - } -}); -(0, _utils.default)("TSParenthesizedType", { - aliases: ["TSType"], - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSTypeOperator", { - aliases: ["TSType"], - visitor: ["typeAnnotation"], - fields: { - operator: (0, _utils.validate)((0, _utils.assertValueType)("string")), - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSIndexedAccessType", { - aliases: ["TSType"], - visitor: ["objectType", "indexType"], - fields: { - objectType: (0, _utils.validateType)("TSType"), - indexType: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSMappedType", { - aliases: ["TSType"], - visitor: ["typeParameter", "typeAnnotation", "nameType"], - fields: { - readonly: (0, _utils.validateOptional)(bool), - typeParameter: (0, _utils.validateType)("TSTypeParameter"), - optional: (0, _utils.validateOptional)(bool), - typeAnnotation: (0, _utils.validateOptionalType)("TSType"), - nameType: (0, _utils.validateOptionalType)("TSType") - } -}); -(0, _utils.default)("TSLiteralType", { - aliases: ["TSType", "TSBaseType"], - visitor: ["literal"], - fields: { - literal: { - validate: function () { - const unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral"); - const unaryOperator = (0, _utils.assertOneOf)("-"); - const literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral"); - - function validator(parent, key, node) { - if ((0, _is.default)("UnaryExpression", node)) { - unaryOperator(node, "operator", node.operator); - unaryExpression(node, "argument", node.argument); - } else { - literal(parent, key, node); - } - } - - validator.oneOfNodeTypes = ["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "UnaryExpression"]; - return validator; - }() - } - } -}); -(0, _utils.default)("TSExpressionWithTypeArguments", { - aliases: ["TSType"], - visitor: ["expression", "typeParameters"], - fields: { - expression: (0, _utils.validateType)("TSEntityName"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") - } -}); -(0, _utils.default)("TSInterfaceDeclaration", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "typeParameters", "extends", "body"], - fields: { - declare: (0, _utils.validateOptional)(bool), - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), - extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")), - body: (0, _utils.validateType)("TSInterfaceBody") - } -}); -(0, _utils.default)("TSInterfaceBody", { - visitor: ["body"], - fields: { - body: (0, _utils.validateArrayOfType)("TSTypeElement") - } -}); -(0, _utils.default)("TSTypeAliasDeclaration", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "typeParameters", "typeAnnotation"], - fields: { - declare: (0, _utils.validateOptional)(bool), - id: (0, _utils.validateType)("Identifier"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSAsExpression", { - aliases: ["Expression"], - visitor: ["expression", "typeAnnotation"], - fields: { - expression: (0, _utils.validateType)("Expression"), - typeAnnotation: (0, _utils.validateType)("TSType") - } -}); -(0, _utils.default)("TSTypeAssertion", { - aliases: ["Expression"], - visitor: ["typeAnnotation", "expression"], - fields: { - typeAnnotation: (0, _utils.validateType)("TSType"), - expression: (0, _utils.validateType)("Expression") - } -}); -(0, _utils.default)("TSEnumDeclaration", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "members"], - fields: { - declare: (0, _utils.validateOptional)(bool), - const: (0, _utils.validateOptional)(bool), - id: (0, _utils.validateType)("Identifier"), - members: (0, _utils.validateArrayOfType)("TSEnumMember"), - initializer: (0, _utils.validateOptionalType)("Expression") - } -}); -(0, _utils.default)("TSEnumMember", { - visitor: ["id", "initializer"], - fields: { - id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), - initializer: (0, _utils.validateOptionalType)("Expression") - } -}); -(0, _utils.default)("TSModuleDeclaration", { - aliases: ["Statement", "Declaration"], - visitor: ["id", "body"], - fields: { - declare: (0, _utils.validateOptional)(bool), - global: (0, _utils.validateOptional)(bool), - id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), - body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"]) - } -}); -(0, _utils.default)("TSModuleBlock", { - aliases: ["Scopable", "Block", "BlockParent"], - visitor: ["body"], - fields: { - body: (0, _utils.validateArrayOfType)("Statement") - } -}); -(0, _utils.default)("TSImportType", { - aliases: ["TSType"], - visitor: ["argument", "qualifier", "typeParameters"], - fields: { - argument: (0, _utils.validateType)("StringLiteral"), - qualifier: (0, _utils.validateOptionalType)("TSEntityName"), - typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") - } -}); -(0, _utils.default)("TSImportEqualsDeclaration", { - aliases: ["Statement"], - visitor: ["id", "moduleReference"], - fields: { - isExport: (0, _utils.validate)(bool), - id: (0, _utils.validateType)("Identifier"), - moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"]), - importKind: { - validate: (0, _utils.assertOneOf)("type", "value"), - optional: true - } - } -}); -(0, _utils.default)("TSExternalModuleReference", { - visitor: ["expression"], - fields: { - expression: (0, _utils.validateType)("StringLiteral") - } -}); -(0, _utils.default)("TSNonNullExpression", { - aliases: ["Expression"], - visitor: ["expression"], - fields: { - expression: (0, _utils.validateType)("Expression") - } -}); -(0, _utils.default)("TSExportAssignment", { - aliases: ["Statement"], - visitor: ["expression"], - fields: { - expression: (0, _utils.validateType)("Expression") - } -}); -(0, _utils.default)("TSNamespaceExportDeclaration", { - aliases: ["Statement"], - visitor: ["id"], - fields: { - id: (0, _utils.validateType)("Identifier") - } -}); -(0, _utils.default)("TSTypeAnnotation", { - visitor: ["typeAnnotation"], - fields: { - typeAnnotation: { - validate: (0, _utils.assertNodeType)("TSType") - } - } -}); -(0, _utils.default)("TSTypeParameterInstantiation", { - visitor: ["params"], - fields: { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType"))) - } - } -}); -(0, _utils.default)("TSTypeParameterDeclaration", { - visitor: ["params"], - fields: { - params: { - validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter"))) - } - } -}); -(0, _utils.default)("TSTypeParameter", { - builder: ["constraint", "default", "name"], - visitor: ["constraint", "default"], - fields: { - name: { - validate: (0, _utils.assertValueType)("string") - }, - constraint: { - validate: (0, _utils.assertNodeType)("TSType"), - optional: true - }, - default: { - validate: (0, _utils.assertNodeType)("TSType"), - optional: true - } - } -}); \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/utils.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/utils.js deleted file mode 100644 index 2acdae53..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/definitions/utils.js +++ /dev/null @@ -1,324 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.validate = validate; -exports.typeIs = typeIs; -exports.validateType = validateType; -exports.validateOptional = validateOptional; -exports.validateOptionalType = validateOptionalType; -exports.arrayOf = arrayOf; -exports.arrayOfType = arrayOfType; -exports.validateArrayOfType = validateArrayOfType; -exports.assertEach = assertEach; -exports.assertOneOf = assertOneOf; -exports.assertNodeType = assertNodeType; -exports.assertNodeOrValueType = assertNodeOrValueType; -exports.assertValueType = assertValueType; -exports.assertShape = assertShape; -exports.assertOptionalChainStart = assertOptionalChainStart; -exports.chain = chain; -exports.default = defineType; -exports.NODE_PARENT_VALIDATIONS = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0; - -var _is = require("../validators/is"); - -var _validate = require("../validators/validate"); - -const VISITOR_KEYS = {}; -exports.VISITOR_KEYS = VISITOR_KEYS; -const ALIAS_KEYS = {}; -exports.ALIAS_KEYS = ALIAS_KEYS; -const FLIPPED_ALIAS_KEYS = {}; -exports.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS; -const NODE_FIELDS = {}; -exports.NODE_FIELDS = NODE_FIELDS; -const BUILDER_KEYS = {}; -exports.BUILDER_KEYS = BUILDER_KEYS; -const DEPRECATED_KEYS = {}; -exports.DEPRECATED_KEYS = DEPRECATED_KEYS; -const NODE_PARENT_VALIDATIONS = {}; -exports.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS; - -function getType(val) { - if (Array.isArray(val)) { - return "array"; - } else if (val === null) { - return "null"; - } else { - return typeof val; - } -} - -function validate(validate) { - return { - validate - }; -} - -function typeIs(typeName) { - return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName); -} - -function validateType(typeName) { - return validate(typeIs(typeName)); -} - -function validateOptional(validate) { - return { - validate, - optional: true - }; -} - -function validateOptionalType(typeName) { - return { - validate: typeIs(typeName), - optional: true - }; -} - -function arrayOf(elementType) { - return chain(assertValueType("array"), assertEach(elementType)); -} - -function arrayOfType(typeName) { - return arrayOf(typeIs(typeName)); -} - -function validateArrayOfType(typeName) { - return validate(arrayOfType(typeName)); -} - -function assertEach(callback) { - function validator(node, key, val) { - if (!Array.isArray(val)) return; - - for (let i = 0; i < val.length; i++) { - const subkey = `${key}[${i}]`; - const v = val[i]; - callback(node, subkey, v); - if (process.env.BABEL_TYPES_8_BREAKING) (0, _validate.validateChild)(node, subkey, v); - } - } - - validator.each = callback; - return validator; -} - -function assertOneOf(...values) { - function validate(node, key, val) { - if (values.indexOf(val) < 0) { - throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`); - } - } - - validate.oneOf = values; - return validate; -} - -function assertNodeType(...types) { - function validate(node, key, val) { - for (const type of types) { - if ((0, _is.default)(type, val)) { - (0, _validate.validateChild)(node, key, val); - return; - } - } - - throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`); - } - - validate.oneOfNodeTypes = types; - return validate; -} - -function assertNodeOrValueType(...types) { - function validate(node, key, val) { - for (const type of types) { - if (getType(val) === type || (0, _is.default)(type, val)) { - (0, _validate.validateChild)(node, key, val); - return; - } - } - - throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`); - } - - validate.oneOfNodeOrValueTypes = types; - return validate; -} - -function assertValueType(type) { - function validate(node, key, val) { - const valid = getType(val) === type; - - if (!valid) { - throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`); - } - } - - validate.type = type; - return validate; -} - -function assertShape(shape) { - function validate(node, key, val) { - const errors = []; - - for (const property of Object.keys(shape)) { - try { - (0, _validate.validateField)(node, property, val[property], shape[property]); - } catch (error) { - if (error instanceof TypeError) { - errors.push(error.message); - continue; - } - - throw error; - } - } - - if (errors.length) { - throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`); - } - } - - validate.shapeOf = shape; - return validate; -} - -function assertOptionalChainStart() { - function validate(node) { - var _current; - - let current = node; - - while (node) { - const { - type - } = current; - - if (type === "OptionalCallExpression") { - if (current.optional) return; - current = current.callee; - continue; - } - - if (type === "OptionalMemberExpression") { - if (current.optional) return; - current = current.object; - continue; - } - - break; - } - - throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`); - } - - return validate; -} - -function chain(...fns) { - function validate(...args) { - for (const fn of fns) { - fn(...args); - } - } - - validate.chainOf = fns; - - if (fns.length >= 2 && "type" in fns[0] && fns[0].type === "array" && !("each" in fns[1])) { - throw new Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`); - } - - return validate; -} - -const validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"]; -const validFieldKeys = ["default", "optional", "validate"]; - -function defineType(type, opts = {}) { - const inherits = opts.inherits && store[opts.inherits] || {}; - let fields = opts.fields; - - if (!fields) { - fields = {}; - - if (inherits.fields) { - const keys = Object.getOwnPropertyNames(inherits.fields); - - for (const key of keys) { - const field = inherits.fields[key]; - const def = field.default; - - if (Array.isArray(def) ? def.length > 0 : def && typeof def === "object") { - throw new Error("field defaults can only be primitives or empty arrays currently"); - } - - fields[key] = { - default: Array.isArray(def) ? [] : def, - optional: field.optional, - validate: field.validate - }; - } - } - } - - const visitor = opts.visitor || inherits.visitor || []; - const aliases = opts.aliases || inherits.aliases || []; - const builder = opts.builder || inherits.builder || opts.visitor || []; - - for (const k of Object.keys(opts)) { - if (validTypeOpts.indexOf(k) === -1) { - throw new Error(`Unknown type option "${k}" on ${type}`); - } - } - - if (opts.deprecatedAlias) { - DEPRECATED_KEYS[opts.deprecatedAlias] = type; - } - - for (const key of visitor.concat(builder)) { - fields[key] = fields[key] || {}; - } - - for (const key of Object.keys(fields)) { - const field = fields[key]; - - if (field.default !== undefined && builder.indexOf(key) === -1) { - field.optional = true; - } - - if (field.default === undefined) { - field.default = null; - } else if (!field.validate && field.default != null) { - field.validate = assertValueType(getType(field.default)); - } - - for (const k of Object.keys(field)) { - if (validFieldKeys.indexOf(k) === -1) { - throw new Error(`Unknown field key "${k}" on ${type}.${key}`); - } - } - } - - VISITOR_KEYS[type] = opts.visitor = visitor; - BUILDER_KEYS[type] = opts.builder = builder; - NODE_FIELDS[type] = opts.fields = fields; - ALIAS_KEYS[type] = opts.aliases = aliases; - aliases.forEach(alias => { - FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || []; - FLIPPED_ALIAS_KEYS[alias].push(type); - }); - - if (opts.validate) { - NODE_PARENT_VALIDATIONS[type] = opts.validate; - } - - store[type] = opts; -} - -const store = {}; \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index-legacy.d.ts b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index-legacy.d.ts deleted file mode 100644 index 9d679fc5..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index-legacy.d.ts +++ /dev/null @@ -1,2679 +0,0 @@ -// NOTE: This file is autogenerated. Do not modify. -// See packages/babel-types/scripts/generators/typescript-legacy.js for script used. - -interface BaseComment { - value: string; - start: number; - end: number; - loc: SourceLocation; - type: "CommentBlock" | "CommentLine"; -} - -export interface CommentBlock extends BaseComment { - type: "CommentBlock"; -} - -export interface CommentLine extends BaseComment { - type: "CommentLine"; -} - -export type Comment = CommentBlock | CommentLine; - -export interface SourceLocation { - start: { - line: number; - column: number; - }; - - end: { - line: number; - column: number; - }; -} - -interface BaseNode { - leadingComments: ReadonlyArray | null; - innerComments: ReadonlyArray | null; - trailingComments: ReadonlyArray | null; - start: number | null; - end: number | null; - loc: SourceLocation | null; - type: Node["type"]; - extra?: Record; -} - -export type Node = AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | CompletionStatement | Conditional | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | Declaration | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBody | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | Expression | ExpressionStatement | ExpressionWrapper | File | Flow | FlowBaseAnnotation | FlowDeclaration | FlowPredicate | FlowType | For | ForInStatement | ForOfStatement | ForStatement | ForXStatement | Function | FunctionDeclaration | FunctionExpression | FunctionParent | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Immutable | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSX | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LVal | LabeledStatement | Literal | LogicalExpression | Loop | MemberExpression | MetaProperty | Method | MixedTypeAnnotation | ModuleDeclaration | ModuleExpression | ModuleSpecifier | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMember | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | Pattern | PatternLike | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | Private | PrivateName | Program | Property | Pureish | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral | RestElement | RestProperty | ReturnStatement | Scopable | SequenceExpression | SpreadElement | SpreadProperty | Statement | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBaseType | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEntityName | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeElement | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | Terminatorless | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression; - -export interface ArrayExpression extends BaseNode { - type: "ArrayExpression"; - elements: Array; -} - -export interface AssignmentExpression extends BaseNode { - type: "AssignmentExpression"; - operator: string; - left: LVal; - right: Expression; -} - -export interface BinaryExpression extends BaseNode { - type: "BinaryExpression"; - operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<="; - left: Expression | PrivateName; - right: Expression; -} - -export interface InterpreterDirective extends BaseNode { - type: "InterpreterDirective"; - value: string; -} - -export interface Directive extends BaseNode { - type: "Directive"; - value: DirectiveLiteral; -} - -export interface DirectiveLiteral extends BaseNode { - type: "DirectiveLiteral"; - value: string; -} - -export interface BlockStatement extends BaseNode { - type: "BlockStatement"; - body: Array; - directives: Array; -} - -export interface BreakStatement extends BaseNode { - type: "BreakStatement"; - label: Identifier | null; -} - -export interface CallExpression extends BaseNode { - type: "CallExpression"; - callee: Expression | V8IntrinsicIdentifier; - arguments: Array; - optional: true | false | null; - typeArguments: TypeParameterInstantiation | null; - typeParameters: TSTypeParameterInstantiation | null; -} - -export interface CatchClause extends BaseNode { - type: "CatchClause"; - param: Identifier | ArrayPattern | ObjectPattern | null; - body: BlockStatement; -} - -export interface ConditionalExpression extends BaseNode { - type: "ConditionalExpression"; - test: Expression; - consequent: Expression; - alternate: Expression; -} - -export interface ContinueStatement extends BaseNode { - type: "ContinueStatement"; - label: Identifier | null; -} - -export interface DebuggerStatement extends BaseNode { - type: "DebuggerStatement"; -} - -export interface DoWhileStatement extends BaseNode { - type: "DoWhileStatement"; - test: Expression; - body: Statement; -} - -export interface EmptyStatement extends BaseNode { - type: "EmptyStatement"; -} - -export interface ExpressionStatement extends BaseNode { - type: "ExpressionStatement"; - expression: Expression; -} - -export interface File extends BaseNode { - type: "File"; - program: Program; - comments: Array | null; - tokens: Array | null; -} - -export interface ForInStatement extends BaseNode { - type: "ForInStatement"; - left: VariableDeclaration | LVal; - right: Expression; - body: Statement; -} - -export interface ForStatement extends BaseNode { - type: "ForStatement"; - init: VariableDeclaration | Expression | null; - test: Expression | null; - update: Expression | null; - body: Statement; -} - -export interface FunctionDeclaration extends BaseNode { - type: "FunctionDeclaration"; - id: Identifier | null; - params: Array; - body: BlockStatement; - generator: boolean; - async: boolean; - declare: boolean | null; - returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} - -export interface FunctionExpression extends BaseNode { - type: "FunctionExpression"; - id: Identifier | null; - params: Array; - body: BlockStatement; - generator: boolean; - async: boolean; - returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} - -export interface Identifier extends BaseNode { - type: "Identifier"; - name: string; - decorators: Array | null; - optional: boolean | null; - typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; -} - -export interface IfStatement extends BaseNode { - type: "IfStatement"; - test: Expression; - consequent: Statement; - alternate: Statement | null; -} - -export interface LabeledStatement extends BaseNode { - type: "LabeledStatement"; - label: Identifier; - body: Statement; -} - -export interface StringLiteral extends BaseNode { - type: "StringLiteral"; - value: string; -} - -export interface NumericLiteral extends BaseNode { - type: "NumericLiteral"; - value: number; -} - -export interface NullLiteral extends BaseNode { - type: "NullLiteral"; -} - -export interface BooleanLiteral extends BaseNode { - type: "BooleanLiteral"; - value: boolean; -} - -export interface RegExpLiteral extends BaseNode { - type: "RegExpLiteral"; - pattern: string; - flags: string; -} - -export interface LogicalExpression extends BaseNode { - type: "LogicalExpression"; - operator: "||" | "&&" | "??"; - left: Expression; - right: Expression; -} - -export interface MemberExpression extends BaseNode { - type: "MemberExpression"; - object: Expression; - property: Expression | Identifier | PrivateName; - computed: boolean; - optional: true | false | null; -} - -export interface NewExpression extends BaseNode { - type: "NewExpression"; - callee: Expression | V8IntrinsicIdentifier; - arguments: Array; - optional: true | false | null; - typeArguments: TypeParameterInstantiation | null; - typeParameters: TSTypeParameterInstantiation | null; -} - -export interface Program extends BaseNode { - type: "Program"; - body: Array; - directives: Array; - sourceType: "script" | "module"; - interpreter: InterpreterDirective | null; - sourceFile: string; -} - -export interface ObjectExpression extends BaseNode { - type: "ObjectExpression"; - properties: Array; -} - -export interface ObjectMethod extends BaseNode { - type: "ObjectMethod"; - kind: "method" | "get" | "set"; - key: Expression | Identifier | StringLiteral | NumericLiteral; - params: Array; - body: BlockStatement; - computed: boolean; - generator: boolean; - async: boolean; - decorators: Array | null; - returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} - -export interface ObjectProperty extends BaseNode { - type: "ObjectProperty"; - key: Expression | Identifier | StringLiteral | NumericLiteral; - value: Expression | PatternLike; - computed: boolean; - shorthand: boolean; - decorators: Array | null; -} - -export interface RestElement extends BaseNode { - type: "RestElement"; - argument: LVal; - decorators: Array | null; - optional: boolean | null; - typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; -} - -export interface ReturnStatement extends BaseNode { - type: "ReturnStatement"; - argument: Expression | null; -} - -export interface SequenceExpression extends BaseNode { - type: "SequenceExpression"; - expressions: Array; -} - -export interface ParenthesizedExpression extends BaseNode { - type: "ParenthesizedExpression"; - expression: Expression; -} - -export interface SwitchCase extends BaseNode { - type: "SwitchCase"; - test: Expression | null; - consequent: Array; -} - -export interface SwitchStatement extends BaseNode { - type: "SwitchStatement"; - discriminant: Expression; - cases: Array; -} - -export interface ThisExpression extends BaseNode { - type: "ThisExpression"; -} - -export interface ThrowStatement extends BaseNode { - type: "ThrowStatement"; - argument: Expression; -} - -export interface TryStatement extends BaseNode { - type: "TryStatement"; - block: BlockStatement; - handler: CatchClause | null; - finalizer: BlockStatement | null; -} - -export interface UnaryExpression extends BaseNode { - type: "UnaryExpression"; - operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof"; - argument: Expression; - prefix: boolean; -} - -export interface UpdateExpression extends BaseNode { - type: "UpdateExpression"; - operator: "++" | "--"; - argument: Expression; - prefix: boolean; -} - -export interface VariableDeclaration extends BaseNode { - type: "VariableDeclaration"; - kind: "var" | "let" | "const"; - declarations: Array; - declare: boolean | null; -} - -export interface VariableDeclarator extends BaseNode { - type: "VariableDeclarator"; - id: LVal; - init: Expression | null; - definite: boolean | null; -} - -export interface WhileStatement extends BaseNode { - type: "WhileStatement"; - test: Expression; - body: Statement; -} - -export interface WithStatement extends BaseNode { - type: "WithStatement"; - object: Expression; - body: Statement; -} - -export interface AssignmentPattern extends BaseNode { - type: "AssignmentPattern"; - left: Identifier | ObjectPattern | ArrayPattern | MemberExpression; - right: Expression; - decorators: Array | null; - typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; -} - -export interface ArrayPattern extends BaseNode { - type: "ArrayPattern"; - elements: Array; - decorators: Array | null; - optional: boolean | null; - typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; -} - -export interface ArrowFunctionExpression extends BaseNode { - type: "ArrowFunctionExpression"; - params: Array; - body: BlockStatement | Expression; - async: boolean; - expression: boolean; - generator: boolean; - returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} - -export interface ClassBody extends BaseNode { - type: "ClassBody"; - body: Array; -} - -export interface ClassExpression extends BaseNode { - type: "ClassExpression"; - id: Identifier | null; - superClass: Expression | null; - body: ClassBody; - decorators: Array | null; - implements: Array | null; - mixins: InterfaceExtends | null; - superTypeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation | null; - typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} - -export interface ClassDeclaration extends BaseNode { - type: "ClassDeclaration"; - id: Identifier; - superClass: Expression | null; - body: ClassBody; - decorators: Array | null; - abstract: boolean | null; - declare: boolean | null; - implements: Array | null; - mixins: InterfaceExtends | null; - superTypeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation | null; - typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} - -export interface ExportAllDeclaration extends BaseNode { - type: "ExportAllDeclaration"; - source: StringLiteral; - assertions: Array | null; - exportKind: "type" | "value" | null; -} - -export interface ExportDefaultDeclaration extends BaseNode { - type: "ExportDefaultDeclaration"; - declaration: FunctionDeclaration | TSDeclareFunction | ClassDeclaration | Expression; - exportKind: "value" | null; -} - -export interface ExportNamedDeclaration extends BaseNode { - type: "ExportNamedDeclaration"; - declaration: Declaration | null; - specifiers: Array; - source: StringLiteral | null; - assertions: Array | null; - exportKind: "type" | "value" | null; -} - -export interface ExportSpecifier extends BaseNode { - type: "ExportSpecifier"; - local: Identifier; - exported: Identifier | StringLiteral; -} - -export interface ForOfStatement extends BaseNode { - type: "ForOfStatement"; - left: VariableDeclaration | LVal; - right: Expression; - body: Statement; - await: boolean; -} - -export interface ImportDeclaration extends BaseNode { - type: "ImportDeclaration"; - specifiers: Array; - source: StringLiteral; - assertions: Array | null; - importKind: "type" | "typeof" | "value" | null; -} - -export interface ImportDefaultSpecifier extends BaseNode { - type: "ImportDefaultSpecifier"; - local: Identifier; -} - -export interface ImportNamespaceSpecifier extends BaseNode { - type: "ImportNamespaceSpecifier"; - local: Identifier; -} - -export interface ImportSpecifier extends BaseNode { - type: "ImportSpecifier"; - local: Identifier; - imported: Identifier | StringLiteral; - importKind: "type" | "typeof" | null; -} - -export interface MetaProperty extends BaseNode { - type: "MetaProperty"; - meta: Identifier; - property: Identifier; -} - -export interface ClassMethod extends BaseNode { - type: "ClassMethod"; - kind: "get" | "set" | "method" | "constructor"; - key: Identifier | StringLiteral | NumericLiteral | Expression; - params: Array; - body: BlockStatement; - computed: boolean; - static: boolean; - generator: boolean; - async: boolean; - abstract: boolean | null; - access: "public" | "private" | "protected" | null; - accessibility: "public" | "private" | "protected" | null; - decorators: Array | null; - optional: boolean | null; - override: boolean; - returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} - -export interface ObjectPattern extends BaseNode { - type: "ObjectPattern"; - properties: Array; - decorators: Array | null; - typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; -} - -export interface SpreadElement extends BaseNode { - type: "SpreadElement"; - argument: Expression; -} - -export interface Super extends BaseNode { - type: "Super"; -} - -export interface TaggedTemplateExpression extends BaseNode { - type: "TaggedTemplateExpression"; - tag: Expression; - quasi: TemplateLiteral; - typeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation | null; -} - -export interface TemplateElement extends BaseNode { - type: "TemplateElement"; - value: { raw: string, cooked?: string }; - tail: boolean; -} - -export interface TemplateLiteral extends BaseNode { - type: "TemplateLiteral"; - quasis: Array; - expressions: Array; -} - -export interface YieldExpression extends BaseNode { - type: "YieldExpression"; - argument: Expression | null; - delegate: boolean; -} - -export interface AwaitExpression extends BaseNode { - type: "AwaitExpression"; - argument: Expression; -} - -export interface Import extends BaseNode { - type: "Import"; -} - -export interface BigIntLiteral extends BaseNode { - type: "BigIntLiteral"; - value: string; -} - -export interface ExportNamespaceSpecifier extends BaseNode { - type: "ExportNamespaceSpecifier"; - exported: Identifier; -} - -export interface OptionalMemberExpression extends BaseNode { - type: "OptionalMemberExpression"; - object: Expression; - property: Expression | Identifier; - computed: boolean; - optional: boolean; -} - -export interface OptionalCallExpression extends BaseNode { - type: "OptionalCallExpression"; - callee: Expression; - arguments: Array; - optional: boolean; - typeArguments: TypeParameterInstantiation | null; - typeParameters: TSTypeParameterInstantiation | null; -} - -export interface ClassProperty extends BaseNode { - type: "ClassProperty"; - key: Identifier | StringLiteral | NumericLiteral | Expression; - value: Expression | null; - typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; - decorators: Array | null; - computed: boolean; - static: boolean; - abstract: boolean | null; - accessibility: "public" | "private" | "protected" | null; - declare: boolean | null; - definite: boolean | null; - optional: boolean | null; - override: boolean; - readonly: boolean | null; - variance: Variance | null; -} - -export interface ClassPrivateProperty extends BaseNode { - type: "ClassPrivateProperty"; - key: PrivateName; - value: Expression | null; - decorators: Array | null; - static: any; - definite: boolean | null; - readonly: boolean | null; - typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null; - variance: Variance | null; -} - -export interface ClassPrivateMethod extends BaseNode { - type: "ClassPrivateMethod"; - kind: "get" | "set" | "method" | "constructor"; - key: PrivateName; - params: Array; - body: BlockStatement; - static: boolean; - abstract: boolean | null; - access: "public" | "private" | "protected" | null; - accessibility: "public" | "private" | "protected" | null; - async: boolean; - computed: boolean; - decorators: Array | null; - generator: boolean; - optional: boolean | null; - override: boolean; - returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} - -export interface PrivateName extends BaseNode { - type: "PrivateName"; - id: Identifier; -} - -export interface AnyTypeAnnotation extends BaseNode { - type: "AnyTypeAnnotation"; -} - -export interface ArrayTypeAnnotation extends BaseNode { - type: "ArrayTypeAnnotation"; - elementType: FlowType; -} - -export interface BooleanTypeAnnotation extends BaseNode { - type: "BooleanTypeAnnotation"; -} - -export interface BooleanLiteralTypeAnnotation extends BaseNode { - type: "BooleanLiteralTypeAnnotation"; - value: boolean; -} - -export interface NullLiteralTypeAnnotation extends BaseNode { - type: "NullLiteralTypeAnnotation"; -} - -export interface ClassImplements extends BaseNode { - type: "ClassImplements"; - id: Identifier; - typeParameters: TypeParameterInstantiation | null; -} - -export interface DeclareClass extends BaseNode { - type: "DeclareClass"; - id: Identifier; - typeParameters: TypeParameterDeclaration | null; - extends: Array | null; - body: ObjectTypeAnnotation; - implements: Array | null; - mixins: Array | null; -} - -export interface DeclareFunction extends BaseNode { - type: "DeclareFunction"; - id: Identifier; - predicate: DeclaredPredicate | null; -} - -export interface DeclareInterface extends BaseNode { - type: "DeclareInterface"; - id: Identifier; - typeParameters: TypeParameterDeclaration | null; - extends: Array | null; - body: ObjectTypeAnnotation; - implements: Array | null; - mixins: Array | null; -} - -export interface DeclareModule extends BaseNode { - type: "DeclareModule"; - id: Identifier | StringLiteral; - body: BlockStatement; - kind: "CommonJS" | "ES" | null; -} - -export interface DeclareModuleExports extends BaseNode { - type: "DeclareModuleExports"; - typeAnnotation: TypeAnnotation; -} - -export interface DeclareTypeAlias extends BaseNode { - type: "DeclareTypeAlias"; - id: Identifier; - typeParameters: TypeParameterDeclaration | null; - right: FlowType; -} - -export interface DeclareOpaqueType extends BaseNode { - type: "DeclareOpaqueType"; - id: Identifier; - typeParameters: TypeParameterDeclaration | null; - supertype: FlowType | null; - impltype: FlowType | null; -} - -export interface DeclareVariable extends BaseNode { - type: "DeclareVariable"; - id: Identifier; -} - -export interface DeclareExportDeclaration extends BaseNode { - type: "DeclareExportDeclaration"; - declaration: Flow | null; - specifiers: Array | null; - source: StringLiteral | null; - default: boolean | null; -} - -export interface DeclareExportAllDeclaration extends BaseNode { - type: "DeclareExportAllDeclaration"; - source: StringLiteral; - exportKind: "type" | "value" | null; -} - -export interface DeclaredPredicate extends BaseNode { - type: "DeclaredPredicate"; - value: Flow; -} - -export interface ExistsTypeAnnotation extends BaseNode { - type: "ExistsTypeAnnotation"; -} - -export interface FunctionTypeAnnotation extends BaseNode { - type: "FunctionTypeAnnotation"; - typeParameters: TypeParameterDeclaration | null; - params: Array; - rest: FunctionTypeParam | null; - returnType: FlowType; - this: FunctionTypeParam | null; -} - -export interface FunctionTypeParam extends BaseNode { - type: "FunctionTypeParam"; - name: Identifier | null; - typeAnnotation: FlowType; - optional: boolean | null; -} - -export interface GenericTypeAnnotation extends BaseNode { - type: "GenericTypeAnnotation"; - id: Identifier | QualifiedTypeIdentifier; - typeParameters: TypeParameterInstantiation | null; -} - -export interface InferredPredicate extends BaseNode { - type: "InferredPredicate"; -} - -export interface InterfaceExtends extends BaseNode { - type: "InterfaceExtends"; - id: Identifier | QualifiedTypeIdentifier; - typeParameters: TypeParameterInstantiation | null; -} - -export interface InterfaceDeclaration extends BaseNode { - type: "InterfaceDeclaration"; - id: Identifier; - typeParameters: TypeParameterDeclaration | null; - extends: Array | null; - body: ObjectTypeAnnotation; - implements: Array | null; - mixins: Array | null; -} - -export interface InterfaceTypeAnnotation extends BaseNode { - type: "InterfaceTypeAnnotation"; - extends: Array | null; - body: ObjectTypeAnnotation; -} - -export interface IntersectionTypeAnnotation extends BaseNode { - type: "IntersectionTypeAnnotation"; - types: Array; -} - -export interface MixedTypeAnnotation extends BaseNode { - type: "MixedTypeAnnotation"; -} - -export interface EmptyTypeAnnotation extends BaseNode { - type: "EmptyTypeAnnotation"; -} - -export interface NullableTypeAnnotation extends BaseNode { - type: "NullableTypeAnnotation"; - typeAnnotation: FlowType; -} - -export interface NumberLiteralTypeAnnotation extends BaseNode { - type: "NumberLiteralTypeAnnotation"; - value: number; -} - -export interface NumberTypeAnnotation extends BaseNode { - type: "NumberTypeAnnotation"; -} - -export interface ObjectTypeAnnotation extends BaseNode { - type: "ObjectTypeAnnotation"; - properties: Array; - indexers: Array | null; - callProperties: Array | null; - internalSlots: Array | null; - exact: boolean; - inexact: boolean | null; -} - -export interface ObjectTypeInternalSlot extends BaseNode { - type: "ObjectTypeInternalSlot"; - id: Identifier; - value: FlowType; - optional: boolean; - static: boolean; - method: boolean; -} - -export interface ObjectTypeCallProperty extends BaseNode { - type: "ObjectTypeCallProperty"; - value: FlowType; - static: boolean; -} - -export interface ObjectTypeIndexer extends BaseNode { - type: "ObjectTypeIndexer"; - id: Identifier | null; - key: FlowType; - value: FlowType; - variance: Variance | null; - static: boolean; -} - -export interface ObjectTypeProperty extends BaseNode { - type: "ObjectTypeProperty"; - key: Identifier | StringLiteral; - value: FlowType; - variance: Variance | null; - kind: "init" | "get" | "set"; - method: boolean; - optional: boolean; - proto: boolean; - static: boolean; -} - -export interface ObjectTypeSpreadProperty extends BaseNode { - type: "ObjectTypeSpreadProperty"; - argument: FlowType; -} - -export interface OpaqueType extends BaseNode { - type: "OpaqueType"; - id: Identifier; - typeParameters: TypeParameterDeclaration | null; - supertype: FlowType | null; - impltype: FlowType; -} - -export interface QualifiedTypeIdentifier extends BaseNode { - type: "QualifiedTypeIdentifier"; - id: Identifier; - qualification: Identifier | QualifiedTypeIdentifier; -} - -export interface StringLiteralTypeAnnotation extends BaseNode { - type: "StringLiteralTypeAnnotation"; - value: string; -} - -export interface StringTypeAnnotation extends BaseNode { - type: "StringTypeAnnotation"; -} - -export interface SymbolTypeAnnotation extends BaseNode { - type: "SymbolTypeAnnotation"; -} - -export interface ThisTypeAnnotation extends BaseNode { - type: "ThisTypeAnnotation"; -} - -export interface TupleTypeAnnotation extends BaseNode { - type: "TupleTypeAnnotation"; - types: Array; -} - -export interface TypeofTypeAnnotation extends BaseNode { - type: "TypeofTypeAnnotation"; - argument: FlowType; -} - -export interface TypeAlias extends BaseNode { - type: "TypeAlias"; - id: Identifier; - typeParameters: TypeParameterDeclaration | null; - right: FlowType; -} - -export interface TypeAnnotation extends BaseNode { - type: "TypeAnnotation"; - typeAnnotation: FlowType; -} - -export interface TypeCastExpression extends BaseNode { - type: "TypeCastExpression"; - expression: Expression; - typeAnnotation: TypeAnnotation; -} - -export interface TypeParameter extends BaseNode { - type: "TypeParameter"; - bound: TypeAnnotation | null; - default: FlowType | null; - variance: Variance | null; - name: string; -} - -export interface TypeParameterDeclaration extends BaseNode { - type: "TypeParameterDeclaration"; - params: Array; -} - -export interface TypeParameterInstantiation extends BaseNode { - type: "TypeParameterInstantiation"; - params: Array; -} - -export interface UnionTypeAnnotation extends BaseNode { - type: "UnionTypeAnnotation"; - types: Array; -} - -export interface Variance extends BaseNode { - type: "Variance"; - kind: "minus" | "plus"; -} - -export interface VoidTypeAnnotation extends BaseNode { - type: "VoidTypeAnnotation"; -} - -export interface EnumDeclaration extends BaseNode { - type: "EnumDeclaration"; - id: Identifier; - body: EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody; -} - -export interface EnumBooleanBody extends BaseNode { - type: "EnumBooleanBody"; - members: Array; - explicitType: boolean; - hasUnknownMembers: boolean; -} - -export interface EnumNumberBody extends BaseNode { - type: "EnumNumberBody"; - members: Array; - explicitType: boolean; - hasUnknownMembers: boolean; -} - -export interface EnumStringBody extends BaseNode { - type: "EnumStringBody"; - members: Array; - explicitType: boolean; - hasUnknownMembers: boolean; -} - -export interface EnumSymbolBody extends BaseNode { - type: "EnumSymbolBody"; - members: Array; - hasUnknownMembers: boolean; -} - -export interface EnumBooleanMember extends BaseNode { - type: "EnumBooleanMember"; - id: Identifier; - init: BooleanLiteral; -} - -export interface EnumNumberMember extends BaseNode { - type: "EnumNumberMember"; - id: Identifier; - init: NumericLiteral; -} - -export interface EnumStringMember extends BaseNode { - type: "EnumStringMember"; - id: Identifier; - init: StringLiteral; -} - -export interface EnumDefaultedMember extends BaseNode { - type: "EnumDefaultedMember"; - id: Identifier; -} - -export interface IndexedAccessType extends BaseNode { - type: "IndexedAccessType"; - objectType: FlowType; - indexType: FlowType; -} - -export interface OptionalIndexedAccessType extends BaseNode { - type: "OptionalIndexedAccessType"; - objectType: FlowType; - indexType: FlowType; - optional: boolean; -} - -export interface JSXAttribute extends BaseNode { - type: "JSXAttribute"; - name: JSXIdentifier | JSXNamespacedName; - value: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer | null; -} - -export interface JSXClosingElement extends BaseNode { - type: "JSXClosingElement"; - name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName; -} - -export interface JSXElement extends BaseNode { - type: "JSXElement"; - openingElement: JSXOpeningElement; - closingElement: JSXClosingElement | null; - children: Array; - selfClosing: boolean | null; -} - -export interface JSXEmptyExpression extends BaseNode { - type: "JSXEmptyExpression"; -} - -export interface JSXExpressionContainer extends BaseNode { - type: "JSXExpressionContainer"; - expression: Expression | JSXEmptyExpression; -} - -export interface JSXSpreadChild extends BaseNode { - type: "JSXSpreadChild"; - expression: Expression; -} - -export interface JSXIdentifier extends BaseNode { - type: "JSXIdentifier"; - name: string; -} - -export interface JSXMemberExpression extends BaseNode { - type: "JSXMemberExpression"; - object: JSXMemberExpression | JSXIdentifier; - property: JSXIdentifier; -} - -export interface JSXNamespacedName extends BaseNode { - type: "JSXNamespacedName"; - namespace: JSXIdentifier; - name: JSXIdentifier; -} - -export interface JSXOpeningElement extends BaseNode { - type: "JSXOpeningElement"; - name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName; - attributes: Array; - selfClosing: boolean; - typeParameters: TypeParameterInstantiation | TSTypeParameterInstantiation | null; -} - -export interface JSXSpreadAttribute extends BaseNode { - type: "JSXSpreadAttribute"; - argument: Expression; -} - -export interface JSXText extends BaseNode { - type: "JSXText"; - value: string; -} - -export interface JSXFragment extends BaseNode { - type: "JSXFragment"; - openingFragment: JSXOpeningFragment; - closingFragment: JSXClosingFragment; - children: Array; -} - -export interface JSXOpeningFragment extends BaseNode { - type: "JSXOpeningFragment"; -} - -export interface JSXClosingFragment extends BaseNode { - type: "JSXClosingFragment"; -} - -export interface Noop extends BaseNode { - type: "Noop"; -} - -export interface Placeholder extends BaseNode { - type: "Placeholder"; - expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern"; - name: Identifier; -} - -export interface V8IntrinsicIdentifier extends BaseNode { - type: "V8IntrinsicIdentifier"; - name: string; -} - -export interface ArgumentPlaceholder extends BaseNode { - type: "ArgumentPlaceholder"; -} - -export interface BindExpression extends BaseNode { - type: "BindExpression"; - object: Expression; - callee: Expression; -} - -export interface ImportAttribute extends BaseNode { - type: "ImportAttribute"; - key: Identifier | StringLiteral; - value: StringLiteral; -} - -export interface Decorator extends BaseNode { - type: "Decorator"; - expression: Expression; -} - -export interface DoExpression extends BaseNode { - type: "DoExpression"; - body: BlockStatement; - async: boolean; -} - -export interface ExportDefaultSpecifier extends BaseNode { - type: "ExportDefaultSpecifier"; - exported: Identifier; -} - -export interface RecordExpression extends BaseNode { - type: "RecordExpression"; - properties: Array; -} - -export interface TupleExpression extends BaseNode { - type: "TupleExpression"; - elements: Array; -} - -export interface DecimalLiteral extends BaseNode { - type: "DecimalLiteral"; - value: string; -} - -export interface StaticBlock extends BaseNode { - type: "StaticBlock"; - body: Array; -} - -export interface ModuleExpression extends BaseNode { - type: "ModuleExpression"; - body: Program; -} - -export interface TopicReference extends BaseNode { - type: "TopicReference"; -} - -export interface PipelineTopicExpression extends BaseNode { - type: "PipelineTopicExpression"; - expression: Expression; -} - -export interface PipelineBareFunction extends BaseNode { - type: "PipelineBareFunction"; - callee: Expression; -} - -export interface PipelinePrimaryTopicReference extends BaseNode { - type: "PipelinePrimaryTopicReference"; -} - -export interface TSParameterProperty extends BaseNode { - type: "TSParameterProperty"; - parameter: Identifier | AssignmentPattern; - accessibility: "public" | "private" | "protected" | null; - decorators: Array | null; - override: boolean | null; - readonly: boolean | null; -} - -export interface TSDeclareFunction extends BaseNode { - type: "TSDeclareFunction"; - id: Identifier | null; - typeParameters: TSTypeParameterDeclaration | Noop | null; - params: Array; - returnType: TSTypeAnnotation | Noop | null; - async: boolean; - declare: boolean | null; - generator: boolean; -} - -export interface TSDeclareMethod extends BaseNode { - type: "TSDeclareMethod"; - decorators: Array | null; - key: Identifier | StringLiteral | NumericLiteral | Expression; - typeParameters: TSTypeParameterDeclaration | Noop | null; - params: Array; - returnType: TSTypeAnnotation | Noop | null; - abstract: boolean | null; - access: "public" | "private" | "protected" | null; - accessibility: "public" | "private" | "protected" | null; - async: boolean; - computed: boolean; - generator: boolean; - kind: "get" | "set" | "method" | "constructor"; - optional: boolean | null; - override: boolean; - static: boolean; -} - -export interface TSQualifiedName extends BaseNode { - type: "TSQualifiedName"; - left: TSEntityName; - right: Identifier; -} - -export interface TSCallSignatureDeclaration extends BaseNode { - type: "TSCallSignatureDeclaration"; - typeParameters: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation: TSTypeAnnotation | null; -} - -export interface TSConstructSignatureDeclaration extends BaseNode { - type: "TSConstructSignatureDeclaration"; - typeParameters: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation: TSTypeAnnotation | null; -} - -export interface TSPropertySignature extends BaseNode { - type: "TSPropertySignature"; - key: Expression; - typeAnnotation: TSTypeAnnotation | null; - initializer: Expression | null; - computed: boolean | null; - kind: "get" | "set"; - optional: boolean | null; - readonly: boolean | null; -} - -export interface TSMethodSignature extends BaseNode { - type: "TSMethodSignature"; - key: Expression; - typeParameters: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation: TSTypeAnnotation | null; - computed: boolean | null; - kind: "method" | "get" | "set"; - optional: boolean | null; -} - -export interface TSIndexSignature extends BaseNode { - type: "TSIndexSignature"; - parameters: Array; - typeAnnotation: TSTypeAnnotation | null; - readonly: boolean | null; - static: boolean | null; -} - -export interface TSAnyKeyword extends BaseNode { - type: "TSAnyKeyword"; -} - -export interface TSBooleanKeyword extends BaseNode { - type: "TSBooleanKeyword"; -} - -export interface TSBigIntKeyword extends BaseNode { - type: "TSBigIntKeyword"; -} - -export interface TSIntrinsicKeyword extends BaseNode { - type: "TSIntrinsicKeyword"; -} - -export interface TSNeverKeyword extends BaseNode { - type: "TSNeverKeyword"; -} - -export interface TSNullKeyword extends BaseNode { - type: "TSNullKeyword"; -} - -export interface TSNumberKeyword extends BaseNode { - type: "TSNumberKeyword"; -} - -export interface TSObjectKeyword extends BaseNode { - type: "TSObjectKeyword"; -} - -export interface TSStringKeyword extends BaseNode { - type: "TSStringKeyword"; -} - -export interface TSSymbolKeyword extends BaseNode { - type: "TSSymbolKeyword"; -} - -export interface TSUndefinedKeyword extends BaseNode { - type: "TSUndefinedKeyword"; -} - -export interface TSUnknownKeyword extends BaseNode { - type: "TSUnknownKeyword"; -} - -export interface TSVoidKeyword extends BaseNode { - type: "TSVoidKeyword"; -} - -export interface TSThisType extends BaseNode { - type: "TSThisType"; -} - -export interface TSFunctionType extends BaseNode { - type: "TSFunctionType"; - typeParameters: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation: TSTypeAnnotation | null; -} - -export interface TSConstructorType extends BaseNode { - type: "TSConstructorType"; - typeParameters: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation: TSTypeAnnotation | null; - abstract: boolean | null; -} - -export interface TSTypeReference extends BaseNode { - type: "TSTypeReference"; - typeName: TSEntityName; - typeParameters: TSTypeParameterInstantiation | null; -} - -export interface TSTypePredicate extends BaseNode { - type: "TSTypePredicate"; - parameterName: Identifier | TSThisType; - typeAnnotation: TSTypeAnnotation | null; - asserts: boolean | null; -} - -export interface TSTypeQuery extends BaseNode { - type: "TSTypeQuery"; - exprName: TSEntityName | TSImportType; -} - -export interface TSTypeLiteral extends BaseNode { - type: "TSTypeLiteral"; - members: Array; -} - -export interface TSArrayType extends BaseNode { - type: "TSArrayType"; - elementType: TSType; -} - -export interface TSTupleType extends BaseNode { - type: "TSTupleType"; - elementTypes: Array; -} - -export interface TSOptionalType extends BaseNode { - type: "TSOptionalType"; - typeAnnotation: TSType; -} - -export interface TSRestType extends BaseNode { - type: "TSRestType"; - typeAnnotation: TSType; -} - -export interface TSNamedTupleMember extends BaseNode { - type: "TSNamedTupleMember"; - label: Identifier; - elementType: TSType; - optional: boolean; -} - -export interface TSUnionType extends BaseNode { - type: "TSUnionType"; - types: Array; -} - -export interface TSIntersectionType extends BaseNode { - type: "TSIntersectionType"; - types: Array; -} - -export interface TSConditionalType extends BaseNode { - type: "TSConditionalType"; - checkType: TSType; - extendsType: TSType; - trueType: TSType; - falseType: TSType; -} - -export interface TSInferType extends BaseNode { - type: "TSInferType"; - typeParameter: TSTypeParameter; -} - -export interface TSParenthesizedType extends BaseNode { - type: "TSParenthesizedType"; - typeAnnotation: TSType; -} - -export interface TSTypeOperator extends BaseNode { - type: "TSTypeOperator"; - typeAnnotation: TSType; - operator: string; -} - -export interface TSIndexedAccessType extends BaseNode { - type: "TSIndexedAccessType"; - objectType: TSType; - indexType: TSType; -} - -export interface TSMappedType extends BaseNode { - type: "TSMappedType"; - typeParameter: TSTypeParameter; - typeAnnotation: TSType | null; - nameType: TSType | null; - optional: boolean | null; - readonly: boolean | null; -} - -export interface TSLiteralType extends BaseNode { - type: "TSLiteralType"; - literal: NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | UnaryExpression; -} - -export interface TSExpressionWithTypeArguments extends BaseNode { - type: "TSExpressionWithTypeArguments"; - expression: TSEntityName; - typeParameters: TSTypeParameterInstantiation | null; -} - -export interface TSInterfaceDeclaration extends BaseNode { - type: "TSInterfaceDeclaration"; - id: Identifier; - typeParameters: TSTypeParameterDeclaration | null; - extends: Array | null; - body: TSInterfaceBody; - declare: boolean | null; -} - -export interface TSInterfaceBody extends BaseNode { - type: "TSInterfaceBody"; - body: Array; -} - -export interface TSTypeAliasDeclaration extends BaseNode { - type: "TSTypeAliasDeclaration"; - id: Identifier; - typeParameters: TSTypeParameterDeclaration | null; - typeAnnotation: TSType; - declare: boolean | null; -} - -export interface TSAsExpression extends BaseNode { - type: "TSAsExpression"; - expression: Expression; - typeAnnotation: TSType; -} - -export interface TSTypeAssertion extends BaseNode { - type: "TSTypeAssertion"; - typeAnnotation: TSType; - expression: Expression; -} - -export interface TSEnumDeclaration extends BaseNode { - type: "TSEnumDeclaration"; - id: Identifier; - members: Array; - const: boolean | null; - declare: boolean | null; - initializer: Expression | null; -} - -export interface TSEnumMember extends BaseNode { - type: "TSEnumMember"; - id: Identifier | StringLiteral; - initializer: Expression | null; -} - -export interface TSModuleDeclaration extends BaseNode { - type: "TSModuleDeclaration"; - id: Identifier | StringLiteral; - body: TSModuleBlock | TSModuleDeclaration; - declare: boolean | null; - global: boolean | null; -} - -export interface TSModuleBlock extends BaseNode { - type: "TSModuleBlock"; - body: Array; -} - -export interface TSImportType extends BaseNode { - type: "TSImportType"; - argument: StringLiteral; - qualifier: TSEntityName | null; - typeParameters: TSTypeParameterInstantiation | null; -} - -export interface TSImportEqualsDeclaration extends BaseNode { - type: "TSImportEqualsDeclaration"; - id: Identifier; - moduleReference: TSEntityName | TSExternalModuleReference; - importKind: "type" | "value" | null; - isExport: boolean; -} - -export interface TSExternalModuleReference extends BaseNode { - type: "TSExternalModuleReference"; - expression: StringLiteral; -} - -export interface TSNonNullExpression extends BaseNode { - type: "TSNonNullExpression"; - expression: Expression; -} - -export interface TSExportAssignment extends BaseNode { - type: "TSExportAssignment"; - expression: Expression; -} - -export interface TSNamespaceExportDeclaration extends BaseNode { - type: "TSNamespaceExportDeclaration"; - id: Identifier; -} - -export interface TSTypeAnnotation extends BaseNode { - type: "TSTypeAnnotation"; - typeAnnotation: TSType; -} - -export interface TSTypeParameterInstantiation extends BaseNode { - type: "TSTypeParameterInstantiation"; - params: Array; -} - -export interface TSTypeParameterDeclaration extends BaseNode { - type: "TSTypeParameterDeclaration"; - params: Array; -} - -export interface TSTypeParameter extends BaseNode { - type: "TSTypeParameter"; - constraint: TSType | null; - default: TSType | null; - name: string; -} - -/** - * @deprecated Use `NumericLiteral` - */ -export type NumberLiteral = NumericLiteral; - -/** - * @deprecated Use `RegExpLiteral` - */ -export type RegexLiteral = RegExpLiteral; - -/** - * @deprecated Use `RestElement` - */ -export type RestProperty = RestElement; - -/** - * @deprecated Use `SpreadElement` - */ -export type SpreadProperty = SpreadElement; - -export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ParenthesizedExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSAsExpression | TSTypeAssertion | TSNonNullExpression; -export type Binary = BinaryExpression | LogicalExpression; -export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassExpression | ClassDeclaration | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock; -export type BlockParent = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock; -export type Block = BlockStatement | Program | TSModuleBlock; -export type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForStatement | FunctionDeclaration | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSImportEqualsDeclaration | TSExportAssignment | TSNamespaceExportDeclaration; -export type Terminatorless = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement | YieldExpression | AwaitExpression; -export type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement; -export type Conditional = ConditionalExpression | IfStatement; -export type Loop = DoWhileStatement | ForInStatement | ForStatement | WhileStatement | ForOfStatement; -export type While = DoWhileStatement | WhileStatement; -export type ExpressionWrapper = ExpressionStatement | ParenthesizedExpression | TypeCastExpression; -export type For = ForInStatement | ForStatement | ForOfStatement; -export type ForXStatement = ForInStatement | ForOfStatement; -export type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod; -export type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod; -export type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ArrowFunctionExpression | BigIntLiteral | DecimalLiteral; -export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration; -export type PatternLike = Identifier | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern; -export type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern | TSParameterProperty; -export type TSEntityName = Identifier | TSQualifiedName; -export type Literal = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | TemplateLiteral | BigIntLiteral | DecimalLiteral; -export type Immutable = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | BigIntLiteral | JSXAttribute | JSXClosingElement | JSXElement | JSXExpressionContainer | JSXSpreadChild | JSXOpeningElement | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment | DecimalLiteral; -export type UserWhitespacable = ObjectMethod | ObjectProperty | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty; -export type Method = ObjectMethod | ClassMethod | ClassPrivateMethod; -export type ObjectMember = ObjectMethod | ObjectProperty; -export type Property = ObjectProperty | ClassProperty | ClassPrivateProperty; -export type UnaryLike = UnaryExpression | SpreadElement; -export type Pattern = AssignmentPattern | ArrayPattern | ObjectPattern; -export type Class = ClassExpression | ClassDeclaration; -export type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration; -export type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration; -export type ModuleSpecifier = ExportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ExportNamespaceSpecifier | ExportDefaultSpecifier; -export type Private = ClassPrivateProperty | ClassPrivateMethod | PrivateName; -export type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ClassImplements | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | DeclaredPredicate | ExistsTypeAnnotation | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InferredPredicate | InterfaceExtends | InterfaceDeclaration | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | QualifiedTypeIdentifier | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | UnionTypeAnnotation | Variance | VoidTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType; -export type FlowType = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ExistsTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType; -export type FlowBaseAnnotation = AnyTypeAnnotation | BooleanTypeAnnotation | NullLiteralTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NumberTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | VoidTypeAnnotation; -export type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias; -export type FlowPredicate = DeclaredPredicate | InferredPredicate; -export type EnumBody = EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody; -export type EnumMember = EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember; -export type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXSpreadChild | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment; -export type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature; -export type TSType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSLiteralType | TSExpressionWithTypeArguments | TSImportType; -export type TSBaseType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSLiteralType; - -export interface Aliases { - Expression: Expression; - Binary: Binary; - Scopable: Scopable; - BlockParent: BlockParent; - Block: Block; - Statement: Statement; - Terminatorless: Terminatorless; - CompletionStatement: CompletionStatement; - Conditional: Conditional; - Loop: Loop; - While: While; - ExpressionWrapper: ExpressionWrapper; - For: For; - ForXStatement: ForXStatement; - Function: Function; - FunctionParent: FunctionParent; - Pureish: Pureish; - Declaration: Declaration; - PatternLike: PatternLike; - LVal: LVal; - TSEntityName: TSEntityName; - Literal: Literal; - Immutable: Immutable; - UserWhitespacable: UserWhitespacable; - Method: Method; - ObjectMember: ObjectMember; - Property: Property; - UnaryLike: UnaryLike; - Pattern: Pattern; - Class: Class; - ModuleDeclaration: ModuleDeclaration; - ExportDeclaration: ExportDeclaration; - ModuleSpecifier: ModuleSpecifier; - Private: Private; - Flow: Flow; - FlowType: FlowType; - FlowBaseAnnotation: FlowBaseAnnotation; - FlowDeclaration: FlowDeclaration; - FlowPredicate: FlowPredicate; - EnumBody: EnumBody; - EnumMember: EnumMember; - JSX: JSX; - TSTypeElement: TSTypeElement; - TSType: TSType; - TSBaseType: TSBaseType; -} - -export function arrayExpression(elements?: Array): ArrayExpression; -export function assignmentExpression(operator: string, left: LVal, right: Expression): AssignmentExpression; -export function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left: Expression | PrivateName, right: Expression): BinaryExpression; -export function interpreterDirective(value: string): InterpreterDirective; -export function directive(value: DirectiveLiteral): Directive; -export function directiveLiteral(value: string): DirectiveLiteral; -export function blockStatement(body: Array, directives?: Array): BlockStatement; -export function breakStatement(label?: Identifier | null): BreakStatement; -export function callExpression(callee: Expression | V8IntrinsicIdentifier, _arguments: Array): CallExpression; -export function catchClause(param: Identifier | ArrayPattern | ObjectPattern | null | undefined, body: BlockStatement): CatchClause; -export function conditionalExpression(test: Expression, consequent: Expression, alternate: Expression): ConditionalExpression; -export function continueStatement(label?: Identifier | null): ContinueStatement; -export function debuggerStatement(): DebuggerStatement; -export function doWhileStatement(test: Expression, body: Statement): DoWhileStatement; -export function emptyStatement(): EmptyStatement; -export function expressionStatement(expression: Expression): ExpressionStatement; -export function file(program: Program, comments?: Array | null, tokens?: Array | null): File; -export function forInStatement(left: VariableDeclaration | LVal, right: Expression, body: Statement): ForInStatement; -export function forStatement(init: VariableDeclaration | Expression | null | undefined, test: Expression | null | undefined, update: Expression | null | undefined, body: Statement): ForStatement; -export function functionDeclaration(id: Identifier | null | undefined, params: Array, body: BlockStatement, generator?: boolean, async?: boolean): FunctionDeclaration; -export function functionExpression(id: Identifier | null | undefined, params: Array, body: BlockStatement, generator?: boolean, async?: boolean): FunctionExpression; -export function identifier(name: string): Identifier; -export function ifStatement(test: Expression, consequent: Statement, alternate?: Statement | null): IfStatement; -export function labeledStatement(label: Identifier, body: Statement): LabeledStatement; -export function stringLiteral(value: string): StringLiteral; -export function numericLiteral(value: number): NumericLiteral; -export function nullLiteral(): NullLiteral; -export function booleanLiteral(value: boolean): BooleanLiteral; -export function regExpLiteral(pattern: string, flags?: string): RegExpLiteral; -export function logicalExpression(operator: "||" | "&&" | "??", left: Expression, right: Expression): LogicalExpression; -export function memberExpression(object: Expression, property: Expression | Identifier | PrivateName, computed?: boolean, optional?: true | false | null): MemberExpression; -export function newExpression(callee: Expression | V8IntrinsicIdentifier, _arguments: Array): NewExpression; -export function program(body: Array, directives?: Array, sourceType?: "script" | "module", interpreter?: InterpreterDirective | null): Program; -export function objectExpression(properties: Array): ObjectExpression; -export function objectMethod(kind: "method" | "get" | "set" | undefined, key: Expression | Identifier | StringLiteral | NumericLiteral, params: Array, body: BlockStatement, computed?: boolean, generator?: boolean, async?: boolean): ObjectMethod; -export function objectProperty(key: Expression | Identifier | StringLiteral | NumericLiteral, value: Expression | PatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array | null): ObjectProperty; -export function restElement(argument: LVal): RestElement; -export function returnStatement(argument?: Expression | null): ReturnStatement; -export function sequenceExpression(expressions: Array): SequenceExpression; -export function parenthesizedExpression(expression: Expression): ParenthesizedExpression; -export function switchCase(test: Expression | null | undefined, consequent: Array): SwitchCase; -export function switchStatement(discriminant: Expression, cases: Array): SwitchStatement; -export function thisExpression(): ThisExpression; -export function throwStatement(argument: Expression): ThrowStatement; -export function tryStatement(block: BlockStatement, handler?: CatchClause | null, finalizer?: BlockStatement | null): TryStatement; -export function unaryExpression(operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof", argument: Expression, prefix?: boolean): UnaryExpression; -export function updateExpression(operator: "++" | "--", argument: Expression, prefix?: boolean): UpdateExpression; -export function variableDeclaration(kind: "var" | "let" | "const", declarations: Array): VariableDeclaration; -export function variableDeclarator(id: LVal, init?: Expression | null): VariableDeclarator; -export function whileStatement(test: Expression, body: Statement): WhileStatement; -export function withStatement(object: Expression, body: Statement): WithStatement; -export function assignmentPattern(left: Identifier | ObjectPattern | ArrayPattern | MemberExpression, right: Expression): AssignmentPattern; -export function arrayPattern(elements: Array): ArrayPattern; -export function arrowFunctionExpression(params: Array, body: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression; -export function classBody(body: Array): ClassBody; -export function classExpression(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array | null): ClassExpression; -export function classDeclaration(id: Identifier, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array | null): ClassDeclaration; -export function exportAllDeclaration(source: StringLiteral): ExportAllDeclaration; -export function exportDefaultDeclaration(declaration: FunctionDeclaration | TSDeclareFunction | ClassDeclaration | Expression): ExportDefaultDeclaration; -export function exportNamedDeclaration(declaration?: Declaration | null, specifiers?: Array, source?: StringLiteral | null): ExportNamedDeclaration; -export function exportSpecifier(local: Identifier, exported: Identifier | StringLiteral): ExportSpecifier; -export function forOfStatement(left: VariableDeclaration | LVal, right: Expression, body: Statement, _await?: boolean): ForOfStatement; -export function importDeclaration(specifiers: Array, source: StringLiteral): ImportDeclaration; -export function importDefaultSpecifier(local: Identifier): ImportDefaultSpecifier; -export function importNamespaceSpecifier(local: Identifier): ImportNamespaceSpecifier; -export function importSpecifier(local: Identifier, imported: Identifier | StringLiteral): ImportSpecifier; -export function metaProperty(meta: Identifier, property: Identifier): MetaProperty; -export function classMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: Identifier | StringLiteral | NumericLiteral | Expression, params: Array, body: BlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): ClassMethod; -export function objectPattern(properties: Array): ObjectPattern; -export function spreadElement(argument: Expression): SpreadElement; -declare function _super(): Super; -export { _super as super} -export function taggedTemplateExpression(tag: Expression, quasi: TemplateLiteral): TaggedTemplateExpression; -export function templateElement(value: { raw: string, cooked?: string }, tail?: boolean): TemplateElement; -export function templateLiteral(quasis: Array, expressions: Array): TemplateLiteral; -export function yieldExpression(argument?: Expression | null, delegate?: boolean): YieldExpression; -export function awaitExpression(argument: Expression): AwaitExpression; -declare function _import(): Import; -export { _import as import} -export function bigIntLiteral(value: string): BigIntLiteral; -export function exportNamespaceSpecifier(exported: Identifier): ExportNamespaceSpecifier; -export function optionalMemberExpression(object: Expression, property: Expression | Identifier, computed: boolean | undefined, optional: boolean): OptionalMemberExpression; -export function optionalCallExpression(callee: Expression, _arguments: Array, optional: boolean): OptionalCallExpression; -export function classProperty(key: Identifier | StringLiteral | NumericLiteral | Expression, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Array | null, computed?: boolean, _static?: boolean): ClassProperty; -export function classPrivateProperty(key: PrivateName, value: Expression | null | undefined, decorators: Array | null | undefined, _static: any): ClassPrivateProperty; -export function classPrivateMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: PrivateName, params: Array, body: BlockStatement, _static?: boolean): ClassPrivateMethod; -export function privateName(id: Identifier): PrivateName; -export function anyTypeAnnotation(): AnyTypeAnnotation; -export function arrayTypeAnnotation(elementType: FlowType): ArrayTypeAnnotation; -export function booleanTypeAnnotation(): BooleanTypeAnnotation; -export function booleanLiteralTypeAnnotation(value: boolean): BooleanLiteralTypeAnnotation; -export function nullLiteralTypeAnnotation(): NullLiteralTypeAnnotation; -export function classImplements(id: Identifier, typeParameters?: TypeParameterInstantiation | null): ClassImplements; -export function declareClass(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: ObjectTypeAnnotation): DeclareClass; -export function declareFunction(id: Identifier): DeclareFunction; -export function declareInterface(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: ObjectTypeAnnotation): DeclareInterface; -export function declareModule(id: Identifier | StringLiteral, body: BlockStatement, kind?: "CommonJS" | "ES" | null): DeclareModule; -export function declareModuleExports(typeAnnotation: TypeAnnotation): DeclareModuleExports; -export function declareTypeAlias(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, right: FlowType): DeclareTypeAlias; -export function declareOpaqueType(id: Identifier, typeParameters?: TypeParameterDeclaration | null, supertype?: FlowType | null): DeclareOpaqueType; -export function declareVariable(id: Identifier): DeclareVariable; -export function declareExportDeclaration(declaration?: Flow | null, specifiers?: Array | null, source?: StringLiteral | null): DeclareExportDeclaration; -export function declareExportAllDeclaration(source: StringLiteral): DeclareExportAllDeclaration; -export function declaredPredicate(value: Flow): DeclaredPredicate; -export function existsTypeAnnotation(): ExistsTypeAnnotation; -export function functionTypeAnnotation(typeParameters: TypeParameterDeclaration | null | undefined, params: Array, rest: FunctionTypeParam | null | undefined, returnType: FlowType): FunctionTypeAnnotation; -export function functionTypeParam(name: Identifier | null | undefined, typeAnnotation: FlowType): FunctionTypeParam; -export function genericTypeAnnotation(id: Identifier | QualifiedTypeIdentifier, typeParameters?: TypeParameterInstantiation | null): GenericTypeAnnotation; -export function inferredPredicate(): InferredPredicate; -export function interfaceExtends(id: Identifier | QualifiedTypeIdentifier, typeParameters?: TypeParameterInstantiation | null): InterfaceExtends; -export function interfaceDeclaration(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: ObjectTypeAnnotation): InterfaceDeclaration; -export function interfaceTypeAnnotation(_extends: Array | null | undefined, body: ObjectTypeAnnotation): InterfaceTypeAnnotation; -export function intersectionTypeAnnotation(types: Array): IntersectionTypeAnnotation; -export function mixedTypeAnnotation(): MixedTypeAnnotation; -export function emptyTypeAnnotation(): EmptyTypeAnnotation; -export function nullableTypeAnnotation(typeAnnotation: FlowType): NullableTypeAnnotation; -export function numberLiteralTypeAnnotation(value: number): NumberLiteralTypeAnnotation; -export function numberTypeAnnotation(): NumberTypeAnnotation; -export function objectTypeAnnotation(properties: Array, indexers?: Array | null, callProperties?: Array | null, internalSlots?: Array | null, exact?: boolean): ObjectTypeAnnotation; -export function objectTypeInternalSlot(id: Identifier, value: FlowType, optional: boolean, _static: boolean, method: boolean): ObjectTypeInternalSlot; -export function objectTypeCallProperty(value: FlowType): ObjectTypeCallProperty; -export function objectTypeIndexer(id: Identifier | null | undefined, key: FlowType, value: FlowType, variance?: Variance | null): ObjectTypeIndexer; -export function objectTypeProperty(key: Identifier | StringLiteral, value: FlowType, variance?: Variance | null): ObjectTypeProperty; -export function objectTypeSpreadProperty(argument: FlowType): ObjectTypeSpreadProperty; -export function opaqueType(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, supertype: FlowType | null | undefined, impltype: FlowType): OpaqueType; -export function qualifiedTypeIdentifier(id: Identifier, qualification: Identifier | QualifiedTypeIdentifier): QualifiedTypeIdentifier; -export function stringLiteralTypeAnnotation(value: string): StringLiteralTypeAnnotation; -export function stringTypeAnnotation(): StringTypeAnnotation; -export function symbolTypeAnnotation(): SymbolTypeAnnotation; -export function thisTypeAnnotation(): ThisTypeAnnotation; -export function tupleTypeAnnotation(types: Array): TupleTypeAnnotation; -export function typeofTypeAnnotation(argument: FlowType): TypeofTypeAnnotation; -export function typeAlias(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, right: FlowType): TypeAlias; -export function typeAnnotation(typeAnnotation: FlowType): TypeAnnotation; -export function typeCastExpression(expression: Expression, typeAnnotation: TypeAnnotation): TypeCastExpression; -export function typeParameter(bound?: TypeAnnotation | null, _default?: FlowType | null, variance?: Variance | null): TypeParameter; -export function typeParameterDeclaration(params: Array): TypeParameterDeclaration; -export function typeParameterInstantiation(params: Array): TypeParameterInstantiation; -export function unionTypeAnnotation(types: Array): UnionTypeAnnotation; -export function variance(kind: "minus" | "plus"): Variance; -export function voidTypeAnnotation(): VoidTypeAnnotation; -export function enumDeclaration(id: Identifier, body: EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody): EnumDeclaration; -export function enumBooleanBody(members: Array): EnumBooleanBody; -export function enumNumberBody(members: Array): EnumNumberBody; -export function enumStringBody(members: Array): EnumStringBody; -export function enumSymbolBody(members: Array): EnumSymbolBody; -export function enumBooleanMember(id: Identifier): EnumBooleanMember; -export function enumNumberMember(id: Identifier, init: NumericLiteral): EnumNumberMember; -export function enumStringMember(id: Identifier, init: StringLiteral): EnumStringMember; -export function enumDefaultedMember(id: Identifier): EnumDefaultedMember; -export function indexedAccessType(objectType: FlowType, indexType: FlowType): IndexedAccessType; -export function optionalIndexedAccessType(objectType: FlowType, indexType: FlowType): OptionalIndexedAccessType; -export function jsxAttribute(name: JSXIdentifier | JSXNamespacedName, value?: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer | null): JSXAttribute; -export function jsxClosingElement(name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName): JSXClosingElement; -export function jsxElement(openingElement: JSXOpeningElement, closingElement: JSXClosingElement | null | undefined, children: Array, selfClosing?: boolean | null): JSXElement; -export function jsxEmptyExpression(): JSXEmptyExpression; -export function jsxExpressionContainer(expression: Expression | JSXEmptyExpression): JSXExpressionContainer; -export function jsxSpreadChild(expression: Expression): JSXSpreadChild; -export function jsxIdentifier(name: string): JSXIdentifier; -export function jsxMemberExpression(object: JSXMemberExpression | JSXIdentifier, property: JSXIdentifier): JSXMemberExpression; -export function jsxNamespacedName(namespace: JSXIdentifier, name: JSXIdentifier): JSXNamespacedName; -export function jsxOpeningElement(name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName, attributes: Array, selfClosing?: boolean): JSXOpeningElement; -export function jsxSpreadAttribute(argument: Expression): JSXSpreadAttribute; -export function jsxText(value: string): JSXText; -export function jsxFragment(openingFragment: JSXOpeningFragment, closingFragment: JSXClosingFragment, children: Array): JSXFragment; -export function jsxOpeningFragment(): JSXOpeningFragment; -export function jsxClosingFragment(): JSXClosingFragment; -export function noop(): Noop; -export function placeholder(expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern", name: Identifier): Placeholder; -export function v8IntrinsicIdentifier(name: string): V8IntrinsicIdentifier; -export function argumentPlaceholder(): ArgumentPlaceholder; -export function bindExpression(object: Expression, callee: Expression): BindExpression; -export function importAttribute(key: Identifier | StringLiteral, value: StringLiteral): ImportAttribute; -export function decorator(expression: Expression): Decorator; -export function doExpression(body: BlockStatement, async?: boolean): DoExpression; -export function exportDefaultSpecifier(exported: Identifier): ExportDefaultSpecifier; -export function recordExpression(properties: Array): RecordExpression; -export function tupleExpression(elements?: Array): TupleExpression; -export function decimalLiteral(value: string): DecimalLiteral; -export function staticBlock(body: Array): StaticBlock; -export function moduleExpression(body: Program): ModuleExpression; -export function topicReference(): TopicReference; -export function pipelineTopicExpression(expression: Expression): PipelineTopicExpression; -export function pipelineBareFunction(callee: Expression): PipelineBareFunction; -export function pipelinePrimaryTopicReference(): PipelinePrimaryTopicReference; -export function tsParameterProperty(parameter: Identifier | AssignmentPattern): TSParameterProperty; -export function tsDeclareFunction(id: Identifier | null | undefined, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array, returnType?: TSTypeAnnotation | Noop | null): TSDeclareFunction; -export function tsDeclareMethod(decorators: Array | null | undefined, key: Identifier | StringLiteral | NumericLiteral | Expression, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array, returnType?: TSTypeAnnotation | Noop | null): TSDeclareMethod; -export function tsQualifiedName(left: TSEntityName, right: Identifier): TSQualifiedName; -export function tsCallSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration; -export function tsConstructSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration; -export function tsPropertySignature(key: Expression, typeAnnotation?: TSTypeAnnotation | null, initializer?: Expression | null): TSPropertySignature; -export function tsMethodSignature(key: Expression, typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSMethodSignature; -export function tsIndexSignature(parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSIndexSignature; -export function tsAnyKeyword(): TSAnyKeyword; -export function tsBooleanKeyword(): TSBooleanKeyword; -export function tsBigIntKeyword(): TSBigIntKeyword; -export function tsIntrinsicKeyword(): TSIntrinsicKeyword; -export function tsNeverKeyword(): TSNeverKeyword; -export function tsNullKeyword(): TSNullKeyword; -export function tsNumberKeyword(): TSNumberKeyword; -export function tsObjectKeyword(): TSObjectKeyword; -export function tsStringKeyword(): TSStringKeyword; -export function tsSymbolKeyword(): TSSymbolKeyword; -export function tsUndefinedKeyword(): TSUndefinedKeyword; -export function tsUnknownKeyword(): TSUnknownKeyword; -export function tsVoidKeyword(): TSVoidKeyword; -export function tsThisType(): TSThisType; -export function tsFunctionType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSFunctionType; -export function tsConstructorType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSConstructorType; -export function tsTypeReference(typeName: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSTypeReference; -export function tsTypePredicate(parameterName: Identifier | TSThisType, typeAnnotation?: TSTypeAnnotation | null, asserts?: boolean | null): TSTypePredicate; -export function tsTypeQuery(exprName: TSEntityName | TSImportType): TSTypeQuery; -export function tsTypeLiteral(members: Array): TSTypeLiteral; -export function tsArrayType(elementType: TSType): TSArrayType; -export function tsTupleType(elementTypes: Array): TSTupleType; -export function tsOptionalType(typeAnnotation: TSType): TSOptionalType; -export function tsRestType(typeAnnotation: TSType): TSRestType; -export function tsNamedTupleMember(label: Identifier, elementType: TSType, optional?: boolean): TSNamedTupleMember; -export function tsUnionType(types: Array): TSUnionType; -export function tsIntersectionType(types: Array): TSIntersectionType; -export function tsConditionalType(checkType: TSType, extendsType: TSType, trueType: TSType, falseType: TSType): TSConditionalType; -export function tsInferType(typeParameter: TSTypeParameter): TSInferType; -export function tsParenthesizedType(typeAnnotation: TSType): TSParenthesizedType; -export function tsTypeOperator(typeAnnotation: TSType): TSTypeOperator; -export function tsIndexedAccessType(objectType: TSType, indexType: TSType): TSIndexedAccessType; -export function tsMappedType(typeParameter: TSTypeParameter, typeAnnotation?: TSType | null, nameType?: TSType | null): TSMappedType; -export function tsLiteralType(literal: NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | UnaryExpression): TSLiteralType; -export function tsExpressionWithTypeArguments(expression: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSExpressionWithTypeArguments; -export function tsInterfaceDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: TSInterfaceBody): TSInterfaceDeclaration; -export function tsInterfaceBody(body: Array): TSInterfaceBody; -export function tsTypeAliasDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, typeAnnotation: TSType): TSTypeAliasDeclaration; -export function tsAsExpression(expression: Expression, typeAnnotation: TSType): TSAsExpression; -export function tsTypeAssertion(typeAnnotation: TSType, expression: Expression): TSTypeAssertion; -export function tsEnumDeclaration(id: Identifier, members: Array): TSEnumDeclaration; -export function tsEnumMember(id: Identifier | StringLiteral, initializer?: Expression | null): TSEnumMember; -export function tsModuleDeclaration(id: Identifier | StringLiteral, body: TSModuleBlock | TSModuleDeclaration): TSModuleDeclaration; -export function tsModuleBlock(body: Array): TSModuleBlock; -export function tsImportType(argument: StringLiteral, qualifier?: TSEntityName | null, typeParameters?: TSTypeParameterInstantiation | null): TSImportType; -export function tsImportEqualsDeclaration(id: Identifier, moduleReference: TSEntityName | TSExternalModuleReference): TSImportEqualsDeclaration; -export function tsExternalModuleReference(expression: StringLiteral): TSExternalModuleReference; -export function tsNonNullExpression(expression: Expression): TSNonNullExpression; -export function tsExportAssignment(expression: Expression): TSExportAssignment; -export function tsNamespaceExportDeclaration(id: Identifier): TSNamespaceExportDeclaration; -export function tsTypeAnnotation(typeAnnotation: TSType): TSTypeAnnotation; -export function tsTypeParameterInstantiation(params: Array): TSTypeParameterInstantiation; -export function tsTypeParameterDeclaration(params: Array): TSTypeParameterDeclaration; -export function tsTypeParameter(constraint: TSType | null | undefined, _default: TSType | null | undefined, name: string): TSTypeParameter; -export function isAnyTypeAnnotation(node: object | null | undefined, opts?: object | null): node is AnyTypeAnnotation; -export function assertAnyTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isArgumentPlaceholder(node: object | null | undefined, opts?: object | null): node is ArgumentPlaceholder; -export function assertArgumentPlaceholder(node: object | null | undefined, opts?: object | null): void; -export function isArrayExpression(node: object | null | undefined, opts?: object | null): node is ArrayExpression; -export function assertArrayExpression(node: object | null | undefined, opts?: object | null): void; -export function isArrayPattern(node: object | null | undefined, opts?: object | null): node is ArrayPattern; -export function assertArrayPattern(node: object | null | undefined, opts?: object | null): void; -export function isArrayTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ArrayTypeAnnotation; -export function assertArrayTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isArrowFunctionExpression(node: object | null | undefined, opts?: object | null): node is ArrowFunctionExpression; -export function assertArrowFunctionExpression(node: object | null | undefined, opts?: object | null): void; -export function isAssignmentExpression(node: object | null | undefined, opts?: object | null): node is AssignmentExpression; -export function assertAssignmentExpression(node: object | null | undefined, opts?: object | null): void; -export function isAssignmentPattern(node: object | null | undefined, opts?: object | null): node is AssignmentPattern; -export function assertAssignmentPattern(node: object | null | undefined, opts?: object | null): void; -export function isAwaitExpression(node: object | null | undefined, opts?: object | null): node is AwaitExpression; -export function assertAwaitExpression(node: object | null | undefined, opts?: object | null): void; -export function isBigIntLiteral(node: object | null | undefined, opts?: object | null): node is BigIntLiteral; -export function assertBigIntLiteral(node: object | null | undefined, opts?: object | null): void; -export function isBinary(node: object | null | undefined, opts?: object | null): node is Binary; -export function assertBinary(node: object | null | undefined, opts?: object | null): void; -export function isBinaryExpression(node: object | null | undefined, opts?: object | null): node is BinaryExpression; -export function assertBinaryExpression(node: object | null | undefined, opts?: object | null): void; -export function isBindExpression(node: object | null | undefined, opts?: object | null): node is BindExpression; -export function assertBindExpression(node: object | null | undefined, opts?: object | null): void; -export function isBlock(node: object | null | undefined, opts?: object | null): node is Block; -export function assertBlock(node: object | null | undefined, opts?: object | null): void; -export function isBlockParent(node: object | null | undefined, opts?: object | null): node is BlockParent; -export function assertBlockParent(node: object | null | undefined, opts?: object | null): void; -export function isBlockStatement(node: object | null | undefined, opts?: object | null): node is BlockStatement; -export function assertBlockStatement(node: object | null | undefined, opts?: object | null): void; -export function isBooleanLiteral(node: object | null | undefined, opts?: object | null): node is BooleanLiteral; -export function assertBooleanLiteral(node: object | null | undefined, opts?: object | null): void; -export function isBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is BooleanLiteralTypeAnnotation; -export function assertBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isBooleanTypeAnnotation(node: object | null | undefined, opts?: object | null): node is BooleanTypeAnnotation; -export function assertBooleanTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isBreakStatement(node: object | null | undefined, opts?: object | null): node is BreakStatement; -export function assertBreakStatement(node: object | null | undefined, opts?: object | null): void; -export function isCallExpression(node: object | null | undefined, opts?: object | null): node is CallExpression; -export function assertCallExpression(node: object | null | undefined, opts?: object | null): void; -export function isCatchClause(node: object | null | undefined, opts?: object | null): node is CatchClause; -export function assertCatchClause(node: object | null | undefined, opts?: object | null): void; -export function isClass(node: object | null | undefined, opts?: object | null): node is Class; -export function assertClass(node: object | null | undefined, opts?: object | null): void; -export function isClassBody(node: object | null | undefined, opts?: object | null): node is ClassBody; -export function assertClassBody(node: object | null | undefined, opts?: object | null): void; -export function isClassDeclaration(node: object | null | undefined, opts?: object | null): node is ClassDeclaration; -export function assertClassDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isClassExpression(node: object | null | undefined, opts?: object | null): node is ClassExpression; -export function assertClassExpression(node: object | null | undefined, opts?: object | null): void; -export function isClassImplements(node: object | null | undefined, opts?: object | null): node is ClassImplements; -export function assertClassImplements(node: object | null | undefined, opts?: object | null): void; -export function isClassMethod(node: object | null | undefined, opts?: object | null): node is ClassMethod; -export function assertClassMethod(node: object | null | undefined, opts?: object | null): void; -export function isClassPrivateMethod(node: object | null | undefined, opts?: object | null): node is ClassPrivateMethod; -export function assertClassPrivateMethod(node: object | null | undefined, opts?: object | null): void; -export function isClassPrivateProperty(node: object | null | undefined, opts?: object | null): node is ClassPrivateProperty; -export function assertClassPrivateProperty(node: object | null | undefined, opts?: object | null): void; -export function isClassProperty(node: object | null | undefined, opts?: object | null): node is ClassProperty; -export function assertClassProperty(node: object | null | undefined, opts?: object | null): void; -export function isCompletionStatement(node: object | null | undefined, opts?: object | null): node is CompletionStatement; -export function assertCompletionStatement(node: object | null | undefined, opts?: object | null): void; -export function isConditional(node: object | null | undefined, opts?: object | null): node is Conditional; -export function assertConditional(node: object | null | undefined, opts?: object | null): void; -export function isConditionalExpression(node: object | null | undefined, opts?: object | null): node is ConditionalExpression; -export function assertConditionalExpression(node: object | null | undefined, opts?: object | null): void; -export function isContinueStatement(node: object | null | undefined, opts?: object | null): node is ContinueStatement; -export function assertContinueStatement(node: object | null | undefined, opts?: object | null): void; -export function isDebuggerStatement(node: object | null | undefined, opts?: object | null): node is DebuggerStatement; -export function assertDebuggerStatement(node: object | null | undefined, opts?: object | null): void; -export function isDecimalLiteral(node: object | null | undefined, opts?: object | null): node is DecimalLiteral; -export function assertDecimalLiteral(node: object | null | undefined, opts?: object | null): void; -export function isDeclaration(node: object | null | undefined, opts?: object | null): node is Declaration; -export function assertDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isDeclareClass(node: object | null | undefined, opts?: object | null): node is DeclareClass; -export function assertDeclareClass(node: object | null | undefined, opts?: object | null): void; -export function isDeclareExportAllDeclaration(node: object | null | undefined, opts?: object | null): node is DeclareExportAllDeclaration; -export function assertDeclareExportAllDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isDeclareExportDeclaration(node: object | null | undefined, opts?: object | null): node is DeclareExportDeclaration; -export function assertDeclareExportDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isDeclareFunction(node: object | null | undefined, opts?: object | null): node is DeclareFunction; -export function assertDeclareFunction(node: object | null | undefined, opts?: object | null): void; -export function isDeclareInterface(node: object | null | undefined, opts?: object | null): node is DeclareInterface; -export function assertDeclareInterface(node: object | null | undefined, opts?: object | null): void; -export function isDeclareModule(node: object | null | undefined, opts?: object | null): node is DeclareModule; -export function assertDeclareModule(node: object | null | undefined, opts?: object | null): void; -export function isDeclareModuleExports(node: object | null | undefined, opts?: object | null): node is DeclareModuleExports; -export function assertDeclareModuleExports(node: object | null | undefined, opts?: object | null): void; -export function isDeclareOpaqueType(node: object | null | undefined, opts?: object | null): node is DeclareOpaqueType; -export function assertDeclareOpaqueType(node: object | null | undefined, opts?: object | null): void; -export function isDeclareTypeAlias(node: object | null | undefined, opts?: object | null): node is DeclareTypeAlias; -export function assertDeclareTypeAlias(node: object | null | undefined, opts?: object | null): void; -export function isDeclareVariable(node: object | null | undefined, opts?: object | null): node is DeclareVariable; -export function assertDeclareVariable(node: object | null | undefined, opts?: object | null): void; -export function isDeclaredPredicate(node: object | null | undefined, opts?: object | null): node is DeclaredPredicate; -export function assertDeclaredPredicate(node: object | null | undefined, opts?: object | null): void; -export function isDecorator(node: object | null | undefined, opts?: object | null): node is Decorator; -export function assertDecorator(node: object | null | undefined, opts?: object | null): void; -export function isDirective(node: object | null | undefined, opts?: object | null): node is Directive; -export function assertDirective(node: object | null | undefined, opts?: object | null): void; -export function isDirectiveLiteral(node: object | null | undefined, opts?: object | null): node is DirectiveLiteral; -export function assertDirectiveLiteral(node: object | null | undefined, opts?: object | null): void; -export function isDoExpression(node: object | null | undefined, opts?: object | null): node is DoExpression; -export function assertDoExpression(node: object | null | undefined, opts?: object | null): void; -export function isDoWhileStatement(node: object | null | undefined, opts?: object | null): node is DoWhileStatement; -export function assertDoWhileStatement(node: object | null | undefined, opts?: object | null): void; -export function isEmptyStatement(node: object | null | undefined, opts?: object | null): node is EmptyStatement; -export function assertEmptyStatement(node: object | null | undefined, opts?: object | null): void; -export function isEmptyTypeAnnotation(node: object | null | undefined, opts?: object | null): node is EmptyTypeAnnotation; -export function assertEmptyTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isEnumBody(node: object | null | undefined, opts?: object | null): node is EnumBody; -export function assertEnumBody(node: object | null | undefined, opts?: object | null): void; -export function isEnumBooleanBody(node: object | null | undefined, opts?: object | null): node is EnumBooleanBody; -export function assertEnumBooleanBody(node: object | null | undefined, opts?: object | null): void; -export function isEnumBooleanMember(node: object | null | undefined, opts?: object | null): node is EnumBooleanMember; -export function assertEnumBooleanMember(node: object | null | undefined, opts?: object | null): void; -export function isEnumDeclaration(node: object | null | undefined, opts?: object | null): node is EnumDeclaration; -export function assertEnumDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isEnumDefaultedMember(node: object | null | undefined, opts?: object | null): node is EnumDefaultedMember; -export function assertEnumDefaultedMember(node: object | null | undefined, opts?: object | null): void; -export function isEnumMember(node: object | null | undefined, opts?: object | null): node is EnumMember; -export function assertEnumMember(node: object | null | undefined, opts?: object | null): void; -export function isEnumNumberBody(node: object | null | undefined, opts?: object | null): node is EnumNumberBody; -export function assertEnumNumberBody(node: object | null | undefined, opts?: object | null): void; -export function isEnumNumberMember(node: object | null | undefined, opts?: object | null): node is EnumNumberMember; -export function assertEnumNumberMember(node: object | null | undefined, opts?: object | null): void; -export function isEnumStringBody(node: object | null | undefined, opts?: object | null): node is EnumStringBody; -export function assertEnumStringBody(node: object | null | undefined, opts?: object | null): void; -export function isEnumStringMember(node: object | null | undefined, opts?: object | null): node is EnumStringMember; -export function assertEnumStringMember(node: object | null | undefined, opts?: object | null): void; -export function isEnumSymbolBody(node: object | null | undefined, opts?: object | null): node is EnumSymbolBody; -export function assertEnumSymbolBody(node: object | null | undefined, opts?: object | null): void; -export function isExistsTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ExistsTypeAnnotation; -export function assertExistsTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isExportAllDeclaration(node: object | null | undefined, opts?: object | null): node is ExportAllDeclaration; -export function assertExportAllDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isExportDeclaration(node: object | null | undefined, opts?: object | null): node is ExportDeclaration; -export function assertExportDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isExportDefaultDeclaration(node: object | null | undefined, opts?: object | null): node is ExportDefaultDeclaration; -export function assertExportDefaultDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isExportDefaultSpecifier(node: object | null | undefined, opts?: object | null): node is ExportDefaultSpecifier; -export function assertExportDefaultSpecifier(node: object | null | undefined, opts?: object | null): void; -export function isExportNamedDeclaration(node: object | null | undefined, opts?: object | null): node is ExportNamedDeclaration; -export function assertExportNamedDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isExportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): node is ExportNamespaceSpecifier; -export function assertExportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): void; -export function isExportSpecifier(node: object | null | undefined, opts?: object | null): node is ExportSpecifier; -export function assertExportSpecifier(node: object | null | undefined, opts?: object | null): void; -export function isExpression(node: object | null | undefined, opts?: object | null): node is Expression; -export function assertExpression(node: object | null | undefined, opts?: object | null): void; -export function isExpressionStatement(node: object | null | undefined, opts?: object | null): node is ExpressionStatement; -export function assertExpressionStatement(node: object | null | undefined, opts?: object | null): void; -export function isExpressionWrapper(node: object | null | undefined, opts?: object | null): node is ExpressionWrapper; -export function assertExpressionWrapper(node: object | null | undefined, opts?: object | null): void; -export function isFile(node: object | null | undefined, opts?: object | null): node is File; -export function assertFile(node: object | null | undefined, opts?: object | null): void; -export function isFlow(node: object | null | undefined, opts?: object | null): node is Flow; -export function assertFlow(node: object | null | undefined, opts?: object | null): void; -export function isFlowBaseAnnotation(node: object | null | undefined, opts?: object | null): node is FlowBaseAnnotation; -export function assertFlowBaseAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isFlowDeclaration(node: object | null | undefined, opts?: object | null): node is FlowDeclaration; -export function assertFlowDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isFlowPredicate(node: object | null | undefined, opts?: object | null): node is FlowPredicate; -export function assertFlowPredicate(node: object | null | undefined, opts?: object | null): void; -export function isFlowType(node: object | null | undefined, opts?: object | null): node is FlowType; -export function assertFlowType(node: object | null | undefined, opts?: object | null): void; -export function isFor(node: object | null | undefined, opts?: object | null): node is For; -export function assertFor(node: object | null | undefined, opts?: object | null): void; -export function isForInStatement(node: object | null | undefined, opts?: object | null): node is ForInStatement; -export function assertForInStatement(node: object | null | undefined, opts?: object | null): void; -export function isForOfStatement(node: object | null | undefined, opts?: object | null): node is ForOfStatement; -export function assertForOfStatement(node: object | null | undefined, opts?: object | null): void; -export function isForStatement(node: object | null | undefined, opts?: object | null): node is ForStatement; -export function assertForStatement(node: object | null | undefined, opts?: object | null): void; -export function isForXStatement(node: object | null | undefined, opts?: object | null): node is ForXStatement; -export function assertForXStatement(node: object | null | undefined, opts?: object | null): void; -export function isFunction(node: object | null | undefined, opts?: object | null): node is Function; -export function assertFunction(node: object | null | undefined, opts?: object | null): void; -export function isFunctionDeclaration(node: object | null | undefined, opts?: object | null): node is FunctionDeclaration; -export function assertFunctionDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isFunctionExpression(node: object | null | undefined, opts?: object | null): node is FunctionExpression; -export function assertFunctionExpression(node: object | null | undefined, opts?: object | null): void; -export function isFunctionParent(node: object | null | undefined, opts?: object | null): node is FunctionParent; -export function assertFunctionParent(node: object | null | undefined, opts?: object | null): void; -export function isFunctionTypeAnnotation(node: object | null | undefined, opts?: object | null): node is FunctionTypeAnnotation; -export function assertFunctionTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isFunctionTypeParam(node: object | null | undefined, opts?: object | null): node is FunctionTypeParam; -export function assertFunctionTypeParam(node: object | null | undefined, opts?: object | null): void; -export function isGenericTypeAnnotation(node: object | null | undefined, opts?: object | null): node is GenericTypeAnnotation; -export function assertGenericTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isIdentifier(node: object | null | undefined, opts?: object | null): node is Identifier; -export function assertIdentifier(node: object | null | undefined, opts?: object | null): void; -export function isIfStatement(node: object | null | undefined, opts?: object | null): node is IfStatement; -export function assertIfStatement(node: object | null | undefined, opts?: object | null): void; -export function isImmutable(node: object | null | undefined, opts?: object | null): node is Immutable; -export function assertImmutable(node: object | null | undefined, opts?: object | null): void; -export function isImport(node: object | null | undefined, opts?: object | null): node is Import; -export function assertImport(node: object | null | undefined, opts?: object | null): void; -export function isImportAttribute(node: object | null | undefined, opts?: object | null): node is ImportAttribute; -export function assertImportAttribute(node: object | null | undefined, opts?: object | null): void; -export function isImportDeclaration(node: object | null | undefined, opts?: object | null): node is ImportDeclaration; -export function assertImportDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isImportDefaultSpecifier(node: object | null | undefined, opts?: object | null): node is ImportDefaultSpecifier; -export function assertImportDefaultSpecifier(node: object | null | undefined, opts?: object | null): void; -export function isImportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): node is ImportNamespaceSpecifier; -export function assertImportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): void; -export function isImportSpecifier(node: object | null | undefined, opts?: object | null): node is ImportSpecifier; -export function assertImportSpecifier(node: object | null | undefined, opts?: object | null): void; -export function isIndexedAccessType(node: object | null | undefined, opts?: object | null): node is IndexedAccessType; -export function assertIndexedAccessType(node: object | null | undefined, opts?: object | null): void; -export function isInferredPredicate(node: object | null | undefined, opts?: object | null): node is InferredPredicate; -export function assertInferredPredicate(node: object | null | undefined, opts?: object | null): void; -export function isInterfaceDeclaration(node: object | null | undefined, opts?: object | null): node is InterfaceDeclaration; -export function assertInterfaceDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isInterfaceExtends(node: object | null | undefined, opts?: object | null): node is InterfaceExtends; -export function assertInterfaceExtends(node: object | null | undefined, opts?: object | null): void; -export function isInterfaceTypeAnnotation(node: object | null | undefined, opts?: object | null): node is InterfaceTypeAnnotation; -export function assertInterfaceTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isInterpreterDirective(node: object | null | undefined, opts?: object | null): node is InterpreterDirective; -export function assertInterpreterDirective(node: object | null | undefined, opts?: object | null): void; -export function isIntersectionTypeAnnotation(node: object | null | undefined, opts?: object | null): node is IntersectionTypeAnnotation; -export function assertIntersectionTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isJSX(node: object | null | undefined, opts?: object | null): node is JSX; -export function assertJSX(node: object | null | undefined, opts?: object | null): void; -export function isJSXAttribute(node: object | null | undefined, opts?: object | null): node is JSXAttribute; -export function assertJSXAttribute(node: object | null | undefined, opts?: object | null): void; -export function isJSXClosingElement(node: object | null | undefined, opts?: object | null): node is JSXClosingElement; -export function assertJSXClosingElement(node: object | null | undefined, opts?: object | null): void; -export function isJSXClosingFragment(node: object | null | undefined, opts?: object | null): node is JSXClosingFragment; -export function assertJSXClosingFragment(node: object | null | undefined, opts?: object | null): void; -export function isJSXElement(node: object | null | undefined, opts?: object | null): node is JSXElement; -export function assertJSXElement(node: object | null | undefined, opts?: object | null): void; -export function isJSXEmptyExpression(node: object | null | undefined, opts?: object | null): node is JSXEmptyExpression; -export function assertJSXEmptyExpression(node: object | null | undefined, opts?: object | null): void; -export function isJSXExpressionContainer(node: object | null | undefined, opts?: object | null): node is JSXExpressionContainer; -export function assertJSXExpressionContainer(node: object | null | undefined, opts?: object | null): void; -export function isJSXFragment(node: object | null | undefined, opts?: object | null): node is JSXFragment; -export function assertJSXFragment(node: object | null | undefined, opts?: object | null): void; -export function isJSXIdentifier(node: object | null | undefined, opts?: object | null): node is JSXIdentifier; -export function assertJSXIdentifier(node: object | null | undefined, opts?: object | null): void; -export function isJSXMemberExpression(node: object | null | undefined, opts?: object | null): node is JSXMemberExpression; -export function assertJSXMemberExpression(node: object | null | undefined, opts?: object | null): void; -export function isJSXNamespacedName(node: object | null | undefined, opts?: object | null): node is JSXNamespacedName; -export function assertJSXNamespacedName(node: object | null | undefined, opts?: object | null): void; -export function isJSXOpeningElement(node: object | null | undefined, opts?: object | null): node is JSXOpeningElement; -export function assertJSXOpeningElement(node: object | null | undefined, opts?: object | null): void; -export function isJSXOpeningFragment(node: object | null | undefined, opts?: object | null): node is JSXOpeningFragment; -export function assertJSXOpeningFragment(node: object | null | undefined, opts?: object | null): void; -export function isJSXSpreadAttribute(node: object | null | undefined, opts?: object | null): node is JSXSpreadAttribute; -export function assertJSXSpreadAttribute(node: object | null | undefined, opts?: object | null): void; -export function isJSXSpreadChild(node: object | null | undefined, opts?: object | null): node is JSXSpreadChild; -export function assertJSXSpreadChild(node: object | null | undefined, opts?: object | null): void; -export function isJSXText(node: object | null | undefined, opts?: object | null): node is JSXText; -export function assertJSXText(node: object | null | undefined, opts?: object | null): void; -export function isLVal(node: object | null | undefined, opts?: object | null): node is LVal; -export function assertLVal(node: object | null | undefined, opts?: object | null): void; -export function isLabeledStatement(node: object | null | undefined, opts?: object | null): node is LabeledStatement; -export function assertLabeledStatement(node: object | null | undefined, opts?: object | null): void; -export function isLiteral(node: object | null | undefined, opts?: object | null): node is Literal; -export function assertLiteral(node: object | null | undefined, opts?: object | null): void; -export function isLogicalExpression(node: object | null | undefined, opts?: object | null): node is LogicalExpression; -export function assertLogicalExpression(node: object | null | undefined, opts?: object | null): void; -export function isLoop(node: object | null | undefined, opts?: object | null): node is Loop; -export function assertLoop(node: object | null | undefined, opts?: object | null): void; -export function isMemberExpression(node: object | null | undefined, opts?: object | null): node is MemberExpression; -export function assertMemberExpression(node: object | null | undefined, opts?: object | null): void; -export function isMetaProperty(node: object | null | undefined, opts?: object | null): node is MetaProperty; -export function assertMetaProperty(node: object | null | undefined, opts?: object | null): void; -export function isMethod(node: object | null | undefined, opts?: object | null): node is Method; -export function assertMethod(node: object | null | undefined, opts?: object | null): void; -export function isMixedTypeAnnotation(node: object | null | undefined, opts?: object | null): node is MixedTypeAnnotation; -export function assertMixedTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isModuleDeclaration(node: object | null | undefined, opts?: object | null): node is ModuleDeclaration; -export function assertModuleDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isModuleExpression(node: object | null | undefined, opts?: object | null): node is ModuleExpression; -export function assertModuleExpression(node: object | null | undefined, opts?: object | null): void; -export function isModuleSpecifier(node: object | null | undefined, opts?: object | null): node is ModuleSpecifier; -export function assertModuleSpecifier(node: object | null | undefined, opts?: object | null): void; -export function isNewExpression(node: object | null | undefined, opts?: object | null): node is NewExpression; -export function assertNewExpression(node: object | null | undefined, opts?: object | null): void; -export function isNoop(node: object | null | undefined, opts?: object | null): node is Noop; -export function assertNoop(node: object | null | undefined, opts?: object | null): void; -export function isNullLiteral(node: object | null | undefined, opts?: object | null): node is NullLiteral; -export function assertNullLiteral(node: object | null | undefined, opts?: object | null): void; -export function isNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NullLiteralTypeAnnotation; -export function assertNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isNullableTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NullableTypeAnnotation; -export function assertNullableTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -/** @deprecated Use `isNumericLiteral` */ -export function isNumberLiteral(node: object | null | undefined, opts?: object | null): node is NumericLiteral; -/** @deprecated Use `assertNumericLiteral` */ -export function assertNumberLiteral(node: object | null | undefined, opts?: object | null): void; -export function isNumberLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NumberLiteralTypeAnnotation; -export function assertNumberLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isNumberTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NumberTypeAnnotation; -export function assertNumberTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isNumericLiteral(node: object | null | undefined, opts?: object | null): node is NumericLiteral; -export function assertNumericLiteral(node: object | null | undefined, opts?: object | null): void; -export function isObjectExpression(node: object | null | undefined, opts?: object | null): node is ObjectExpression; -export function assertObjectExpression(node: object | null | undefined, opts?: object | null): void; -export function isObjectMember(node: object | null | undefined, opts?: object | null): node is ObjectMember; -export function assertObjectMember(node: object | null | undefined, opts?: object | null): void; -export function isObjectMethod(node: object | null | undefined, opts?: object | null): node is ObjectMethod; -export function assertObjectMethod(node: object | null | undefined, opts?: object | null): void; -export function isObjectPattern(node: object | null | undefined, opts?: object | null): node is ObjectPattern; -export function assertObjectPattern(node: object | null | undefined, opts?: object | null): void; -export function isObjectProperty(node: object | null | undefined, opts?: object | null): node is ObjectProperty; -export function assertObjectProperty(node: object | null | undefined, opts?: object | null): void; -export function isObjectTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ObjectTypeAnnotation; -export function assertObjectTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isObjectTypeCallProperty(node: object | null | undefined, opts?: object | null): node is ObjectTypeCallProperty; -export function assertObjectTypeCallProperty(node: object | null | undefined, opts?: object | null): void; -export function isObjectTypeIndexer(node: object | null | undefined, opts?: object | null): node is ObjectTypeIndexer; -export function assertObjectTypeIndexer(node: object | null | undefined, opts?: object | null): void; -export function isObjectTypeInternalSlot(node: object | null | undefined, opts?: object | null): node is ObjectTypeInternalSlot; -export function assertObjectTypeInternalSlot(node: object | null | undefined, opts?: object | null): void; -export function isObjectTypeProperty(node: object | null | undefined, opts?: object | null): node is ObjectTypeProperty; -export function assertObjectTypeProperty(node: object | null | undefined, opts?: object | null): void; -export function isObjectTypeSpreadProperty(node: object | null | undefined, opts?: object | null): node is ObjectTypeSpreadProperty; -export function assertObjectTypeSpreadProperty(node: object | null | undefined, opts?: object | null): void; -export function isOpaqueType(node: object | null | undefined, opts?: object | null): node is OpaqueType; -export function assertOpaqueType(node: object | null | undefined, opts?: object | null): void; -export function isOptionalCallExpression(node: object | null | undefined, opts?: object | null): node is OptionalCallExpression; -export function assertOptionalCallExpression(node: object | null | undefined, opts?: object | null): void; -export function isOptionalIndexedAccessType(node: object | null | undefined, opts?: object | null): node is OptionalIndexedAccessType; -export function assertOptionalIndexedAccessType(node: object | null | undefined, opts?: object | null): void; -export function isOptionalMemberExpression(node: object | null | undefined, opts?: object | null): node is OptionalMemberExpression; -export function assertOptionalMemberExpression(node: object | null | undefined, opts?: object | null): void; -export function isParenthesizedExpression(node: object | null | undefined, opts?: object | null): node is ParenthesizedExpression; -export function assertParenthesizedExpression(node: object | null | undefined, opts?: object | null): void; -export function isPattern(node: object | null | undefined, opts?: object | null): node is Pattern; -export function assertPattern(node: object | null | undefined, opts?: object | null): void; -export function isPatternLike(node: object | null | undefined, opts?: object | null): node is PatternLike; -export function assertPatternLike(node: object | null | undefined, opts?: object | null): void; -export function isPipelineBareFunction(node: object | null | undefined, opts?: object | null): node is PipelineBareFunction; -export function assertPipelineBareFunction(node: object | null | undefined, opts?: object | null): void; -export function isPipelinePrimaryTopicReference(node: object | null | undefined, opts?: object | null): node is PipelinePrimaryTopicReference; -export function assertPipelinePrimaryTopicReference(node: object | null | undefined, opts?: object | null): void; -export function isPipelineTopicExpression(node: object | null | undefined, opts?: object | null): node is PipelineTopicExpression; -export function assertPipelineTopicExpression(node: object | null | undefined, opts?: object | null): void; -export function isPlaceholder(node: object | null | undefined, opts?: object | null): node is Placeholder; -export function assertPlaceholder(node: object | null | undefined, opts?: object | null): void; -export function isPrivate(node: object | null | undefined, opts?: object | null): node is Private; -export function assertPrivate(node: object | null | undefined, opts?: object | null): void; -export function isPrivateName(node: object | null | undefined, opts?: object | null): node is PrivateName; -export function assertPrivateName(node: object | null | undefined, opts?: object | null): void; -export function isProgram(node: object | null | undefined, opts?: object | null): node is Program; -export function assertProgram(node: object | null | undefined, opts?: object | null): void; -export function isProperty(node: object | null | undefined, opts?: object | null): node is Property; -export function assertProperty(node: object | null | undefined, opts?: object | null): void; -export function isPureish(node: object | null | undefined, opts?: object | null): node is Pureish; -export function assertPureish(node: object | null | undefined, opts?: object | null): void; -export function isQualifiedTypeIdentifier(node: object | null | undefined, opts?: object | null): node is QualifiedTypeIdentifier; -export function assertQualifiedTypeIdentifier(node: object | null | undefined, opts?: object | null): void; -export function isRecordExpression(node: object | null | undefined, opts?: object | null): node is RecordExpression; -export function assertRecordExpression(node: object | null | undefined, opts?: object | null): void; -export function isRegExpLiteral(node: object | null | undefined, opts?: object | null): node is RegExpLiteral; -export function assertRegExpLiteral(node: object | null | undefined, opts?: object | null): void; -/** @deprecated Use `isRegExpLiteral` */ -export function isRegexLiteral(node: object | null | undefined, opts?: object | null): node is RegExpLiteral; -/** @deprecated Use `assertRegExpLiteral` */ -export function assertRegexLiteral(node: object | null | undefined, opts?: object | null): void; -export function isRestElement(node: object | null | undefined, opts?: object | null): node is RestElement; -export function assertRestElement(node: object | null | undefined, opts?: object | null): void; -/** @deprecated Use `isRestElement` */ -export function isRestProperty(node: object | null | undefined, opts?: object | null): node is RestElement; -/** @deprecated Use `assertRestElement` */ -export function assertRestProperty(node: object | null | undefined, opts?: object | null): void; -export function isReturnStatement(node: object | null | undefined, opts?: object | null): node is ReturnStatement; -export function assertReturnStatement(node: object | null | undefined, opts?: object | null): void; -export function isScopable(node: object | null | undefined, opts?: object | null): node is Scopable; -export function assertScopable(node: object | null | undefined, opts?: object | null): void; -export function isSequenceExpression(node: object | null | undefined, opts?: object | null): node is SequenceExpression; -export function assertSequenceExpression(node: object | null | undefined, opts?: object | null): void; -export function isSpreadElement(node: object | null | undefined, opts?: object | null): node is SpreadElement; -export function assertSpreadElement(node: object | null | undefined, opts?: object | null): void; -/** @deprecated Use `isSpreadElement` */ -export function isSpreadProperty(node: object | null | undefined, opts?: object | null): node is SpreadElement; -/** @deprecated Use `assertSpreadElement` */ -export function assertSpreadProperty(node: object | null | undefined, opts?: object | null): void; -export function isStatement(node: object | null | undefined, opts?: object | null): node is Statement; -export function assertStatement(node: object | null | undefined, opts?: object | null): void; -export function isStaticBlock(node: object | null | undefined, opts?: object | null): node is StaticBlock; -export function assertStaticBlock(node: object | null | undefined, opts?: object | null): void; -export function isStringLiteral(node: object | null | undefined, opts?: object | null): node is StringLiteral; -export function assertStringLiteral(node: object | null | undefined, opts?: object | null): void; -export function isStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is StringLiteralTypeAnnotation; -export function assertStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isStringTypeAnnotation(node: object | null | undefined, opts?: object | null): node is StringTypeAnnotation; -export function assertStringTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isSuper(node: object | null | undefined, opts?: object | null): node is Super; -export function assertSuper(node: object | null | undefined, opts?: object | null): void; -export function isSwitchCase(node: object | null | undefined, opts?: object | null): node is SwitchCase; -export function assertSwitchCase(node: object | null | undefined, opts?: object | null): void; -export function isSwitchStatement(node: object | null | undefined, opts?: object | null): node is SwitchStatement; -export function assertSwitchStatement(node: object | null | undefined, opts?: object | null): void; -export function isSymbolTypeAnnotation(node: object | null | undefined, opts?: object | null): node is SymbolTypeAnnotation; -export function assertSymbolTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isTSAnyKeyword(node: object | null | undefined, opts?: object | null): node is TSAnyKeyword; -export function assertTSAnyKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSArrayType(node: object | null | undefined, opts?: object | null): node is TSArrayType; -export function assertTSArrayType(node: object | null | undefined, opts?: object | null): void; -export function isTSAsExpression(node: object | null | undefined, opts?: object | null): node is TSAsExpression; -export function assertTSAsExpression(node: object | null | undefined, opts?: object | null): void; -export function isTSBaseType(node: object | null | undefined, opts?: object | null): node is TSBaseType; -export function assertTSBaseType(node: object | null | undefined, opts?: object | null): void; -export function isTSBigIntKeyword(node: object | null | undefined, opts?: object | null): node is TSBigIntKeyword; -export function assertTSBigIntKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSBooleanKeyword(node: object | null | undefined, opts?: object | null): node is TSBooleanKeyword; -export function assertTSBooleanKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSCallSignatureDeclaration(node: object | null | undefined, opts?: object | null): node is TSCallSignatureDeclaration; -export function assertTSCallSignatureDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTSConditionalType(node: object | null | undefined, opts?: object | null): node is TSConditionalType; -export function assertTSConditionalType(node: object | null | undefined, opts?: object | null): void; -export function isTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object | null): node is TSConstructSignatureDeclaration; -export function assertTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTSConstructorType(node: object | null | undefined, opts?: object | null): node is TSConstructorType; -export function assertTSConstructorType(node: object | null | undefined, opts?: object | null): void; -export function isTSDeclareFunction(node: object | null | undefined, opts?: object | null): node is TSDeclareFunction; -export function assertTSDeclareFunction(node: object | null | undefined, opts?: object | null): void; -export function isTSDeclareMethod(node: object | null | undefined, opts?: object | null): node is TSDeclareMethod; -export function assertTSDeclareMethod(node: object | null | undefined, opts?: object | null): void; -export function isTSEntityName(node: object | null | undefined, opts?: object | null): node is TSEntityName; -export function assertTSEntityName(node: object | null | undefined, opts?: object | null): void; -export function isTSEnumDeclaration(node: object | null | undefined, opts?: object | null): node is TSEnumDeclaration; -export function assertTSEnumDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTSEnumMember(node: object | null | undefined, opts?: object | null): node is TSEnumMember; -export function assertTSEnumMember(node: object | null | undefined, opts?: object | null): void; -export function isTSExportAssignment(node: object | null | undefined, opts?: object | null): node is TSExportAssignment; -export function assertTSExportAssignment(node: object | null | undefined, opts?: object | null): void; -export function isTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object | null): node is TSExpressionWithTypeArguments; -export function assertTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object | null): void; -export function isTSExternalModuleReference(node: object | null | undefined, opts?: object | null): node is TSExternalModuleReference; -export function assertTSExternalModuleReference(node: object | null | undefined, opts?: object | null): void; -export function isTSFunctionType(node: object | null | undefined, opts?: object | null): node is TSFunctionType; -export function assertTSFunctionType(node: object | null | undefined, opts?: object | null): void; -export function isTSImportEqualsDeclaration(node: object | null | undefined, opts?: object | null): node is TSImportEqualsDeclaration; -export function assertTSImportEqualsDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTSImportType(node: object | null | undefined, opts?: object | null): node is TSImportType; -export function assertTSImportType(node: object | null | undefined, opts?: object | null): void; -export function isTSIndexSignature(node: object | null | undefined, opts?: object | null): node is TSIndexSignature; -export function assertTSIndexSignature(node: object | null | undefined, opts?: object | null): void; -export function isTSIndexedAccessType(node: object | null | undefined, opts?: object | null): node is TSIndexedAccessType; -export function assertTSIndexedAccessType(node: object | null | undefined, opts?: object | null): void; -export function isTSInferType(node: object | null | undefined, opts?: object | null): node is TSInferType; -export function assertTSInferType(node: object | null | undefined, opts?: object | null): void; -export function isTSInterfaceBody(node: object | null | undefined, opts?: object | null): node is TSInterfaceBody; -export function assertTSInterfaceBody(node: object | null | undefined, opts?: object | null): void; -export function isTSInterfaceDeclaration(node: object | null | undefined, opts?: object | null): node is TSInterfaceDeclaration; -export function assertTSInterfaceDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTSIntersectionType(node: object | null | undefined, opts?: object | null): node is TSIntersectionType; -export function assertTSIntersectionType(node: object | null | undefined, opts?: object | null): void; -export function isTSIntrinsicKeyword(node: object | null | undefined, opts?: object | null): node is TSIntrinsicKeyword; -export function assertTSIntrinsicKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSLiteralType(node: object | null | undefined, opts?: object | null): node is TSLiteralType; -export function assertTSLiteralType(node: object | null | undefined, opts?: object | null): void; -export function isTSMappedType(node: object | null | undefined, opts?: object | null): node is TSMappedType; -export function assertTSMappedType(node: object | null | undefined, opts?: object | null): void; -export function isTSMethodSignature(node: object | null | undefined, opts?: object | null): node is TSMethodSignature; -export function assertTSMethodSignature(node: object | null | undefined, opts?: object | null): void; -export function isTSModuleBlock(node: object | null | undefined, opts?: object | null): node is TSModuleBlock; -export function assertTSModuleBlock(node: object | null | undefined, opts?: object | null): void; -export function isTSModuleDeclaration(node: object | null | undefined, opts?: object | null): node is TSModuleDeclaration; -export function assertTSModuleDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTSNamedTupleMember(node: object | null | undefined, opts?: object | null): node is TSNamedTupleMember; -export function assertTSNamedTupleMember(node: object | null | undefined, opts?: object | null): void; -export function isTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object | null): node is TSNamespaceExportDeclaration; -export function assertTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTSNeverKeyword(node: object | null | undefined, opts?: object | null): node is TSNeverKeyword; -export function assertTSNeverKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSNonNullExpression(node: object | null | undefined, opts?: object | null): node is TSNonNullExpression; -export function assertTSNonNullExpression(node: object | null | undefined, opts?: object | null): void; -export function isTSNullKeyword(node: object | null | undefined, opts?: object | null): node is TSNullKeyword; -export function assertTSNullKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSNumberKeyword(node: object | null | undefined, opts?: object | null): node is TSNumberKeyword; -export function assertTSNumberKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSObjectKeyword(node: object | null | undefined, opts?: object | null): node is TSObjectKeyword; -export function assertTSObjectKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSOptionalType(node: object | null | undefined, opts?: object | null): node is TSOptionalType; -export function assertTSOptionalType(node: object | null | undefined, opts?: object | null): void; -export function isTSParameterProperty(node: object | null | undefined, opts?: object | null): node is TSParameterProperty; -export function assertTSParameterProperty(node: object | null | undefined, opts?: object | null): void; -export function isTSParenthesizedType(node: object | null | undefined, opts?: object | null): node is TSParenthesizedType; -export function assertTSParenthesizedType(node: object | null | undefined, opts?: object | null): void; -export function isTSPropertySignature(node: object | null | undefined, opts?: object | null): node is TSPropertySignature; -export function assertTSPropertySignature(node: object | null | undefined, opts?: object | null): void; -export function isTSQualifiedName(node: object | null | undefined, opts?: object | null): node is TSQualifiedName; -export function assertTSQualifiedName(node: object | null | undefined, opts?: object | null): void; -export function isTSRestType(node: object | null | undefined, opts?: object | null): node is TSRestType; -export function assertTSRestType(node: object | null | undefined, opts?: object | null): void; -export function isTSStringKeyword(node: object | null | undefined, opts?: object | null): node is TSStringKeyword; -export function assertTSStringKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSSymbolKeyword(node: object | null | undefined, opts?: object | null): node is TSSymbolKeyword; -export function assertTSSymbolKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSThisType(node: object | null | undefined, opts?: object | null): node is TSThisType; -export function assertTSThisType(node: object | null | undefined, opts?: object | null): void; -export function isTSTupleType(node: object | null | undefined, opts?: object | null): node is TSTupleType; -export function assertTSTupleType(node: object | null | undefined, opts?: object | null): void; -export function isTSType(node: object | null | undefined, opts?: object | null): node is TSType; -export function assertTSType(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeAliasDeclaration(node: object | null | undefined, opts?: object | null): node is TSTypeAliasDeclaration; -export function assertTSTypeAliasDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TSTypeAnnotation; -export function assertTSTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeAssertion(node: object | null | undefined, opts?: object | null): node is TSTypeAssertion; -export function assertTSTypeAssertion(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeElement(node: object | null | undefined, opts?: object | null): node is TSTypeElement; -export function assertTSTypeElement(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeLiteral(node: object | null | undefined, opts?: object | null): node is TSTypeLiteral; -export function assertTSTypeLiteral(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeOperator(node: object | null | undefined, opts?: object | null): node is TSTypeOperator; -export function assertTSTypeOperator(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeParameter(node: object | null | undefined, opts?: object | null): node is TSTypeParameter; -export function assertTSTypeParameter(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): node is TSTypeParameterDeclaration; -export function assertTSTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): node is TSTypeParameterInstantiation; -export function assertTSTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): void; -export function isTSTypePredicate(node: object | null | undefined, opts?: object | null): node is TSTypePredicate; -export function assertTSTypePredicate(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeQuery(node: object | null | undefined, opts?: object | null): node is TSTypeQuery; -export function assertTSTypeQuery(node: object | null | undefined, opts?: object | null): void; -export function isTSTypeReference(node: object | null | undefined, opts?: object | null): node is TSTypeReference; -export function assertTSTypeReference(node: object | null | undefined, opts?: object | null): void; -export function isTSUndefinedKeyword(node: object | null | undefined, opts?: object | null): node is TSUndefinedKeyword; -export function assertTSUndefinedKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSUnionType(node: object | null | undefined, opts?: object | null): node is TSUnionType; -export function assertTSUnionType(node: object | null | undefined, opts?: object | null): void; -export function isTSUnknownKeyword(node: object | null | undefined, opts?: object | null): node is TSUnknownKeyword; -export function assertTSUnknownKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTSVoidKeyword(node: object | null | undefined, opts?: object | null): node is TSVoidKeyword; -export function assertTSVoidKeyword(node: object | null | undefined, opts?: object | null): void; -export function isTaggedTemplateExpression(node: object | null | undefined, opts?: object | null): node is TaggedTemplateExpression; -export function assertTaggedTemplateExpression(node: object | null | undefined, opts?: object | null): void; -export function isTemplateElement(node: object | null | undefined, opts?: object | null): node is TemplateElement; -export function assertTemplateElement(node: object | null | undefined, opts?: object | null): void; -export function isTemplateLiteral(node: object | null | undefined, opts?: object | null): node is TemplateLiteral; -export function assertTemplateLiteral(node: object | null | undefined, opts?: object | null): void; -export function isTerminatorless(node: object | null | undefined, opts?: object | null): node is Terminatorless; -export function assertTerminatorless(node: object | null | undefined, opts?: object | null): void; -export function isThisExpression(node: object | null | undefined, opts?: object | null): node is ThisExpression; -export function assertThisExpression(node: object | null | undefined, opts?: object | null): void; -export function isThisTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ThisTypeAnnotation; -export function assertThisTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isThrowStatement(node: object | null | undefined, opts?: object | null): node is ThrowStatement; -export function assertThrowStatement(node: object | null | undefined, opts?: object | null): void; -export function isTopicReference(node: object | null | undefined, opts?: object | null): node is TopicReference; -export function assertTopicReference(node: object | null | undefined, opts?: object | null): void; -export function isTryStatement(node: object | null | undefined, opts?: object | null): node is TryStatement; -export function assertTryStatement(node: object | null | undefined, opts?: object | null): void; -export function isTupleExpression(node: object | null | undefined, opts?: object | null): node is TupleExpression; -export function assertTupleExpression(node: object | null | undefined, opts?: object | null): void; -export function isTupleTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TupleTypeAnnotation; -export function assertTupleTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isTypeAlias(node: object | null | undefined, opts?: object | null): node is TypeAlias; -export function assertTypeAlias(node: object | null | undefined, opts?: object | null): void; -export function isTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TypeAnnotation; -export function assertTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isTypeCastExpression(node: object | null | undefined, opts?: object | null): node is TypeCastExpression; -export function assertTypeCastExpression(node: object | null | undefined, opts?: object | null): void; -export function isTypeParameter(node: object | null | undefined, opts?: object | null): node is TypeParameter; -export function assertTypeParameter(node: object | null | undefined, opts?: object | null): void; -export function isTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): node is TypeParameterDeclaration; -export function assertTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): node is TypeParameterInstantiation; -export function assertTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): void; -export function isTypeofTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TypeofTypeAnnotation; -export function assertTypeofTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isUnaryExpression(node: object | null | undefined, opts?: object | null): node is UnaryExpression; -export function assertUnaryExpression(node: object | null | undefined, opts?: object | null): void; -export function isUnaryLike(node: object | null | undefined, opts?: object | null): node is UnaryLike; -export function assertUnaryLike(node: object | null | undefined, opts?: object | null): void; -export function isUnionTypeAnnotation(node: object | null | undefined, opts?: object | null): node is UnionTypeAnnotation; -export function assertUnionTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isUpdateExpression(node: object | null | undefined, opts?: object | null): node is UpdateExpression; -export function assertUpdateExpression(node: object | null | undefined, opts?: object | null): void; -export function isUserWhitespacable(node: object | null | undefined, opts?: object | null): node is UserWhitespacable; -export function assertUserWhitespacable(node: object | null | undefined, opts?: object | null): void; -export function isV8IntrinsicIdentifier(node: object | null | undefined, opts?: object | null): node is V8IntrinsicIdentifier; -export function assertV8IntrinsicIdentifier(node: object | null | undefined, opts?: object | null): void; -export function isVariableDeclaration(node: object | null | undefined, opts?: object | null): node is VariableDeclaration; -export function assertVariableDeclaration(node: object | null | undefined, opts?: object | null): void; -export function isVariableDeclarator(node: object | null | undefined, opts?: object | null): node is VariableDeclarator; -export function assertVariableDeclarator(node: object | null | undefined, opts?: object | null): void; -export function isVariance(node: object | null | undefined, opts?: object | null): node is Variance; -export function assertVariance(node: object | null | undefined, opts?: object | null): void; -export function isVoidTypeAnnotation(node: object | null | undefined, opts?: object | null): node is VoidTypeAnnotation; -export function assertVoidTypeAnnotation(node: object | null | undefined, opts?: object | null): void; -export function isWhile(node: object | null | undefined, opts?: object | null): node is While; -export function assertWhile(node: object | null | undefined, opts?: object | null): void; -export function isWhileStatement(node: object | null | undefined, opts?: object | null): node is WhileStatement; -export function assertWhileStatement(node: object | null | undefined, opts?: object | null): void; -export function isWithStatement(node: object | null | undefined, opts?: object | null): node is WithStatement; -export function assertWithStatement(node: object | null | undefined, opts?: object | null): void; -export function isYieldExpression(node: object | null | undefined, opts?: object | null): node is YieldExpression; -export function assertYieldExpression(node: object | null | undefined, opts?: object | null): void; -export function assertNode(obj: any): void -export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): StringTypeAnnotation | VoidTypeAnnotation | NumberTypeAnnotation | BooleanTypeAnnotation | GenericTypeAnnotation -export function createUnionTypeAnnotation(types: [T]): T -export function createFlowUnionType(types: [T]): T -export function createUnionTypeAnnotation(types: ReadonlyArray): UnionTypeAnnotation -export function createFlowUnionType(types: ReadonlyArray): UnionTypeAnnotation -export function buildChildren(node: { children: ReadonlyArray }): JSXElement['children'] -export function clone(n: T): T; -export function cloneDeep(n: T): T; -export function cloneDeepWithoutLoc(n: T): T; -export function cloneNode(n: T, deep?: boolean, withoutLoc?: boolean): T; -export function cloneWithoutLoc(n: T): T; -export type CommentTypeShorthand = 'leading' | 'inner' | 'trailing' -export function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T -export function addComments(node: T, type: CommentTypeShorthand, comments: ReadonlyArray): T -export function inheritInnerComments(node: Node, parent: Node): void -export function inheritLeadingComments(node: Node, parent: Node): void -export function inheritsComments(node: T, parent: Node): void -export function inheritTrailingComments(node: Node, parent: Node): void -export function removeComments(node: T): T -export function ensureBlock(node: Extract): BlockStatement -export function ensureBlock = 'body'>(node: Extract>, key: K): BlockStatement -export function toBindingIdentifierName(name: { toString(): string } | null | undefined): string -export function toBlock(node: Statement | Expression, parent?: Function | null): BlockStatement -export function toComputedKey>(node: T, key?: Expression | Identifier): Expression -export function toExpression(node: Function): FunctionExpression -export function toExpression(node: Class): ClassExpression -export function toExpression(node: ExpressionStatement | Expression | Class | Function): Expression -export function toIdentifier(name: { toString(): string } | null | undefined): string -export function toKeyAlias(node: Method | Property, key?: Node): string -export function toSequenceExpression(nodes: ReadonlyArray, scope: { push(value: { id: LVal; kind: 'var'; init?: Expression}): void; buildUndefinedNode(): Node }): SequenceExpression | undefined -export function toStatement(node: AssignmentExpression, ignore?: boolean): ExpressionStatement -export function toStatement(node: Statement | AssignmentExpression, ignore?: boolean): Statement -export function toStatement(node: Class, ignore: true): ClassDeclaration | undefined -export function toStatement(node: Class, ignore?: boolean): ClassDeclaration -export function toStatement(node: Function, ignore: true): FunctionDeclaration | undefined -export function toStatement(node: Function, ignore?: boolean): FunctionDeclaration -export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore: true): Statement | undefined -export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore?: boolean): Statement -export function valueToNode(value: undefined): Identifier -export function valueToNode(value: boolean): BooleanLiteral -export function valueToNode(value: null): NullLiteral -export function valueToNode(value: string): StringLiteral -export function valueToNode(value: number): NumericLiteral | BinaryExpression | UnaryExpression -export function valueToNode(value: RegExp): RegExpLiteral -export function valueToNode(value: ReadonlyArray): ArrayExpression -export function valueToNode(value: object): ObjectExpression -export function valueToNode(value: undefined | boolean | null | string | number | RegExp | object): Expression -export function removeTypeDuplicates(types: ReadonlyArray): FlowType[] -export function appendToMemberExpression>(member: T, append: MemberExpression['property'], computed?: boolean): T -export function inherits(child: T, parent: Node | null | undefined): T -export function prependToMemberExpression>(member: T, prepend: MemberExpression['object']): T -export function removeProperties( - n: Node, - opts?: { preserveComments: boolean } | null -): void; -export function removePropertiesDeep( - n: T, - opts?: { preserveComments: boolean } | null -): T; -export function getBindingIdentifiers(node: Node, duplicates: true, outerOnly?: boolean): Record> -export function getBindingIdentifiers(node: Node, duplicates?: false, outerOnly?: boolean): Record -export function getBindingIdentifiers(node: Node, duplicates: boolean, outerOnly?: boolean): Record> -export function getOuterBindingIdentifiers(node: Node, duplicates: true): Record> -export function getOuterBindingIdentifiers(node: Node, duplicates?: false): Record -export function getOuterBindingIdentifiers(node: Node, duplicates: boolean): Record> -export type TraversalAncestors = ReadonlyArray<{ - node: Node, - key: string, - index?: number, -}>; -export type TraversalHandler = ( - this: undefined, node: Node, parent: TraversalAncestors, type: T -) => void; -export type TraversalHandlers = { - enter?: TraversalHandler, - exit?: TraversalHandler, -}; -export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void; -export function traverseFast(n: Node, h: TraversalHandler, state?: T): void; -export function shallowEqual(actual: object, expected: T): actual is T -export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (node: Node | null | undefined) => node is MemberExpression -export function is(type: T, n: Node | null | undefined, required?: undefined): n is Extract -export function is>(type: T, n: Node | null | undefined, required: Partial

): n is P -export function is

(type: string, n: Node | null | undefined, required: Partial

): n is P -export function is(type: string, n: Node | null | undefined, required?: Partial): n is Node -export function isBinding(node: Node, parent: Node, grandparent?: Node): boolean -export function isBlockScoped(node: Node): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration -export function isImmutable(node: Node): node is Immutable -export function isLet(node: Node): node is VariableDeclaration -export function isNode(node: object | null | undefined): node is Node -export function isNodesEquivalent>(a: T, b: any): b is T -export function isNodesEquivalent(a: any, b: any): boolean -export function isPlaceholderType(placeholderType: Node['type'], targetType: Node['type']): boolean -export function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean -export function isScope(node: Node, parent: Node): node is Scopable -export function isSpecifierDefault(specifier: ModuleSpecifier): boolean -export function isType(nodetype: string, targetType: T): nodetype is T -export function isType(nodetype: string | null | undefined, targetType: string): boolean -export function isValidES3Identifier(name: string): boolean -export function isValidIdentifier(name: string): boolean -export function isVar(node: Node): node is VariableDeclaration -export function matchesPattern(node: Node | null | undefined, match: string | ReadonlyArray, allowPartial?: boolean): node is MemberExpression -export function validate(n: Node | null | undefined, key: K, value: T[K]): void; -export function validate(n: Node, key: string, value: any): void; diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index.d.ts b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index.d.ts deleted file mode 100644 index e00b2ccd..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index.d.ts +++ /dev/null @@ -1,2966 +0,0 @@ -interface BaseComment { - value: string; - start: number; - end: number; - loc: SourceLocation; - type: "CommentBlock" | "CommentLine"; -} -interface CommentBlock extends BaseComment { - type: "CommentBlock"; -} -interface CommentLine extends BaseComment { - type: "CommentLine"; -} -declare type Comment = CommentBlock | CommentLine; -interface SourceLocation { - start: { - line: number; - column: number; - }; - end: { - line: number; - column: number; - }; -} -interface BaseNode { - leadingComments: ReadonlyArray | null; - innerComments: ReadonlyArray | null; - trailingComments: ReadonlyArray | null; - start: number | null; - end: number | null; - loc: SourceLocation | null; - type: Node["type"]; - range?: [number, number]; - extra?: Record; -} -declare type CommentTypeShorthand = "leading" | "inner" | "trailing"; -declare type Node = AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | Binary | BinaryExpression | BindExpression | Block | BlockParent | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | Class | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | CompletionStatement | Conditional | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | Declaration | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBody | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | Expression | ExpressionStatement | ExpressionWrapper | File | Flow | FlowBaseAnnotation | FlowDeclaration | FlowPredicate | FlowType | For | ForInStatement | ForOfStatement | ForStatement | ForXStatement | Function | FunctionDeclaration | FunctionExpression | FunctionParent | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Immutable | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSX | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LVal | LabeledStatement | Literal | LogicalExpression | Loop | MemberExpression | MetaProperty | Method | MixedTypeAnnotation | ModuleDeclaration | ModuleExpression | ModuleSpecifier | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral$1 | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMember | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | Pattern | PatternLike | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | Private | PrivateName | Program | Property | Pureish | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral$1 | RestElement | RestProperty$1 | ReturnStatement | Scopable | SequenceExpression | SpreadElement | SpreadProperty$1 | Statement | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBaseType | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEntityName | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeElement | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | Terminatorless | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeofTypeAnnotation | UnaryExpression | UnaryLike | UnionTypeAnnotation | UpdateExpression | UserWhitespacable | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | While | WhileStatement | WithStatement | YieldExpression; -interface ArrayExpression extends BaseNode { - type: "ArrayExpression"; - elements: Array; -} -interface AssignmentExpression extends BaseNode { - type: "AssignmentExpression"; - operator: string; - left: LVal; - right: Expression; -} -interface BinaryExpression extends BaseNode { - type: "BinaryExpression"; - operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<="; - left: Expression | PrivateName; - right: Expression; -} -interface InterpreterDirective extends BaseNode { - type: "InterpreterDirective"; - value: string; -} -interface Directive extends BaseNode { - type: "Directive"; - value: DirectiveLiteral; -} -interface DirectiveLiteral extends BaseNode { - type: "DirectiveLiteral"; - value: string; -} -interface BlockStatement extends BaseNode { - type: "BlockStatement"; - body: Array; - directives: Array; -} -interface BreakStatement extends BaseNode { - type: "BreakStatement"; - label?: Identifier | null; -} -interface CallExpression extends BaseNode { - type: "CallExpression"; - callee: Expression | V8IntrinsicIdentifier; - arguments: Array; - optional?: true | false | null; - typeArguments?: TypeParameterInstantiation | null; - typeParameters?: TSTypeParameterInstantiation | null; -} -interface CatchClause extends BaseNode { - type: "CatchClause"; - param?: Identifier | ArrayPattern | ObjectPattern | null; - body: BlockStatement; -} -interface ConditionalExpression extends BaseNode { - type: "ConditionalExpression"; - test: Expression; - consequent: Expression; - alternate: Expression; -} -interface ContinueStatement extends BaseNode { - type: "ContinueStatement"; - label?: Identifier | null; -} -interface DebuggerStatement extends BaseNode { - type: "DebuggerStatement"; -} -interface DoWhileStatement extends BaseNode { - type: "DoWhileStatement"; - test: Expression; - body: Statement; -} -interface EmptyStatement extends BaseNode { - type: "EmptyStatement"; -} -interface ExpressionStatement extends BaseNode { - type: "ExpressionStatement"; - expression: Expression; -} -interface File extends BaseNode { - type: "File"; - program: Program; - comments?: Array | null; - tokens?: Array | null; -} -interface ForInStatement extends BaseNode { - type: "ForInStatement"; - left: VariableDeclaration | LVal; - right: Expression; - body: Statement; -} -interface ForStatement extends BaseNode { - type: "ForStatement"; - init?: VariableDeclaration | Expression | null; - test?: Expression | null; - update?: Expression | null; - body: Statement; -} -interface FunctionDeclaration extends BaseNode { - type: "FunctionDeclaration"; - id?: Identifier | null; - params: Array; - body: BlockStatement; - generator?: boolean; - async?: boolean; - declare?: boolean | null; - returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} -interface FunctionExpression extends BaseNode { - type: "FunctionExpression"; - id?: Identifier | null; - params: Array; - body: BlockStatement; - generator?: boolean; - async?: boolean; - returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} -interface Identifier extends BaseNode { - type: "Identifier"; - name: string; - decorators?: Array | null; - optional?: boolean | null; - typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; -} -interface IfStatement extends BaseNode { - type: "IfStatement"; - test: Expression; - consequent: Statement; - alternate?: Statement | null; -} -interface LabeledStatement extends BaseNode { - type: "LabeledStatement"; - label: Identifier; - body: Statement; -} -interface StringLiteral extends BaseNode { - type: "StringLiteral"; - value: string; -} -interface NumericLiteral extends BaseNode { - type: "NumericLiteral"; - value: number; -} -/** - * @deprecated Use `NumericLiteral` - */ -interface NumberLiteral$1 extends BaseNode { - type: "NumberLiteral"; - value: number; -} -interface NullLiteral extends BaseNode { - type: "NullLiteral"; -} -interface BooleanLiteral extends BaseNode { - type: "BooleanLiteral"; - value: boolean; -} -interface RegExpLiteral extends BaseNode { - type: "RegExpLiteral"; - pattern: string; - flags: string; -} -/** - * @deprecated Use `RegExpLiteral` - */ -interface RegexLiteral$1 extends BaseNode { - type: "RegexLiteral"; - pattern: string; - flags: string; -} -interface LogicalExpression extends BaseNode { - type: "LogicalExpression"; - operator: "||" | "&&" | "??"; - left: Expression; - right: Expression; -} -interface MemberExpression extends BaseNode { - type: "MemberExpression"; - object: Expression; - property: Expression | Identifier | PrivateName; - computed: boolean; - optional?: true | false | null; -} -interface NewExpression extends BaseNode { - type: "NewExpression"; - callee: Expression | V8IntrinsicIdentifier; - arguments: Array; - optional?: true | false | null; - typeArguments?: TypeParameterInstantiation | null; - typeParameters?: TSTypeParameterInstantiation | null; -} -interface Program extends BaseNode { - type: "Program"; - body: Array; - directives: Array; - sourceType: "script" | "module"; - interpreter?: InterpreterDirective | null; - sourceFile: string; -} -interface ObjectExpression extends BaseNode { - type: "ObjectExpression"; - properties: Array; -} -interface ObjectMethod extends BaseNode { - type: "ObjectMethod"; - kind: "method" | "get" | "set"; - key: Expression | Identifier | StringLiteral | NumericLiteral; - params: Array; - body: BlockStatement; - computed: boolean; - generator?: boolean; - async?: boolean; - decorators?: Array | null; - returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} -interface ObjectProperty extends BaseNode { - type: "ObjectProperty"; - key: Expression | Identifier | StringLiteral | NumericLiteral; - value: Expression | PatternLike; - computed: boolean; - shorthand: boolean; - decorators?: Array | null; -} -interface RestElement extends BaseNode { - type: "RestElement"; - argument: LVal; - decorators?: Array | null; - optional?: boolean | null; - typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; -} -/** - * @deprecated Use `RestElement` - */ -interface RestProperty$1 extends BaseNode { - type: "RestProperty"; - argument: LVal; - decorators?: Array | null; - optional?: boolean | null; - typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; -} -interface ReturnStatement extends BaseNode { - type: "ReturnStatement"; - argument?: Expression | null; -} -interface SequenceExpression extends BaseNode { - type: "SequenceExpression"; - expressions: Array; -} -interface ParenthesizedExpression extends BaseNode { - type: "ParenthesizedExpression"; - expression: Expression; -} -interface SwitchCase extends BaseNode { - type: "SwitchCase"; - test?: Expression | null; - consequent: Array; -} -interface SwitchStatement extends BaseNode { - type: "SwitchStatement"; - discriminant: Expression; - cases: Array; -} -interface ThisExpression extends BaseNode { - type: "ThisExpression"; -} -interface ThrowStatement extends BaseNode { - type: "ThrowStatement"; - argument: Expression; -} -interface TryStatement extends BaseNode { - type: "TryStatement"; - block: BlockStatement; - handler?: CatchClause | null; - finalizer?: BlockStatement | null; -} -interface UnaryExpression extends BaseNode { - type: "UnaryExpression"; - operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof"; - argument: Expression; - prefix: boolean; -} -interface UpdateExpression extends BaseNode { - type: "UpdateExpression"; - operator: "++" | "--"; - argument: Expression; - prefix: boolean; -} -interface VariableDeclaration extends BaseNode { - type: "VariableDeclaration"; - kind: "var" | "let" | "const"; - declarations: Array; - declare?: boolean | null; -} -interface VariableDeclarator extends BaseNode { - type: "VariableDeclarator"; - id: LVal; - init?: Expression | null; - definite?: boolean | null; -} -interface WhileStatement extends BaseNode { - type: "WhileStatement"; - test: Expression; - body: Statement; -} -interface WithStatement extends BaseNode { - type: "WithStatement"; - object: Expression; - body: Statement; -} -interface AssignmentPattern extends BaseNode { - type: "AssignmentPattern"; - left: Identifier | ObjectPattern | ArrayPattern | MemberExpression; - right: Expression; - decorators?: Array | null; - typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; -} -interface ArrayPattern extends BaseNode { - type: "ArrayPattern"; - elements: Array; - decorators?: Array | null; - optional?: boolean | null; - typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; -} -interface ArrowFunctionExpression extends BaseNode { - type: "ArrowFunctionExpression"; - params: Array; - body: BlockStatement | Expression; - async?: boolean; - expression: boolean; - generator?: boolean; - returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} -interface ClassBody extends BaseNode { - type: "ClassBody"; - body: Array; -} -interface ClassExpression extends BaseNode { - type: "ClassExpression"; - id?: Identifier | null; - superClass?: Expression | null; - body: ClassBody; - decorators?: Array | null; - implements?: Array | null; - mixins?: InterfaceExtends | null; - superTypeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null; - typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} -interface ClassDeclaration extends BaseNode { - type: "ClassDeclaration"; - id: Identifier; - superClass?: Expression | null; - body: ClassBody; - decorators?: Array | null; - abstract?: boolean | null; - declare?: boolean | null; - implements?: Array | null; - mixins?: InterfaceExtends | null; - superTypeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null; - typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} -interface ExportAllDeclaration extends BaseNode { - type: "ExportAllDeclaration"; - source: StringLiteral; - assertions?: Array | null; - exportKind?: "type" | "value" | null; -} -interface ExportDefaultDeclaration extends BaseNode { - type: "ExportDefaultDeclaration"; - declaration: FunctionDeclaration | TSDeclareFunction | ClassDeclaration | Expression; - exportKind?: "value" | null; -} -interface ExportNamedDeclaration extends BaseNode { - type: "ExportNamedDeclaration"; - declaration?: Declaration | null; - specifiers: Array; - source?: StringLiteral | null; - assertions?: Array | null; - exportKind?: "type" | "value" | null; -} -interface ExportSpecifier extends BaseNode { - type: "ExportSpecifier"; - local: Identifier; - exported: Identifier | StringLiteral; -} -interface ForOfStatement extends BaseNode { - type: "ForOfStatement"; - left: VariableDeclaration | LVal; - right: Expression; - body: Statement; - await: boolean; -} -interface ImportDeclaration extends BaseNode { - type: "ImportDeclaration"; - specifiers: Array; - source: StringLiteral; - assertions?: Array | null; - importKind?: "type" | "typeof" | "value" | null; -} -interface ImportDefaultSpecifier extends BaseNode { - type: "ImportDefaultSpecifier"; - local: Identifier; -} -interface ImportNamespaceSpecifier extends BaseNode { - type: "ImportNamespaceSpecifier"; - local: Identifier; -} -interface ImportSpecifier extends BaseNode { - type: "ImportSpecifier"; - local: Identifier; - imported: Identifier | StringLiteral; - importKind?: "type" | "typeof" | null; -} -interface MetaProperty extends BaseNode { - type: "MetaProperty"; - meta: Identifier; - property: Identifier; -} -interface ClassMethod extends BaseNode { - type: "ClassMethod"; - kind?: "get" | "set" | "method" | "constructor"; - key: Identifier | StringLiteral | NumericLiteral | Expression; - params: Array; - body: BlockStatement; - computed?: boolean; - static?: boolean; - generator?: boolean; - async?: boolean; - abstract?: boolean | null; - access?: "public" | "private" | "protected" | null; - accessibility?: "public" | "private" | "protected" | null; - decorators?: Array | null; - optional?: boolean | null; - override?: boolean; - returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} -interface ObjectPattern extends BaseNode { - type: "ObjectPattern"; - properties: Array; - decorators?: Array | null; - typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; -} -interface SpreadElement extends BaseNode { - type: "SpreadElement"; - argument: Expression; -} -/** - * @deprecated Use `SpreadElement` - */ -interface SpreadProperty$1 extends BaseNode { - type: "SpreadProperty"; - argument: Expression; -} -interface Super extends BaseNode { - type: "Super"; -} -interface TaggedTemplateExpression extends BaseNode { - type: "TaggedTemplateExpression"; - tag: Expression; - quasi: TemplateLiteral; - typeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null; -} -interface TemplateElement extends BaseNode { - type: "TemplateElement"; - value: { - raw: string; - cooked?: string; - }; - tail: boolean; -} -interface TemplateLiteral extends BaseNode { - type: "TemplateLiteral"; - quasis: Array; - expressions: Array; -} -interface YieldExpression extends BaseNode { - type: "YieldExpression"; - argument?: Expression | null; - delegate: boolean; -} -interface AwaitExpression extends BaseNode { - type: "AwaitExpression"; - argument: Expression; -} -interface Import extends BaseNode { - type: "Import"; -} -interface BigIntLiteral extends BaseNode { - type: "BigIntLiteral"; - value: string; -} -interface ExportNamespaceSpecifier extends BaseNode { - type: "ExportNamespaceSpecifier"; - exported: Identifier; -} -interface OptionalMemberExpression extends BaseNode { - type: "OptionalMemberExpression"; - object: Expression; - property: Expression | Identifier; - computed: boolean; - optional: boolean; -} -interface OptionalCallExpression extends BaseNode { - type: "OptionalCallExpression"; - callee: Expression; - arguments: Array; - optional: boolean; - typeArguments?: TypeParameterInstantiation | null; - typeParameters?: TSTypeParameterInstantiation | null; -} -interface ClassProperty extends BaseNode { - type: "ClassProperty"; - key: Identifier | StringLiteral | NumericLiteral | Expression; - value?: Expression | null; - typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; - decorators?: Array | null; - computed?: boolean; - static?: boolean; - abstract?: boolean | null; - accessibility?: "public" | "private" | "protected" | null; - declare?: boolean | null; - definite?: boolean | null; - optional?: boolean | null; - override?: boolean; - readonly?: boolean | null; - variance?: Variance | null; -} -interface ClassPrivateProperty extends BaseNode { - type: "ClassPrivateProperty"; - key: PrivateName; - value?: Expression | null; - decorators?: Array | null; - static: any; - definite?: boolean | null; - readonly?: boolean | null; - typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; - variance?: Variance | null; -} -interface ClassPrivateMethod extends BaseNode { - type: "ClassPrivateMethod"; - kind?: "get" | "set" | "method" | "constructor"; - key: PrivateName; - params: Array; - body: BlockStatement; - static?: boolean; - abstract?: boolean | null; - access?: "public" | "private" | "protected" | null; - accessibility?: "public" | "private" | "protected" | null; - async?: boolean; - computed?: boolean; - decorators?: Array | null; - generator?: boolean; - optional?: boolean | null; - override?: boolean; - returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; - typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; -} -interface PrivateName extends BaseNode { - type: "PrivateName"; - id: Identifier; -} -interface AnyTypeAnnotation extends BaseNode { - type: "AnyTypeAnnotation"; -} -interface ArrayTypeAnnotation extends BaseNode { - type: "ArrayTypeAnnotation"; - elementType: FlowType; -} -interface BooleanTypeAnnotation extends BaseNode { - type: "BooleanTypeAnnotation"; -} -interface BooleanLiteralTypeAnnotation extends BaseNode { - type: "BooleanLiteralTypeAnnotation"; - value: boolean; -} -interface NullLiteralTypeAnnotation extends BaseNode { - type: "NullLiteralTypeAnnotation"; -} -interface ClassImplements extends BaseNode { - type: "ClassImplements"; - id: Identifier; - typeParameters?: TypeParameterInstantiation | null; -} -interface DeclareClass extends BaseNode { - type: "DeclareClass"; - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - extends?: Array | null; - body: ObjectTypeAnnotation; - implements?: Array | null; - mixins?: Array | null; -} -interface DeclareFunction extends BaseNode { - type: "DeclareFunction"; - id: Identifier; - predicate?: DeclaredPredicate | null; -} -interface DeclareInterface extends BaseNode { - type: "DeclareInterface"; - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - extends?: Array | null; - body: ObjectTypeAnnotation; - implements?: Array | null; - mixins?: Array | null; -} -interface DeclareModule extends BaseNode { - type: "DeclareModule"; - id: Identifier | StringLiteral; - body: BlockStatement; - kind?: "CommonJS" | "ES" | null; -} -interface DeclareModuleExports extends BaseNode { - type: "DeclareModuleExports"; - typeAnnotation: TypeAnnotation; -} -interface DeclareTypeAlias extends BaseNode { - type: "DeclareTypeAlias"; - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - right: FlowType; -} -interface DeclareOpaqueType extends BaseNode { - type: "DeclareOpaqueType"; - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - supertype?: FlowType | null; - impltype?: FlowType | null; -} -interface DeclareVariable extends BaseNode { - type: "DeclareVariable"; - id: Identifier; -} -interface DeclareExportDeclaration extends BaseNode { - type: "DeclareExportDeclaration"; - declaration?: Flow | null; - specifiers?: Array | null; - source?: StringLiteral | null; - default?: boolean | null; -} -interface DeclareExportAllDeclaration extends BaseNode { - type: "DeclareExportAllDeclaration"; - source: StringLiteral; - exportKind?: "type" | "value" | null; -} -interface DeclaredPredicate extends BaseNode { - type: "DeclaredPredicate"; - value: Flow; -} -interface ExistsTypeAnnotation extends BaseNode { - type: "ExistsTypeAnnotation"; -} -interface FunctionTypeAnnotation extends BaseNode { - type: "FunctionTypeAnnotation"; - typeParameters?: TypeParameterDeclaration | null; - params: Array; - rest?: FunctionTypeParam | null; - returnType: FlowType; - this?: FunctionTypeParam | null; -} -interface FunctionTypeParam extends BaseNode { - type: "FunctionTypeParam"; - name?: Identifier | null; - typeAnnotation: FlowType; - optional?: boolean | null; -} -interface GenericTypeAnnotation extends BaseNode { - type: "GenericTypeAnnotation"; - id: Identifier | QualifiedTypeIdentifier; - typeParameters?: TypeParameterInstantiation | null; -} -interface InferredPredicate extends BaseNode { - type: "InferredPredicate"; -} -interface InterfaceExtends extends BaseNode { - type: "InterfaceExtends"; - id: Identifier | QualifiedTypeIdentifier; - typeParameters?: TypeParameterInstantiation | null; -} -interface InterfaceDeclaration extends BaseNode { - type: "InterfaceDeclaration"; - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - extends?: Array | null; - body: ObjectTypeAnnotation; - implements?: Array | null; - mixins?: Array | null; -} -interface InterfaceTypeAnnotation extends BaseNode { - type: "InterfaceTypeAnnotation"; - extends?: Array | null; - body: ObjectTypeAnnotation; -} -interface IntersectionTypeAnnotation extends BaseNode { - type: "IntersectionTypeAnnotation"; - types: Array; -} -interface MixedTypeAnnotation extends BaseNode { - type: "MixedTypeAnnotation"; -} -interface EmptyTypeAnnotation extends BaseNode { - type: "EmptyTypeAnnotation"; -} -interface NullableTypeAnnotation extends BaseNode { - type: "NullableTypeAnnotation"; - typeAnnotation: FlowType; -} -interface NumberLiteralTypeAnnotation extends BaseNode { - type: "NumberLiteralTypeAnnotation"; - value: number; -} -interface NumberTypeAnnotation extends BaseNode { - type: "NumberTypeAnnotation"; -} -interface ObjectTypeAnnotation extends BaseNode { - type: "ObjectTypeAnnotation"; - properties: Array; - indexers?: Array | null; - callProperties?: Array | null; - internalSlots?: Array | null; - exact: boolean; - inexact?: boolean | null; -} -interface ObjectTypeInternalSlot extends BaseNode { - type: "ObjectTypeInternalSlot"; - id: Identifier; - value: FlowType; - optional: boolean; - static: boolean; - method: boolean; -} -interface ObjectTypeCallProperty extends BaseNode { - type: "ObjectTypeCallProperty"; - value: FlowType; - static: boolean; -} -interface ObjectTypeIndexer extends BaseNode { - type: "ObjectTypeIndexer"; - id?: Identifier | null; - key: FlowType; - value: FlowType; - variance?: Variance | null; - static: boolean; -} -interface ObjectTypeProperty extends BaseNode { - type: "ObjectTypeProperty"; - key: Identifier | StringLiteral; - value: FlowType; - variance?: Variance | null; - kind: "init" | "get" | "set"; - method: boolean; - optional: boolean; - proto: boolean; - static: boolean; -} -interface ObjectTypeSpreadProperty extends BaseNode { - type: "ObjectTypeSpreadProperty"; - argument: FlowType; -} -interface OpaqueType extends BaseNode { - type: "OpaqueType"; - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - supertype?: FlowType | null; - impltype: FlowType; -} -interface QualifiedTypeIdentifier extends BaseNode { - type: "QualifiedTypeIdentifier"; - id: Identifier; - qualification: Identifier | QualifiedTypeIdentifier; -} -interface StringLiteralTypeAnnotation extends BaseNode { - type: "StringLiteralTypeAnnotation"; - value: string; -} -interface StringTypeAnnotation extends BaseNode { - type: "StringTypeAnnotation"; -} -interface SymbolTypeAnnotation extends BaseNode { - type: "SymbolTypeAnnotation"; -} -interface ThisTypeAnnotation extends BaseNode { - type: "ThisTypeAnnotation"; -} -interface TupleTypeAnnotation extends BaseNode { - type: "TupleTypeAnnotation"; - types: Array; -} -interface TypeofTypeAnnotation extends BaseNode { - type: "TypeofTypeAnnotation"; - argument: FlowType; -} -interface TypeAlias extends BaseNode { - type: "TypeAlias"; - id: Identifier; - typeParameters?: TypeParameterDeclaration | null; - right: FlowType; -} -interface TypeAnnotation extends BaseNode { - type: "TypeAnnotation"; - typeAnnotation: FlowType; -} -interface TypeCastExpression extends BaseNode { - type: "TypeCastExpression"; - expression: Expression; - typeAnnotation: TypeAnnotation; -} -interface TypeParameter extends BaseNode { - type: "TypeParameter"; - bound?: TypeAnnotation | null; - default?: FlowType | null; - variance?: Variance | null; - name: string; -} -interface TypeParameterDeclaration extends BaseNode { - type: "TypeParameterDeclaration"; - params: Array; -} -interface TypeParameterInstantiation extends BaseNode { - type: "TypeParameterInstantiation"; - params: Array; -} -interface UnionTypeAnnotation extends BaseNode { - type: "UnionTypeAnnotation"; - types: Array; -} -interface Variance extends BaseNode { - type: "Variance"; - kind: "minus" | "plus"; -} -interface VoidTypeAnnotation extends BaseNode { - type: "VoidTypeAnnotation"; -} -interface EnumDeclaration extends BaseNode { - type: "EnumDeclaration"; - id: Identifier; - body: EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody; -} -interface EnumBooleanBody extends BaseNode { - type: "EnumBooleanBody"; - members: Array; - explicitType: boolean; - hasUnknownMembers: boolean; -} -interface EnumNumberBody extends BaseNode { - type: "EnumNumberBody"; - members: Array; - explicitType: boolean; - hasUnknownMembers: boolean; -} -interface EnumStringBody extends BaseNode { - type: "EnumStringBody"; - members: Array; - explicitType: boolean; - hasUnknownMembers: boolean; -} -interface EnumSymbolBody extends BaseNode { - type: "EnumSymbolBody"; - members: Array; - hasUnknownMembers: boolean; -} -interface EnumBooleanMember extends BaseNode { - type: "EnumBooleanMember"; - id: Identifier; - init: BooleanLiteral; -} -interface EnumNumberMember extends BaseNode { - type: "EnumNumberMember"; - id: Identifier; - init: NumericLiteral; -} -interface EnumStringMember extends BaseNode { - type: "EnumStringMember"; - id: Identifier; - init: StringLiteral; -} -interface EnumDefaultedMember extends BaseNode { - type: "EnumDefaultedMember"; - id: Identifier; -} -interface IndexedAccessType extends BaseNode { - type: "IndexedAccessType"; - objectType: FlowType; - indexType: FlowType; -} -interface OptionalIndexedAccessType extends BaseNode { - type: "OptionalIndexedAccessType"; - objectType: FlowType; - indexType: FlowType; - optional: boolean; -} -interface JSXAttribute extends BaseNode { - type: "JSXAttribute"; - name: JSXIdentifier | JSXNamespacedName; - value?: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer | null; -} -interface JSXClosingElement extends BaseNode { - type: "JSXClosingElement"; - name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName; -} -interface JSXElement extends BaseNode { - type: "JSXElement"; - openingElement: JSXOpeningElement; - closingElement?: JSXClosingElement | null; - children: Array; - selfClosing?: boolean | null; -} -interface JSXEmptyExpression extends BaseNode { - type: "JSXEmptyExpression"; -} -interface JSXExpressionContainer extends BaseNode { - type: "JSXExpressionContainer"; - expression: Expression | JSXEmptyExpression; -} -interface JSXSpreadChild extends BaseNode { - type: "JSXSpreadChild"; - expression: Expression; -} -interface JSXIdentifier extends BaseNode { - type: "JSXIdentifier"; - name: string; -} -interface JSXMemberExpression extends BaseNode { - type: "JSXMemberExpression"; - object: JSXMemberExpression | JSXIdentifier; - property: JSXIdentifier; -} -interface JSXNamespacedName extends BaseNode { - type: "JSXNamespacedName"; - namespace: JSXIdentifier; - name: JSXIdentifier; -} -interface JSXOpeningElement extends BaseNode { - type: "JSXOpeningElement"; - name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName; - attributes: Array; - selfClosing: boolean; - typeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null; -} -interface JSXSpreadAttribute extends BaseNode { - type: "JSXSpreadAttribute"; - argument: Expression; -} -interface JSXText extends BaseNode { - type: "JSXText"; - value: string; -} -interface JSXFragment extends BaseNode { - type: "JSXFragment"; - openingFragment: JSXOpeningFragment; - closingFragment: JSXClosingFragment; - children: Array; -} -interface JSXOpeningFragment extends BaseNode { - type: "JSXOpeningFragment"; -} -interface JSXClosingFragment extends BaseNode { - type: "JSXClosingFragment"; -} -interface Noop extends BaseNode { - type: "Noop"; -} -interface Placeholder extends BaseNode { - type: "Placeholder"; - expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern"; - name: Identifier; -} -interface V8IntrinsicIdentifier extends BaseNode { - type: "V8IntrinsicIdentifier"; - name: string; -} -interface ArgumentPlaceholder extends BaseNode { - type: "ArgumentPlaceholder"; -} -interface BindExpression extends BaseNode { - type: "BindExpression"; - object: Expression; - callee: Expression; -} -interface ImportAttribute extends BaseNode { - type: "ImportAttribute"; - key: Identifier | StringLiteral; - value: StringLiteral; -} -interface Decorator extends BaseNode { - type: "Decorator"; - expression: Expression; -} -interface DoExpression extends BaseNode { - type: "DoExpression"; - body: BlockStatement; - async: boolean; -} -interface ExportDefaultSpecifier extends BaseNode { - type: "ExportDefaultSpecifier"; - exported: Identifier; -} -interface RecordExpression extends BaseNode { - type: "RecordExpression"; - properties: Array; -} -interface TupleExpression extends BaseNode { - type: "TupleExpression"; - elements: Array; -} -interface DecimalLiteral extends BaseNode { - type: "DecimalLiteral"; - value: string; -} -interface StaticBlock extends BaseNode { - type: "StaticBlock"; - body: Array; -} -interface ModuleExpression extends BaseNode { - type: "ModuleExpression"; - body: Program; -} -interface TopicReference extends BaseNode { - type: "TopicReference"; -} -interface PipelineTopicExpression extends BaseNode { - type: "PipelineTopicExpression"; - expression: Expression; -} -interface PipelineBareFunction extends BaseNode { - type: "PipelineBareFunction"; - callee: Expression; -} -interface PipelinePrimaryTopicReference extends BaseNode { - type: "PipelinePrimaryTopicReference"; -} -interface TSParameterProperty extends BaseNode { - type: "TSParameterProperty"; - parameter: Identifier | AssignmentPattern; - accessibility?: "public" | "private" | "protected" | null; - decorators?: Array | null; - override?: boolean | null; - readonly?: boolean | null; -} -interface TSDeclareFunction extends BaseNode { - type: "TSDeclareFunction"; - id?: Identifier | null; - typeParameters?: TSTypeParameterDeclaration | Noop | null; - params: Array; - returnType?: TSTypeAnnotation | Noop | null; - async?: boolean; - declare?: boolean | null; - generator?: boolean; -} -interface TSDeclareMethod extends BaseNode { - type: "TSDeclareMethod"; - decorators?: Array | null; - key: Identifier | StringLiteral | NumericLiteral | Expression; - typeParameters?: TSTypeParameterDeclaration | Noop | null; - params: Array; - returnType?: TSTypeAnnotation | Noop | null; - abstract?: boolean | null; - access?: "public" | "private" | "protected" | null; - accessibility?: "public" | "private" | "protected" | null; - async?: boolean; - computed?: boolean; - generator?: boolean; - kind?: "get" | "set" | "method" | "constructor"; - optional?: boolean | null; - override?: boolean; - static?: boolean; -} -interface TSQualifiedName extends BaseNode { - type: "TSQualifiedName"; - left: TSEntityName; - right: Identifier; -} -interface TSCallSignatureDeclaration extends BaseNode { - type: "TSCallSignatureDeclaration"; - typeParameters?: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation?: TSTypeAnnotation | null; -} -interface TSConstructSignatureDeclaration extends BaseNode { - type: "TSConstructSignatureDeclaration"; - typeParameters?: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation?: TSTypeAnnotation | null; -} -interface TSPropertySignature extends BaseNode { - type: "TSPropertySignature"; - key: Expression; - typeAnnotation?: TSTypeAnnotation | null; - initializer?: Expression | null; - computed?: boolean | null; - kind: "get" | "set"; - optional?: boolean | null; - readonly?: boolean | null; -} -interface TSMethodSignature extends BaseNode { - type: "TSMethodSignature"; - key: Expression; - typeParameters?: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation?: TSTypeAnnotation | null; - computed?: boolean | null; - kind: "method" | "get" | "set"; - optional?: boolean | null; -} -interface TSIndexSignature extends BaseNode { - type: "TSIndexSignature"; - parameters: Array; - typeAnnotation?: TSTypeAnnotation | null; - readonly?: boolean | null; - static?: boolean | null; -} -interface TSAnyKeyword extends BaseNode { - type: "TSAnyKeyword"; -} -interface TSBooleanKeyword extends BaseNode { - type: "TSBooleanKeyword"; -} -interface TSBigIntKeyword extends BaseNode { - type: "TSBigIntKeyword"; -} -interface TSIntrinsicKeyword extends BaseNode { - type: "TSIntrinsicKeyword"; -} -interface TSNeverKeyword extends BaseNode { - type: "TSNeverKeyword"; -} -interface TSNullKeyword extends BaseNode { - type: "TSNullKeyword"; -} -interface TSNumberKeyword extends BaseNode { - type: "TSNumberKeyword"; -} -interface TSObjectKeyword extends BaseNode { - type: "TSObjectKeyword"; -} -interface TSStringKeyword extends BaseNode { - type: "TSStringKeyword"; -} -interface TSSymbolKeyword extends BaseNode { - type: "TSSymbolKeyword"; -} -interface TSUndefinedKeyword extends BaseNode { - type: "TSUndefinedKeyword"; -} -interface TSUnknownKeyword extends BaseNode { - type: "TSUnknownKeyword"; -} -interface TSVoidKeyword extends BaseNode { - type: "TSVoidKeyword"; -} -interface TSThisType extends BaseNode { - type: "TSThisType"; -} -interface TSFunctionType extends BaseNode { - type: "TSFunctionType"; - typeParameters?: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation?: TSTypeAnnotation | null; -} -interface TSConstructorType extends BaseNode { - type: "TSConstructorType"; - typeParameters?: TSTypeParameterDeclaration | null; - parameters: Array; - typeAnnotation?: TSTypeAnnotation | null; - abstract?: boolean | null; -} -interface TSTypeReference extends BaseNode { - type: "TSTypeReference"; - typeName: TSEntityName; - typeParameters?: TSTypeParameterInstantiation | null; -} -interface TSTypePredicate extends BaseNode { - type: "TSTypePredicate"; - parameterName: Identifier | TSThisType; - typeAnnotation?: TSTypeAnnotation | null; - asserts?: boolean | null; -} -interface TSTypeQuery extends BaseNode { - type: "TSTypeQuery"; - exprName: TSEntityName | TSImportType; -} -interface TSTypeLiteral extends BaseNode { - type: "TSTypeLiteral"; - members: Array; -} -interface TSArrayType extends BaseNode { - type: "TSArrayType"; - elementType: TSType; -} -interface TSTupleType extends BaseNode { - type: "TSTupleType"; - elementTypes: Array; -} -interface TSOptionalType extends BaseNode { - type: "TSOptionalType"; - typeAnnotation: TSType; -} -interface TSRestType extends BaseNode { - type: "TSRestType"; - typeAnnotation: TSType; -} -interface TSNamedTupleMember extends BaseNode { - type: "TSNamedTupleMember"; - label: Identifier; - elementType: TSType; - optional: boolean; -} -interface TSUnionType extends BaseNode { - type: "TSUnionType"; - types: Array; -} -interface TSIntersectionType extends BaseNode { - type: "TSIntersectionType"; - types: Array; -} -interface TSConditionalType extends BaseNode { - type: "TSConditionalType"; - checkType: TSType; - extendsType: TSType; - trueType: TSType; - falseType: TSType; -} -interface TSInferType extends BaseNode { - type: "TSInferType"; - typeParameter: TSTypeParameter; -} -interface TSParenthesizedType extends BaseNode { - type: "TSParenthesizedType"; - typeAnnotation: TSType; -} -interface TSTypeOperator extends BaseNode { - type: "TSTypeOperator"; - typeAnnotation: TSType; - operator: string; -} -interface TSIndexedAccessType extends BaseNode { - type: "TSIndexedAccessType"; - objectType: TSType; - indexType: TSType; -} -interface TSMappedType extends BaseNode { - type: "TSMappedType"; - typeParameter: TSTypeParameter; - typeAnnotation?: TSType | null; - nameType?: TSType | null; - optional?: boolean | null; - readonly?: boolean | null; -} -interface TSLiteralType extends BaseNode { - type: "TSLiteralType"; - literal: NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | UnaryExpression; -} -interface TSExpressionWithTypeArguments extends BaseNode { - type: "TSExpressionWithTypeArguments"; - expression: TSEntityName; - typeParameters?: TSTypeParameterInstantiation | null; -} -interface TSInterfaceDeclaration extends BaseNode { - type: "TSInterfaceDeclaration"; - id: Identifier; - typeParameters?: TSTypeParameterDeclaration | null; - extends?: Array | null; - body: TSInterfaceBody; - declare?: boolean | null; -} -interface TSInterfaceBody extends BaseNode { - type: "TSInterfaceBody"; - body: Array; -} -interface TSTypeAliasDeclaration extends BaseNode { - type: "TSTypeAliasDeclaration"; - id: Identifier; - typeParameters?: TSTypeParameterDeclaration | null; - typeAnnotation: TSType; - declare?: boolean | null; -} -interface TSAsExpression extends BaseNode { - type: "TSAsExpression"; - expression: Expression; - typeAnnotation: TSType; -} -interface TSTypeAssertion extends BaseNode { - type: "TSTypeAssertion"; - typeAnnotation: TSType; - expression: Expression; -} -interface TSEnumDeclaration extends BaseNode { - type: "TSEnumDeclaration"; - id: Identifier; - members: Array; - const?: boolean | null; - declare?: boolean | null; - initializer?: Expression | null; -} -interface TSEnumMember extends BaseNode { - type: "TSEnumMember"; - id: Identifier | StringLiteral; - initializer?: Expression | null; -} -interface TSModuleDeclaration extends BaseNode { - type: "TSModuleDeclaration"; - id: Identifier | StringLiteral; - body: TSModuleBlock | TSModuleDeclaration; - declare?: boolean | null; - global?: boolean | null; -} -interface TSModuleBlock extends BaseNode { - type: "TSModuleBlock"; - body: Array; -} -interface TSImportType extends BaseNode { - type: "TSImportType"; - argument: StringLiteral; - qualifier?: TSEntityName | null; - typeParameters?: TSTypeParameterInstantiation | null; -} -interface TSImportEqualsDeclaration extends BaseNode { - type: "TSImportEqualsDeclaration"; - id: Identifier; - moduleReference: TSEntityName | TSExternalModuleReference; - importKind?: "type" | "value" | null; - isExport: boolean; -} -interface TSExternalModuleReference extends BaseNode { - type: "TSExternalModuleReference"; - expression: StringLiteral; -} -interface TSNonNullExpression extends BaseNode { - type: "TSNonNullExpression"; - expression: Expression; -} -interface TSExportAssignment extends BaseNode { - type: "TSExportAssignment"; - expression: Expression; -} -interface TSNamespaceExportDeclaration extends BaseNode { - type: "TSNamespaceExportDeclaration"; - id: Identifier; -} -interface TSTypeAnnotation extends BaseNode { - type: "TSTypeAnnotation"; - typeAnnotation: TSType; -} -interface TSTypeParameterInstantiation extends BaseNode { - type: "TSTypeParameterInstantiation"; - params: Array; -} -interface TSTypeParameterDeclaration extends BaseNode { - type: "TSTypeParameterDeclaration"; - params: Array; -} -interface TSTypeParameter extends BaseNode { - type: "TSTypeParameter"; - constraint?: TSType | null; - default?: TSType | null; - name: string; -} -declare type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ParenthesizedExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSAsExpression | TSTypeAssertion | TSNonNullExpression; -declare type Binary = BinaryExpression | LogicalExpression; -declare type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassExpression | ClassDeclaration | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock; -declare type BlockParent = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock; -declare type Block = BlockStatement | Program | TSModuleBlock; -declare type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForStatement | FunctionDeclaration | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSImportEqualsDeclaration | TSExportAssignment | TSNamespaceExportDeclaration; -declare type Terminatorless = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement | YieldExpression | AwaitExpression; -declare type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement; -declare type Conditional = ConditionalExpression | IfStatement; -declare type Loop = DoWhileStatement | ForInStatement | ForStatement | WhileStatement | ForOfStatement; -declare type While = DoWhileStatement | WhileStatement; -declare type ExpressionWrapper = ExpressionStatement | ParenthesizedExpression | TypeCastExpression; -declare type For = ForInStatement | ForStatement | ForOfStatement; -declare type ForXStatement = ForInStatement | ForOfStatement; -declare type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod; -declare type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod; -declare type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ArrowFunctionExpression | BigIntLiteral | DecimalLiteral; -declare type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration; -declare type PatternLike = Identifier | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern; -declare type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern | TSParameterProperty; -declare type TSEntityName = Identifier | TSQualifiedName; -declare type Literal = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | TemplateLiteral | BigIntLiteral | DecimalLiteral; -declare type Immutable = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | BigIntLiteral | JSXAttribute | JSXClosingElement | JSXElement | JSXExpressionContainer | JSXSpreadChild | JSXOpeningElement | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment | DecimalLiteral; -declare type UserWhitespacable = ObjectMethod | ObjectProperty | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty; -declare type Method = ObjectMethod | ClassMethod | ClassPrivateMethod; -declare type ObjectMember = ObjectMethod | ObjectProperty; -declare type Property = ObjectProperty | ClassProperty | ClassPrivateProperty; -declare type UnaryLike = UnaryExpression | SpreadElement; -declare type Pattern = AssignmentPattern | ArrayPattern | ObjectPattern; -declare type Class = ClassExpression | ClassDeclaration; -declare type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration; -declare type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration; -declare type ModuleSpecifier = ExportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ExportNamespaceSpecifier | ExportDefaultSpecifier; -declare type Private = ClassPrivateProperty | ClassPrivateMethod | PrivateName; -declare type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ClassImplements | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | DeclaredPredicate | ExistsTypeAnnotation | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InferredPredicate | InterfaceExtends | InterfaceDeclaration | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | QualifiedTypeIdentifier | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | UnionTypeAnnotation | Variance | VoidTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType; -declare type FlowType = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ExistsTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType; -declare type FlowBaseAnnotation = AnyTypeAnnotation | BooleanTypeAnnotation | NullLiteralTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NumberTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | VoidTypeAnnotation; -declare type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias; -declare type FlowPredicate = DeclaredPredicate | InferredPredicate; -declare type EnumBody = EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody; -declare type EnumMember = EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember; -declare type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXSpreadChild | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment; -declare type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature; -declare type TSType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSLiteralType | TSExpressionWithTypeArguments | TSImportType; -declare type TSBaseType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSLiteralType; -interface Aliases { - Expression: Expression; - Binary: Binary; - Scopable: Scopable; - BlockParent: BlockParent; - Block: Block; - Statement: Statement; - Terminatorless: Terminatorless; - CompletionStatement: CompletionStatement; - Conditional: Conditional; - Loop: Loop; - While: While; - ExpressionWrapper: ExpressionWrapper; - For: For; - ForXStatement: ForXStatement; - Function: Function; - FunctionParent: FunctionParent; - Pureish: Pureish; - Declaration: Declaration; - PatternLike: PatternLike; - LVal: LVal; - TSEntityName: TSEntityName; - Literal: Literal; - Immutable: Immutable; - UserWhitespacable: UserWhitespacable; - Method: Method; - ObjectMember: ObjectMember; - Property: Property; - UnaryLike: UnaryLike; - Pattern: Pattern; - Class: Class; - ModuleDeclaration: ModuleDeclaration; - ExportDeclaration: ExportDeclaration; - ModuleSpecifier: ModuleSpecifier; - Private: Private; - Flow: Flow; - FlowType: FlowType; - FlowBaseAnnotation: FlowBaseAnnotation; - FlowDeclaration: FlowDeclaration; - FlowPredicate: FlowPredicate; - EnumBody: EnumBody; - EnumMember: EnumMember; - JSX: JSX; - TSTypeElement: TSTypeElement; - TSType: TSType; - TSBaseType: TSBaseType; -} - -declare function isCompatTag(tagName?: string): boolean; - -declare type ReturnedChild = JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment | Expression; -declare function buildChildren(node: { - children: ReadonlyArray; -}): ReturnedChild[]; - -declare function assertNode(node?: any): asserts node is Node; - -declare function assertArrayExpression(node: object | null | undefined, opts?: object | null): asserts node is ArrayExpression; -declare function assertAssignmentExpression(node: object | null | undefined, opts?: object | null): asserts node is AssignmentExpression; -declare function assertBinaryExpression(node: object | null | undefined, opts?: object | null): asserts node is BinaryExpression; -declare function assertInterpreterDirective(node: object | null | undefined, opts?: object | null): asserts node is InterpreterDirective; -declare function assertDirective(node: object | null | undefined, opts?: object | null): asserts node is Directive; -declare function assertDirectiveLiteral(node: object | null | undefined, opts?: object | null): asserts node is DirectiveLiteral; -declare function assertBlockStatement(node: object | null | undefined, opts?: object | null): asserts node is BlockStatement; -declare function assertBreakStatement(node: object | null | undefined, opts?: object | null): asserts node is BreakStatement; -declare function assertCallExpression(node: object | null | undefined, opts?: object | null): asserts node is CallExpression; -declare function assertCatchClause(node: object | null | undefined, opts?: object | null): asserts node is CatchClause; -declare function assertConditionalExpression(node: object | null | undefined, opts?: object | null): asserts node is ConditionalExpression; -declare function assertContinueStatement(node: object | null | undefined, opts?: object | null): asserts node is ContinueStatement; -declare function assertDebuggerStatement(node: object | null | undefined, opts?: object | null): asserts node is DebuggerStatement; -declare function assertDoWhileStatement(node: object | null | undefined, opts?: object | null): asserts node is DoWhileStatement; -declare function assertEmptyStatement(node: object | null | undefined, opts?: object | null): asserts node is EmptyStatement; -declare function assertExpressionStatement(node: object | null | undefined, opts?: object | null): asserts node is ExpressionStatement; -declare function assertFile(node: object | null | undefined, opts?: object | null): asserts node is File; -declare function assertForInStatement(node: object | null | undefined, opts?: object | null): asserts node is ForInStatement; -declare function assertForStatement(node: object | null | undefined, opts?: object | null): asserts node is ForStatement; -declare function assertFunctionDeclaration(node: object | null | undefined, opts?: object | null): asserts node is FunctionDeclaration; -declare function assertFunctionExpression(node: object | null | undefined, opts?: object | null): asserts node is FunctionExpression; -declare function assertIdentifier(node: object | null | undefined, opts?: object | null): asserts node is Identifier; -declare function assertIfStatement(node: object | null | undefined, opts?: object | null): asserts node is IfStatement; -declare function assertLabeledStatement(node: object | null | undefined, opts?: object | null): asserts node is LabeledStatement; -declare function assertStringLiteral(node: object | null | undefined, opts?: object | null): asserts node is StringLiteral; -declare function assertNumericLiteral(node: object | null | undefined, opts?: object | null): asserts node is NumericLiteral; -declare function assertNullLiteral(node: object | null | undefined, opts?: object | null): asserts node is NullLiteral; -declare function assertBooleanLiteral(node: object | null | undefined, opts?: object | null): asserts node is BooleanLiteral; -declare function assertRegExpLiteral(node: object | null | undefined, opts?: object | null): asserts node is RegExpLiteral; -declare function assertLogicalExpression(node: object | null | undefined, opts?: object | null): asserts node is LogicalExpression; -declare function assertMemberExpression(node: object | null | undefined, opts?: object | null): asserts node is MemberExpression; -declare function assertNewExpression(node: object | null | undefined, opts?: object | null): asserts node is NewExpression; -declare function assertProgram(node: object | null | undefined, opts?: object | null): asserts node is Program; -declare function assertObjectExpression(node: object | null | undefined, opts?: object | null): asserts node is ObjectExpression; -declare function assertObjectMethod(node: object | null | undefined, opts?: object | null): asserts node is ObjectMethod; -declare function assertObjectProperty(node: object | null | undefined, opts?: object | null): asserts node is ObjectProperty; -declare function assertRestElement(node: object | null | undefined, opts?: object | null): asserts node is RestElement; -declare function assertReturnStatement(node: object | null | undefined, opts?: object | null): asserts node is ReturnStatement; -declare function assertSequenceExpression(node: object | null | undefined, opts?: object | null): asserts node is SequenceExpression; -declare function assertParenthesizedExpression(node: object | null | undefined, opts?: object | null): asserts node is ParenthesizedExpression; -declare function assertSwitchCase(node: object | null | undefined, opts?: object | null): asserts node is SwitchCase; -declare function assertSwitchStatement(node: object | null | undefined, opts?: object | null): asserts node is SwitchStatement; -declare function assertThisExpression(node: object | null | undefined, opts?: object | null): asserts node is ThisExpression; -declare function assertThrowStatement(node: object | null | undefined, opts?: object | null): asserts node is ThrowStatement; -declare function assertTryStatement(node: object | null | undefined, opts?: object | null): asserts node is TryStatement; -declare function assertUnaryExpression(node: object | null | undefined, opts?: object | null): asserts node is UnaryExpression; -declare function assertUpdateExpression(node: object | null | undefined, opts?: object | null): asserts node is UpdateExpression; -declare function assertVariableDeclaration(node: object | null | undefined, opts?: object | null): asserts node is VariableDeclaration; -declare function assertVariableDeclarator(node: object | null | undefined, opts?: object | null): asserts node is VariableDeclarator; -declare function assertWhileStatement(node: object | null | undefined, opts?: object | null): asserts node is WhileStatement; -declare function assertWithStatement(node: object | null | undefined, opts?: object | null): asserts node is WithStatement; -declare function assertAssignmentPattern(node: object | null | undefined, opts?: object | null): asserts node is AssignmentPattern; -declare function assertArrayPattern(node: object | null | undefined, opts?: object | null): asserts node is ArrayPattern; -declare function assertArrowFunctionExpression(node: object | null | undefined, opts?: object | null): asserts node is ArrowFunctionExpression; -declare function assertClassBody(node: object | null | undefined, opts?: object | null): asserts node is ClassBody; -declare function assertClassExpression(node: object | null | undefined, opts?: object | null): asserts node is ClassExpression; -declare function assertClassDeclaration(node: object | null | undefined, opts?: object | null): asserts node is ClassDeclaration; -declare function assertExportAllDeclaration(node: object | null | undefined, opts?: object | null): asserts node is ExportAllDeclaration; -declare function assertExportDefaultDeclaration(node: object | null | undefined, opts?: object | null): asserts node is ExportDefaultDeclaration; -declare function assertExportNamedDeclaration(node: object | null | undefined, opts?: object | null): asserts node is ExportNamedDeclaration; -declare function assertExportSpecifier(node: object | null | undefined, opts?: object | null): asserts node is ExportSpecifier; -declare function assertForOfStatement(node: object | null | undefined, opts?: object | null): asserts node is ForOfStatement; -declare function assertImportDeclaration(node: object | null | undefined, opts?: object | null): asserts node is ImportDeclaration; -declare function assertImportDefaultSpecifier(node: object | null | undefined, opts?: object | null): asserts node is ImportDefaultSpecifier; -declare function assertImportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): asserts node is ImportNamespaceSpecifier; -declare function assertImportSpecifier(node: object | null | undefined, opts?: object | null): asserts node is ImportSpecifier; -declare function assertMetaProperty(node: object | null | undefined, opts?: object | null): asserts node is MetaProperty; -declare function assertClassMethod(node: object | null | undefined, opts?: object | null): asserts node is ClassMethod; -declare function assertObjectPattern(node: object | null | undefined, opts?: object | null): asserts node is ObjectPattern; -declare function assertSpreadElement(node: object | null | undefined, opts?: object | null): asserts node is SpreadElement; -declare function assertSuper(node: object | null | undefined, opts?: object | null): asserts node is Super; -declare function assertTaggedTemplateExpression(node: object | null | undefined, opts?: object | null): asserts node is TaggedTemplateExpression; -declare function assertTemplateElement(node: object | null | undefined, opts?: object | null): asserts node is TemplateElement; -declare function assertTemplateLiteral(node: object | null | undefined, opts?: object | null): asserts node is TemplateLiteral; -declare function assertYieldExpression(node: object | null | undefined, opts?: object | null): asserts node is YieldExpression; -declare function assertAwaitExpression(node: object | null | undefined, opts?: object | null): asserts node is AwaitExpression; -declare function assertImport(node: object | null | undefined, opts?: object | null): asserts node is Import; -declare function assertBigIntLiteral(node: object | null | undefined, opts?: object | null): asserts node is BigIntLiteral; -declare function assertExportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): asserts node is ExportNamespaceSpecifier; -declare function assertOptionalMemberExpression(node: object | null | undefined, opts?: object | null): asserts node is OptionalMemberExpression; -declare function assertOptionalCallExpression(node: object | null | undefined, opts?: object | null): asserts node is OptionalCallExpression; -declare function assertClassProperty(node: object | null | undefined, opts?: object | null): asserts node is ClassProperty; -declare function assertClassPrivateProperty(node: object | null | undefined, opts?: object | null): asserts node is ClassPrivateProperty; -declare function assertClassPrivateMethod(node: object | null | undefined, opts?: object | null): asserts node is ClassPrivateMethod; -declare function assertPrivateName(node: object | null | undefined, opts?: object | null): asserts node is PrivateName; -declare function assertAnyTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is AnyTypeAnnotation; -declare function assertArrayTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is ArrayTypeAnnotation; -declare function assertBooleanTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is BooleanTypeAnnotation; -declare function assertBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is BooleanLiteralTypeAnnotation; -declare function assertNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is NullLiteralTypeAnnotation; -declare function assertClassImplements(node: object | null | undefined, opts?: object | null): asserts node is ClassImplements; -declare function assertDeclareClass(node: object | null | undefined, opts?: object | null): asserts node is DeclareClass; -declare function assertDeclareFunction(node: object | null | undefined, opts?: object | null): asserts node is DeclareFunction; -declare function assertDeclareInterface(node: object | null | undefined, opts?: object | null): asserts node is DeclareInterface; -declare function assertDeclareModule(node: object | null | undefined, opts?: object | null): asserts node is DeclareModule; -declare function assertDeclareModuleExports(node: object | null | undefined, opts?: object | null): asserts node is DeclareModuleExports; -declare function assertDeclareTypeAlias(node: object | null | undefined, opts?: object | null): asserts node is DeclareTypeAlias; -declare function assertDeclareOpaqueType(node: object | null | undefined, opts?: object | null): asserts node is DeclareOpaqueType; -declare function assertDeclareVariable(node: object | null | undefined, opts?: object | null): asserts node is DeclareVariable; -declare function assertDeclareExportDeclaration(node: object | null | undefined, opts?: object | null): asserts node is DeclareExportDeclaration; -declare function assertDeclareExportAllDeclaration(node: object | null | undefined, opts?: object | null): asserts node is DeclareExportAllDeclaration; -declare function assertDeclaredPredicate(node: object | null | undefined, opts?: object | null): asserts node is DeclaredPredicate; -declare function assertExistsTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is ExistsTypeAnnotation; -declare function assertFunctionTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is FunctionTypeAnnotation; -declare function assertFunctionTypeParam(node: object | null | undefined, opts?: object | null): asserts node is FunctionTypeParam; -declare function assertGenericTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is GenericTypeAnnotation; -declare function assertInferredPredicate(node: object | null | undefined, opts?: object | null): asserts node is InferredPredicate; -declare function assertInterfaceExtends(node: object | null | undefined, opts?: object | null): asserts node is InterfaceExtends; -declare function assertInterfaceDeclaration(node: object | null | undefined, opts?: object | null): asserts node is InterfaceDeclaration; -declare function assertInterfaceTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is InterfaceTypeAnnotation; -declare function assertIntersectionTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is IntersectionTypeAnnotation; -declare function assertMixedTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is MixedTypeAnnotation; -declare function assertEmptyTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is EmptyTypeAnnotation; -declare function assertNullableTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is NullableTypeAnnotation; -declare function assertNumberLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is NumberLiteralTypeAnnotation; -declare function assertNumberTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is NumberTypeAnnotation; -declare function assertObjectTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is ObjectTypeAnnotation; -declare function assertObjectTypeInternalSlot(node: object | null | undefined, opts?: object | null): asserts node is ObjectTypeInternalSlot; -declare function assertObjectTypeCallProperty(node: object | null | undefined, opts?: object | null): asserts node is ObjectTypeCallProperty; -declare function assertObjectTypeIndexer(node: object | null | undefined, opts?: object | null): asserts node is ObjectTypeIndexer; -declare function assertObjectTypeProperty(node: object | null | undefined, opts?: object | null): asserts node is ObjectTypeProperty; -declare function assertObjectTypeSpreadProperty(node: object | null | undefined, opts?: object | null): asserts node is ObjectTypeSpreadProperty; -declare function assertOpaqueType(node: object | null | undefined, opts?: object | null): asserts node is OpaqueType; -declare function assertQualifiedTypeIdentifier(node: object | null | undefined, opts?: object | null): asserts node is QualifiedTypeIdentifier; -declare function assertStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is StringLiteralTypeAnnotation; -declare function assertStringTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is StringTypeAnnotation; -declare function assertSymbolTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is SymbolTypeAnnotation; -declare function assertThisTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is ThisTypeAnnotation; -declare function assertTupleTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is TupleTypeAnnotation; -declare function assertTypeofTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is TypeofTypeAnnotation; -declare function assertTypeAlias(node: object | null | undefined, opts?: object | null): asserts node is TypeAlias; -declare function assertTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is TypeAnnotation; -declare function assertTypeCastExpression(node: object | null | undefined, opts?: object | null): asserts node is TypeCastExpression; -declare function assertTypeParameter(node: object | null | undefined, opts?: object | null): asserts node is TypeParameter; -declare function assertTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TypeParameterDeclaration; -declare function assertTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): asserts node is TypeParameterInstantiation; -declare function assertUnionTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is UnionTypeAnnotation; -declare function assertVariance(node: object | null | undefined, opts?: object | null): asserts node is Variance; -declare function assertVoidTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is VoidTypeAnnotation; -declare function assertEnumDeclaration(node: object | null | undefined, opts?: object | null): asserts node is EnumDeclaration; -declare function assertEnumBooleanBody(node: object | null | undefined, opts?: object | null): asserts node is EnumBooleanBody; -declare function assertEnumNumberBody(node: object | null | undefined, opts?: object | null): asserts node is EnumNumberBody; -declare function assertEnumStringBody(node: object | null | undefined, opts?: object | null): asserts node is EnumStringBody; -declare function assertEnumSymbolBody(node: object | null | undefined, opts?: object | null): asserts node is EnumSymbolBody; -declare function assertEnumBooleanMember(node: object | null | undefined, opts?: object | null): asserts node is EnumBooleanMember; -declare function assertEnumNumberMember(node: object | null | undefined, opts?: object | null): asserts node is EnumNumberMember; -declare function assertEnumStringMember(node: object | null | undefined, opts?: object | null): asserts node is EnumStringMember; -declare function assertEnumDefaultedMember(node: object | null | undefined, opts?: object | null): asserts node is EnumDefaultedMember; -declare function assertIndexedAccessType(node: object | null | undefined, opts?: object | null): asserts node is IndexedAccessType; -declare function assertOptionalIndexedAccessType(node: object | null | undefined, opts?: object | null): asserts node is OptionalIndexedAccessType; -declare function assertJSXAttribute(node: object | null | undefined, opts?: object | null): asserts node is JSXAttribute; -declare function assertJSXClosingElement(node: object | null | undefined, opts?: object | null): asserts node is JSXClosingElement; -declare function assertJSXElement(node: object | null | undefined, opts?: object | null): asserts node is JSXElement; -declare function assertJSXEmptyExpression(node: object | null | undefined, opts?: object | null): asserts node is JSXEmptyExpression; -declare function assertJSXExpressionContainer(node: object | null | undefined, opts?: object | null): asserts node is JSXExpressionContainer; -declare function assertJSXSpreadChild(node: object | null | undefined, opts?: object | null): asserts node is JSXSpreadChild; -declare function assertJSXIdentifier(node: object | null | undefined, opts?: object | null): asserts node is JSXIdentifier; -declare function assertJSXMemberExpression(node: object | null | undefined, opts?: object | null): asserts node is JSXMemberExpression; -declare function assertJSXNamespacedName(node: object | null | undefined, opts?: object | null): asserts node is JSXNamespacedName; -declare function assertJSXOpeningElement(node: object | null | undefined, opts?: object | null): asserts node is JSXOpeningElement; -declare function assertJSXSpreadAttribute(node: object | null | undefined, opts?: object | null): asserts node is JSXSpreadAttribute; -declare function assertJSXText(node: object | null | undefined, opts?: object | null): asserts node is JSXText; -declare function assertJSXFragment(node: object | null | undefined, opts?: object | null): asserts node is JSXFragment; -declare function assertJSXOpeningFragment(node: object | null | undefined, opts?: object | null): asserts node is JSXOpeningFragment; -declare function assertJSXClosingFragment(node: object | null | undefined, opts?: object | null): asserts node is JSXClosingFragment; -declare function assertNoop(node: object | null | undefined, opts?: object | null): asserts node is Noop; -declare function assertPlaceholder(node: object | null | undefined, opts?: object | null): asserts node is Placeholder; -declare function assertV8IntrinsicIdentifier(node: object | null | undefined, opts?: object | null): asserts node is V8IntrinsicIdentifier; -declare function assertArgumentPlaceholder(node: object | null | undefined, opts?: object | null): asserts node is ArgumentPlaceholder; -declare function assertBindExpression(node: object | null | undefined, opts?: object | null): asserts node is BindExpression; -declare function assertImportAttribute(node: object | null | undefined, opts?: object | null): asserts node is ImportAttribute; -declare function assertDecorator(node: object | null | undefined, opts?: object | null): asserts node is Decorator; -declare function assertDoExpression(node: object | null | undefined, opts?: object | null): asserts node is DoExpression; -declare function assertExportDefaultSpecifier(node: object | null | undefined, opts?: object | null): asserts node is ExportDefaultSpecifier; -declare function assertRecordExpression(node: object | null | undefined, opts?: object | null): asserts node is RecordExpression; -declare function assertTupleExpression(node: object | null | undefined, opts?: object | null): asserts node is TupleExpression; -declare function assertDecimalLiteral(node: object | null | undefined, opts?: object | null): asserts node is DecimalLiteral; -declare function assertStaticBlock(node: object | null | undefined, opts?: object | null): asserts node is StaticBlock; -declare function assertModuleExpression(node: object | null | undefined, opts?: object | null): asserts node is ModuleExpression; -declare function assertTopicReference(node: object | null | undefined, opts?: object | null): asserts node is TopicReference; -declare function assertPipelineTopicExpression(node: object | null | undefined, opts?: object | null): asserts node is PipelineTopicExpression; -declare function assertPipelineBareFunction(node: object | null | undefined, opts?: object | null): asserts node is PipelineBareFunction; -declare function assertPipelinePrimaryTopicReference(node: object | null | undefined, opts?: object | null): asserts node is PipelinePrimaryTopicReference; -declare function assertTSParameterProperty(node: object | null | undefined, opts?: object | null): asserts node is TSParameterProperty; -declare function assertTSDeclareFunction(node: object | null | undefined, opts?: object | null): asserts node is TSDeclareFunction; -declare function assertTSDeclareMethod(node: object | null | undefined, opts?: object | null): asserts node is TSDeclareMethod; -declare function assertTSQualifiedName(node: object | null | undefined, opts?: object | null): asserts node is TSQualifiedName; -declare function assertTSCallSignatureDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TSCallSignatureDeclaration; -declare function assertTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TSConstructSignatureDeclaration; -declare function assertTSPropertySignature(node: object | null | undefined, opts?: object | null): asserts node is TSPropertySignature; -declare function assertTSMethodSignature(node: object | null | undefined, opts?: object | null): asserts node is TSMethodSignature; -declare function assertTSIndexSignature(node: object | null | undefined, opts?: object | null): asserts node is TSIndexSignature; -declare function assertTSAnyKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSAnyKeyword; -declare function assertTSBooleanKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSBooleanKeyword; -declare function assertTSBigIntKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSBigIntKeyword; -declare function assertTSIntrinsicKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSIntrinsicKeyword; -declare function assertTSNeverKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSNeverKeyword; -declare function assertTSNullKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSNullKeyword; -declare function assertTSNumberKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSNumberKeyword; -declare function assertTSObjectKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSObjectKeyword; -declare function assertTSStringKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSStringKeyword; -declare function assertTSSymbolKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSSymbolKeyword; -declare function assertTSUndefinedKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSUndefinedKeyword; -declare function assertTSUnknownKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSUnknownKeyword; -declare function assertTSVoidKeyword(node: object | null | undefined, opts?: object | null): asserts node is TSVoidKeyword; -declare function assertTSThisType(node: object | null | undefined, opts?: object | null): asserts node is TSThisType; -declare function assertTSFunctionType(node: object | null | undefined, opts?: object | null): asserts node is TSFunctionType; -declare function assertTSConstructorType(node: object | null | undefined, opts?: object | null): asserts node is TSConstructorType; -declare function assertTSTypeReference(node: object | null | undefined, opts?: object | null): asserts node is TSTypeReference; -declare function assertTSTypePredicate(node: object | null | undefined, opts?: object | null): asserts node is TSTypePredicate; -declare function assertTSTypeQuery(node: object | null | undefined, opts?: object | null): asserts node is TSTypeQuery; -declare function assertTSTypeLiteral(node: object | null | undefined, opts?: object | null): asserts node is TSTypeLiteral; -declare function assertTSArrayType(node: object | null | undefined, opts?: object | null): asserts node is TSArrayType; -declare function assertTSTupleType(node: object | null | undefined, opts?: object | null): asserts node is TSTupleType; -declare function assertTSOptionalType(node: object | null | undefined, opts?: object | null): asserts node is TSOptionalType; -declare function assertTSRestType(node: object | null | undefined, opts?: object | null): asserts node is TSRestType; -declare function assertTSNamedTupleMember(node: object | null | undefined, opts?: object | null): asserts node is TSNamedTupleMember; -declare function assertTSUnionType(node: object | null | undefined, opts?: object | null): asserts node is TSUnionType; -declare function assertTSIntersectionType(node: object | null | undefined, opts?: object | null): asserts node is TSIntersectionType; -declare function assertTSConditionalType(node: object | null | undefined, opts?: object | null): asserts node is TSConditionalType; -declare function assertTSInferType(node: object | null | undefined, opts?: object | null): asserts node is TSInferType; -declare function assertTSParenthesizedType(node: object | null | undefined, opts?: object | null): asserts node is TSParenthesizedType; -declare function assertTSTypeOperator(node: object | null | undefined, opts?: object | null): asserts node is TSTypeOperator; -declare function assertTSIndexedAccessType(node: object | null | undefined, opts?: object | null): asserts node is TSIndexedAccessType; -declare function assertTSMappedType(node: object | null | undefined, opts?: object | null): asserts node is TSMappedType; -declare function assertTSLiteralType(node: object | null | undefined, opts?: object | null): asserts node is TSLiteralType; -declare function assertTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object | null): asserts node is TSExpressionWithTypeArguments; -declare function assertTSInterfaceDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TSInterfaceDeclaration; -declare function assertTSInterfaceBody(node: object | null | undefined, opts?: object | null): asserts node is TSInterfaceBody; -declare function assertTSTypeAliasDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TSTypeAliasDeclaration; -declare function assertTSAsExpression(node: object | null | undefined, opts?: object | null): asserts node is TSAsExpression; -declare function assertTSTypeAssertion(node: object | null | undefined, opts?: object | null): asserts node is TSTypeAssertion; -declare function assertTSEnumDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TSEnumDeclaration; -declare function assertTSEnumMember(node: object | null | undefined, opts?: object | null): asserts node is TSEnumMember; -declare function assertTSModuleDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TSModuleDeclaration; -declare function assertTSModuleBlock(node: object | null | undefined, opts?: object | null): asserts node is TSModuleBlock; -declare function assertTSImportType(node: object | null | undefined, opts?: object | null): asserts node is TSImportType; -declare function assertTSImportEqualsDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TSImportEqualsDeclaration; -declare function assertTSExternalModuleReference(node: object | null | undefined, opts?: object | null): asserts node is TSExternalModuleReference; -declare function assertTSNonNullExpression(node: object | null | undefined, opts?: object | null): asserts node is TSNonNullExpression; -declare function assertTSExportAssignment(node: object | null | undefined, opts?: object | null): asserts node is TSExportAssignment; -declare function assertTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TSNamespaceExportDeclaration; -declare function assertTSTypeAnnotation(node: object | null | undefined, opts?: object | null): asserts node is TSTypeAnnotation; -declare function assertTSTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): asserts node is TSTypeParameterInstantiation; -declare function assertTSTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): asserts node is TSTypeParameterDeclaration; -declare function assertTSTypeParameter(node: object | null | undefined, opts?: object | null): asserts node is TSTypeParameter; -declare function assertExpression(node: object | null | undefined, opts?: object | null): asserts node is Expression; -declare function assertBinary(node: object | null | undefined, opts?: object | null): asserts node is Binary; -declare function assertScopable(node: object | null | undefined, opts?: object | null): asserts node is Scopable; -declare function assertBlockParent(node: object | null | undefined, opts?: object | null): asserts node is BlockParent; -declare function assertBlock(node: object | null | undefined, opts?: object | null): asserts node is Block; -declare function assertStatement(node: object | null | undefined, opts?: object | null): asserts node is Statement; -declare function assertTerminatorless(node: object | null | undefined, opts?: object | null): asserts node is Terminatorless; -declare function assertCompletionStatement(node: object | null | undefined, opts?: object | null): asserts node is CompletionStatement; -declare function assertConditional(node: object | null | undefined, opts?: object | null): asserts node is Conditional; -declare function assertLoop(node: object | null | undefined, opts?: object | null): asserts node is Loop; -declare function assertWhile(node: object | null | undefined, opts?: object | null): asserts node is While; -declare function assertExpressionWrapper(node: object | null | undefined, opts?: object | null): asserts node is ExpressionWrapper; -declare function assertFor(node: object | null | undefined, opts?: object | null): asserts node is For; -declare function assertForXStatement(node: object | null | undefined, opts?: object | null): asserts node is ForXStatement; -declare function assertFunction(node: object | null | undefined, opts?: object | null): asserts node is Function; -declare function assertFunctionParent(node: object | null | undefined, opts?: object | null): asserts node is FunctionParent; -declare function assertPureish(node: object | null | undefined, opts?: object | null): asserts node is Pureish; -declare function assertDeclaration(node: object | null | undefined, opts?: object | null): asserts node is Declaration; -declare function assertPatternLike(node: object | null | undefined, opts?: object | null): asserts node is PatternLike; -declare function assertLVal(node: object | null | undefined, opts?: object | null): asserts node is LVal; -declare function assertTSEntityName(node: object | null | undefined, opts?: object | null): asserts node is TSEntityName; -declare function assertLiteral(node: object | null | undefined, opts?: object | null): asserts node is Literal; -declare function assertImmutable(node: object | null | undefined, opts?: object | null): asserts node is Immutable; -declare function assertUserWhitespacable(node: object | null | undefined, opts?: object | null): asserts node is UserWhitespacable; -declare function assertMethod(node: object | null | undefined, opts?: object | null): asserts node is Method; -declare function assertObjectMember(node: object | null | undefined, opts?: object | null): asserts node is ObjectMember; -declare function assertProperty(node: object | null | undefined, opts?: object | null): asserts node is Property; -declare function assertUnaryLike(node: object | null | undefined, opts?: object | null): asserts node is UnaryLike; -declare function assertPattern(node: object | null | undefined, opts?: object | null): asserts node is Pattern; -declare function assertClass(node: object | null | undefined, opts?: object | null): asserts node is Class; -declare function assertModuleDeclaration(node: object | null | undefined, opts?: object | null): asserts node is ModuleDeclaration; -declare function assertExportDeclaration(node: object | null | undefined, opts?: object | null): asserts node is ExportDeclaration; -declare function assertModuleSpecifier(node: object | null | undefined, opts?: object | null): asserts node is ModuleSpecifier; -declare function assertPrivate(node: object | null | undefined, opts?: object | null): asserts node is Private; -declare function assertFlow(node: object | null | undefined, opts?: object | null): asserts node is Flow; -declare function assertFlowType(node: object | null | undefined, opts?: object | null): asserts node is FlowType; -declare function assertFlowBaseAnnotation(node: object | null | undefined, opts?: object | null): asserts node is FlowBaseAnnotation; -declare function assertFlowDeclaration(node: object | null | undefined, opts?: object | null): asserts node is FlowDeclaration; -declare function assertFlowPredicate(node: object | null | undefined, opts?: object | null): asserts node is FlowPredicate; -declare function assertEnumBody(node: object | null | undefined, opts?: object | null): asserts node is EnumBody; -declare function assertEnumMember(node: object | null | undefined, opts?: object | null): asserts node is EnumMember; -declare function assertJSX(node: object | null | undefined, opts?: object | null): asserts node is JSX; -declare function assertTSTypeElement(node: object | null | undefined, opts?: object | null): asserts node is TSTypeElement; -declare function assertTSType(node: object | null | undefined, opts?: object | null): asserts node is TSType; -declare function assertTSBaseType(node: object | null | undefined, opts?: object | null): asserts node is TSBaseType; -declare function assertNumberLiteral(node: any, opts: any): void; -declare function assertRegexLiteral(node: any, opts: any): void; -declare function assertRestProperty(node: any, opts: any): void; -declare function assertSpreadProperty(node: any, opts: any): void; - -/** - * Create a type annotation based on typeof expression. - */ -declare function createTypeAnnotationBasedOnTypeof(type: "string" | "number" | "undefined" | "boolean" | "function" | "object" | "symbol"): StringTypeAnnotation | VoidTypeAnnotation | NumberTypeAnnotation | BooleanTypeAnnotation | GenericTypeAnnotation | AnyTypeAnnotation; - -/** - * Takes an array of `types` and flattens them, removing duplicates and - * returns a `UnionTypeAnnotation` node containing them. - */ -declare function createFlowUnionType(types: [T] | Array): T | UnionTypeAnnotation; - -/** - * Takes an array of `types` and flattens them, removing duplicates and - * returns a `UnionTypeAnnotation` node containing them. - */ -declare function createTSUnionType(typeAnnotations: Array): TSType; - -declare function arrayExpression(elements?: Array): ArrayExpression; -declare function assignmentExpression(operator: string, left: LVal, right: Expression): AssignmentExpression; -declare function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left: Expression | PrivateName, right: Expression): BinaryExpression; -declare function interpreterDirective(value: string): InterpreterDirective; -declare function directive(value: DirectiveLiteral): Directive; -declare function directiveLiteral(value: string): DirectiveLiteral; -declare function blockStatement(body: Array, directives?: Array): BlockStatement; -declare function breakStatement(label?: Identifier | null): BreakStatement; -declare function callExpression(callee: Expression | V8IntrinsicIdentifier, _arguments: Array): CallExpression; -declare function catchClause(param: Identifier | ArrayPattern | ObjectPattern | null | undefined, body: BlockStatement): CatchClause; -declare function conditionalExpression(test: Expression, consequent: Expression, alternate: Expression): ConditionalExpression; -declare function continueStatement(label?: Identifier | null): ContinueStatement; -declare function debuggerStatement(): DebuggerStatement; -declare function doWhileStatement(test: Expression, body: Statement): DoWhileStatement; -declare function emptyStatement(): EmptyStatement; -declare function expressionStatement(expression: Expression): ExpressionStatement; -declare function file(program: Program, comments?: Array | null, tokens?: Array | null): File; -declare function forInStatement(left: VariableDeclaration | LVal, right: Expression, body: Statement): ForInStatement; -declare function forStatement(init: VariableDeclaration | Expression | null | undefined, test: Expression | null | undefined, update: Expression | null | undefined, body: Statement): ForStatement; -declare function functionDeclaration(id: Identifier | null | undefined, params: Array, body: BlockStatement, generator?: boolean, async?: boolean): FunctionDeclaration; -declare function functionExpression(id: Identifier | null | undefined, params: Array, body: BlockStatement, generator?: boolean, async?: boolean): FunctionExpression; -declare function identifier(name: string): Identifier; -declare function ifStatement(test: Expression, consequent: Statement, alternate?: Statement | null): IfStatement; -declare function labeledStatement(label: Identifier, body: Statement): LabeledStatement; -declare function stringLiteral(value: string): StringLiteral; -declare function numericLiteral(value: number): NumericLiteral; -declare function nullLiteral(): NullLiteral; -declare function booleanLiteral(value: boolean): BooleanLiteral; -declare function regExpLiteral(pattern: string, flags?: string): RegExpLiteral; -declare function logicalExpression(operator: "||" | "&&" | "??", left: Expression, right: Expression): LogicalExpression; -declare function memberExpression(object: Expression, property: Expression | Identifier | PrivateName, computed?: boolean, optional?: true | false | null): MemberExpression; -declare function newExpression(callee: Expression | V8IntrinsicIdentifier, _arguments: Array): NewExpression; -declare function program(body: Array, directives?: Array, sourceType?: "script" | "module", interpreter?: InterpreterDirective | null): Program; -declare function objectExpression(properties: Array): ObjectExpression; -declare function objectMethod(kind: "method" | "get" | "set" | undefined, key: Expression | Identifier | StringLiteral | NumericLiteral, params: Array, body: BlockStatement, computed?: boolean, generator?: boolean, async?: boolean): ObjectMethod; -declare function objectProperty(key: Expression | Identifier | StringLiteral | NumericLiteral, value: Expression | PatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array | null): ObjectProperty; -declare function restElement(argument: LVal): RestElement; -declare function returnStatement(argument?: Expression | null): ReturnStatement; -declare function sequenceExpression(expressions: Array): SequenceExpression; -declare function parenthesizedExpression(expression: Expression): ParenthesizedExpression; -declare function switchCase(test: Expression | null | undefined, consequent: Array): SwitchCase; -declare function switchStatement(discriminant: Expression, cases: Array): SwitchStatement; -declare function thisExpression(): ThisExpression; -declare function throwStatement(argument: Expression): ThrowStatement; -declare function tryStatement(block: BlockStatement, handler?: CatchClause | null, finalizer?: BlockStatement | null): TryStatement; -declare function unaryExpression(operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof", argument: Expression, prefix?: boolean): UnaryExpression; -declare function updateExpression(operator: "++" | "--", argument: Expression, prefix?: boolean): UpdateExpression; -declare function variableDeclaration(kind: "var" | "let" | "const", declarations: Array): VariableDeclaration; -declare function variableDeclarator(id: LVal, init?: Expression | null): VariableDeclarator; -declare function whileStatement(test: Expression, body: Statement): WhileStatement; -declare function withStatement(object: Expression, body: Statement): WithStatement; -declare function assignmentPattern(left: Identifier | ObjectPattern | ArrayPattern | MemberExpression, right: Expression): AssignmentPattern; -declare function arrayPattern(elements: Array): ArrayPattern; -declare function arrowFunctionExpression(params: Array, body: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression; -declare function classBody(body: Array): ClassBody; -declare function classExpression(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array | null): ClassExpression; -declare function classDeclaration(id: Identifier, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array | null): ClassDeclaration; -declare function exportAllDeclaration(source: StringLiteral): ExportAllDeclaration; -declare function exportDefaultDeclaration(declaration: FunctionDeclaration | TSDeclareFunction | ClassDeclaration | Expression): ExportDefaultDeclaration; -declare function exportNamedDeclaration(declaration?: Declaration | null, specifiers?: Array, source?: StringLiteral | null): ExportNamedDeclaration; -declare function exportSpecifier(local: Identifier, exported: Identifier | StringLiteral): ExportSpecifier; -declare function forOfStatement(left: VariableDeclaration | LVal, right: Expression, body: Statement, _await?: boolean): ForOfStatement; -declare function importDeclaration(specifiers: Array, source: StringLiteral): ImportDeclaration; -declare function importDefaultSpecifier(local: Identifier): ImportDefaultSpecifier; -declare function importNamespaceSpecifier(local: Identifier): ImportNamespaceSpecifier; -declare function importSpecifier(local: Identifier, imported: Identifier | StringLiteral): ImportSpecifier; -declare function metaProperty(meta: Identifier, property: Identifier): MetaProperty; -declare function classMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: Identifier | StringLiteral | NumericLiteral | Expression, params: Array, body: BlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): ClassMethod; -declare function objectPattern(properties: Array): ObjectPattern; -declare function spreadElement(argument: Expression): SpreadElement; -declare function _super(): Super; - -declare function taggedTemplateExpression(tag: Expression, quasi: TemplateLiteral): TaggedTemplateExpression; -declare function templateElement(value: { - raw: string; - cooked?: string; -}, tail?: boolean): TemplateElement; -declare function templateLiteral(quasis: Array, expressions: Array): TemplateLiteral; -declare function yieldExpression(argument?: Expression | null, delegate?: boolean): YieldExpression; -declare function awaitExpression(argument: Expression): AwaitExpression; -declare function _import(): Import; - -declare function bigIntLiteral(value: string): BigIntLiteral; -declare function exportNamespaceSpecifier(exported: Identifier): ExportNamespaceSpecifier; -declare function optionalMemberExpression(object: Expression, property: Expression | Identifier, computed: boolean | undefined, optional: boolean): OptionalMemberExpression; -declare function optionalCallExpression(callee: Expression, _arguments: Array, optional: boolean): OptionalCallExpression; -declare function classProperty(key: Identifier | StringLiteral | NumericLiteral | Expression, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Array | null, computed?: boolean, _static?: boolean): ClassProperty; -declare function classPrivateProperty(key: PrivateName, value: Expression | null | undefined, decorators: Array | null | undefined, _static: any): ClassPrivateProperty; -declare function classPrivateMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: PrivateName, params: Array, body: BlockStatement, _static?: boolean): ClassPrivateMethod; -declare function privateName(id: Identifier): PrivateName; -declare function anyTypeAnnotation(): AnyTypeAnnotation; -declare function arrayTypeAnnotation(elementType: FlowType): ArrayTypeAnnotation; -declare function booleanTypeAnnotation(): BooleanTypeAnnotation; -declare function booleanLiteralTypeAnnotation(value: boolean): BooleanLiteralTypeAnnotation; -declare function nullLiteralTypeAnnotation(): NullLiteralTypeAnnotation; -declare function classImplements(id: Identifier, typeParameters?: TypeParameterInstantiation | null): ClassImplements; -declare function declareClass(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: ObjectTypeAnnotation): DeclareClass; -declare function declareFunction(id: Identifier): DeclareFunction; -declare function declareInterface(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: ObjectTypeAnnotation): DeclareInterface; -declare function declareModule(id: Identifier | StringLiteral, body: BlockStatement, kind?: "CommonJS" | "ES" | null): DeclareModule; -declare function declareModuleExports(typeAnnotation: TypeAnnotation): DeclareModuleExports; -declare function declareTypeAlias(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, right: FlowType): DeclareTypeAlias; -declare function declareOpaqueType(id: Identifier, typeParameters?: TypeParameterDeclaration | null, supertype?: FlowType | null): DeclareOpaqueType; -declare function declareVariable(id: Identifier): DeclareVariable; -declare function declareExportDeclaration(declaration?: Flow | null, specifiers?: Array | null, source?: StringLiteral | null): DeclareExportDeclaration; -declare function declareExportAllDeclaration(source: StringLiteral): DeclareExportAllDeclaration; -declare function declaredPredicate(value: Flow): DeclaredPredicate; -declare function existsTypeAnnotation(): ExistsTypeAnnotation; -declare function functionTypeAnnotation(typeParameters: TypeParameterDeclaration | null | undefined, params: Array, rest: FunctionTypeParam | null | undefined, returnType: FlowType): FunctionTypeAnnotation; -declare function functionTypeParam(name: Identifier | null | undefined, typeAnnotation: FlowType): FunctionTypeParam; -declare function genericTypeAnnotation(id: Identifier | QualifiedTypeIdentifier, typeParameters?: TypeParameterInstantiation | null): GenericTypeAnnotation; -declare function inferredPredicate(): InferredPredicate; -declare function interfaceExtends(id: Identifier | QualifiedTypeIdentifier, typeParameters?: TypeParameterInstantiation | null): InterfaceExtends; -declare function interfaceDeclaration(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: ObjectTypeAnnotation): InterfaceDeclaration; -declare function interfaceTypeAnnotation(_extends: Array | null | undefined, body: ObjectTypeAnnotation): InterfaceTypeAnnotation; -declare function intersectionTypeAnnotation(types: Array): IntersectionTypeAnnotation; -declare function mixedTypeAnnotation(): MixedTypeAnnotation; -declare function emptyTypeAnnotation(): EmptyTypeAnnotation; -declare function nullableTypeAnnotation(typeAnnotation: FlowType): NullableTypeAnnotation; -declare function numberLiteralTypeAnnotation(value: number): NumberLiteralTypeAnnotation; -declare function numberTypeAnnotation(): NumberTypeAnnotation; -declare function objectTypeAnnotation(properties: Array, indexers?: Array | null, callProperties?: Array | null, internalSlots?: Array | null, exact?: boolean): ObjectTypeAnnotation; -declare function objectTypeInternalSlot(id: Identifier, value: FlowType, optional: boolean, _static: boolean, method: boolean): ObjectTypeInternalSlot; -declare function objectTypeCallProperty(value: FlowType): ObjectTypeCallProperty; -declare function objectTypeIndexer(id: Identifier | null | undefined, key: FlowType, value: FlowType, variance?: Variance | null): ObjectTypeIndexer; -declare function objectTypeProperty(key: Identifier | StringLiteral, value: FlowType, variance?: Variance | null): ObjectTypeProperty; -declare function objectTypeSpreadProperty(argument: FlowType): ObjectTypeSpreadProperty; -declare function opaqueType(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, supertype: FlowType | null | undefined, impltype: FlowType): OpaqueType; -declare function qualifiedTypeIdentifier(id: Identifier, qualification: Identifier | QualifiedTypeIdentifier): QualifiedTypeIdentifier; -declare function stringLiteralTypeAnnotation(value: string): StringLiteralTypeAnnotation; -declare function stringTypeAnnotation(): StringTypeAnnotation; -declare function symbolTypeAnnotation(): SymbolTypeAnnotation; -declare function thisTypeAnnotation(): ThisTypeAnnotation; -declare function tupleTypeAnnotation(types: Array): TupleTypeAnnotation; -declare function typeofTypeAnnotation(argument: FlowType): TypeofTypeAnnotation; -declare function typeAlias(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, right: FlowType): TypeAlias; -declare function typeAnnotation(typeAnnotation: FlowType): TypeAnnotation; -declare function typeCastExpression(expression: Expression, typeAnnotation: TypeAnnotation): TypeCastExpression; -declare function typeParameter(bound?: TypeAnnotation | null, _default?: FlowType | null, variance?: Variance | null): TypeParameter; -declare function typeParameterDeclaration(params: Array): TypeParameterDeclaration; -declare function typeParameterInstantiation(params: Array): TypeParameterInstantiation; -declare function unionTypeAnnotation(types: Array): UnionTypeAnnotation; -declare function variance(kind: "minus" | "plus"): Variance; -declare function voidTypeAnnotation(): VoidTypeAnnotation; -declare function enumDeclaration(id: Identifier, body: EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody): EnumDeclaration; -declare function enumBooleanBody(members: Array): EnumBooleanBody; -declare function enumNumberBody(members: Array): EnumNumberBody; -declare function enumStringBody(members: Array): EnumStringBody; -declare function enumSymbolBody(members: Array): EnumSymbolBody; -declare function enumBooleanMember(id: Identifier): EnumBooleanMember; -declare function enumNumberMember(id: Identifier, init: NumericLiteral): EnumNumberMember; -declare function enumStringMember(id: Identifier, init: StringLiteral): EnumStringMember; -declare function enumDefaultedMember(id: Identifier): EnumDefaultedMember; -declare function indexedAccessType(objectType: FlowType, indexType: FlowType): IndexedAccessType; -declare function optionalIndexedAccessType(objectType: FlowType, indexType: FlowType): OptionalIndexedAccessType; -declare function jsxAttribute(name: JSXIdentifier | JSXNamespacedName, value?: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer | null): JSXAttribute; - -declare function jsxClosingElement(name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName): JSXClosingElement; - -declare function jsxElement(openingElement: JSXOpeningElement, closingElement: JSXClosingElement | null | undefined, children: Array, selfClosing?: boolean | null): JSXElement; - -declare function jsxEmptyExpression(): JSXEmptyExpression; - -declare function jsxExpressionContainer(expression: Expression | JSXEmptyExpression): JSXExpressionContainer; - -declare function jsxSpreadChild(expression: Expression): JSXSpreadChild; - -declare function jsxIdentifier(name: string): JSXIdentifier; - -declare function jsxMemberExpression(object: JSXMemberExpression | JSXIdentifier, property: JSXIdentifier): JSXMemberExpression; - -declare function jsxNamespacedName(namespace: JSXIdentifier, name: JSXIdentifier): JSXNamespacedName; - -declare function jsxOpeningElement(name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName, attributes: Array, selfClosing?: boolean): JSXOpeningElement; - -declare function jsxSpreadAttribute(argument: Expression): JSXSpreadAttribute; - -declare function jsxText(value: string): JSXText; - -declare function jsxFragment(openingFragment: JSXOpeningFragment, closingFragment: JSXClosingFragment, children: Array): JSXFragment; - -declare function jsxOpeningFragment(): JSXOpeningFragment; - -declare function jsxClosingFragment(): JSXClosingFragment; - -declare function noop(): Noop; -declare function placeholder(expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern", name: Identifier): Placeholder; -declare function v8IntrinsicIdentifier(name: string): V8IntrinsicIdentifier; -declare function argumentPlaceholder(): ArgumentPlaceholder; -declare function bindExpression(object: Expression, callee: Expression): BindExpression; -declare function importAttribute(key: Identifier | StringLiteral, value: StringLiteral): ImportAttribute; -declare function decorator(expression: Expression): Decorator; -declare function doExpression(body: BlockStatement, async?: boolean): DoExpression; -declare function exportDefaultSpecifier(exported: Identifier): ExportDefaultSpecifier; -declare function recordExpression(properties: Array): RecordExpression; -declare function tupleExpression(elements?: Array): TupleExpression; -declare function decimalLiteral(value: string): DecimalLiteral; -declare function staticBlock(body: Array): StaticBlock; -declare function moduleExpression(body: Program): ModuleExpression; -declare function topicReference(): TopicReference; -declare function pipelineTopicExpression(expression: Expression): PipelineTopicExpression; -declare function pipelineBareFunction(callee: Expression): PipelineBareFunction; -declare function pipelinePrimaryTopicReference(): PipelinePrimaryTopicReference; -declare function tsParameterProperty(parameter: Identifier | AssignmentPattern): TSParameterProperty; - -declare function tsDeclareFunction(id: Identifier | null | undefined, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array, returnType?: TSTypeAnnotation | Noop | null): TSDeclareFunction; - -declare function tsDeclareMethod(decorators: Array | null | undefined, key: Identifier | StringLiteral | NumericLiteral | Expression, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array, returnType?: TSTypeAnnotation | Noop | null): TSDeclareMethod; - -declare function tsQualifiedName(left: TSEntityName, right: Identifier): TSQualifiedName; - -declare function tsCallSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration; - -declare function tsConstructSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration; - -declare function tsPropertySignature(key: Expression, typeAnnotation?: TSTypeAnnotation | null, initializer?: Expression | null): TSPropertySignature; - -declare function tsMethodSignature(key: Expression, typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSMethodSignature; - -declare function tsIndexSignature(parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSIndexSignature; - -declare function tsAnyKeyword(): TSAnyKeyword; - -declare function tsBooleanKeyword(): TSBooleanKeyword; - -declare function tsBigIntKeyword(): TSBigIntKeyword; - -declare function tsIntrinsicKeyword(): TSIntrinsicKeyword; - -declare function tsNeverKeyword(): TSNeverKeyword; - -declare function tsNullKeyword(): TSNullKeyword; - -declare function tsNumberKeyword(): TSNumberKeyword; - -declare function tsObjectKeyword(): TSObjectKeyword; - -declare function tsStringKeyword(): TSStringKeyword; - -declare function tsSymbolKeyword(): TSSymbolKeyword; - -declare function tsUndefinedKeyword(): TSUndefinedKeyword; - -declare function tsUnknownKeyword(): TSUnknownKeyword; - -declare function tsVoidKeyword(): TSVoidKeyword; - -declare function tsThisType(): TSThisType; - -declare function tsFunctionType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSFunctionType; - -declare function tsConstructorType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array, typeAnnotation?: TSTypeAnnotation | null): TSConstructorType; - -declare function tsTypeReference(typeName: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSTypeReference; - -declare function tsTypePredicate(parameterName: Identifier | TSThisType, typeAnnotation?: TSTypeAnnotation | null, asserts?: boolean | null): TSTypePredicate; - -declare function tsTypeQuery(exprName: TSEntityName | TSImportType): TSTypeQuery; - -declare function tsTypeLiteral(members: Array): TSTypeLiteral; - -declare function tsArrayType(elementType: TSType): TSArrayType; - -declare function tsTupleType(elementTypes: Array): TSTupleType; - -declare function tsOptionalType(typeAnnotation: TSType): TSOptionalType; - -declare function tsRestType(typeAnnotation: TSType): TSRestType; - -declare function tsNamedTupleMember(label: Identifier, elementType: TSType, optional?: boolean): TSNamedTupleMember; - -declare function tsUnionType(types: Array): TSUnionType; - -declare function tsIntersectionType(types: Array): TSIntersectionType; - -declare function tsConditionalType(checkType: TSType, extendsType: TSType, trueType: TSType, falseType: TSType): TSConditionalType; - -declare function tsInferType(typeParameter: TSTypeParameter): TSInferType; - -declare function tsParenthesizedType(typeAnnotation: TSType): TSParenthesizedType; - -declare function tsTypeOperator(typeAnnotation: TSType): TSTypeOperator; - -declare function tsIndexedAccessType(objectType: TSType, indexType: TSType): TSIndexedAccessType; - -declare function tsMappedType(typeParameter: TSTypeParameter, typeAnnotation?: TSType | null, nameType?: TSType | null): TSMappedType; - -declare function tsLiteralType(literal: NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | UnaryExpression): TSLiteralType; - -declare function tsExpressionWithTypeArguments(expression: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSExpressionWithTypeArguments; - -declare function tsInterfaceDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, _extends: Array | null | undefined, body: TSInterfaceBody): TSInterfaceDeclaration; - -declare function tsInterfaceBody(body: Array): TSInterfaceBody; - -declare function tsTypeAliasDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, typeAnnotation: TSType): TSTypeAliasDeclaration; - -declare function tsAsExpression(expression: Expression, typeAnnotation: TSType): TSAsExpression; - -declare function tsTypeAssertion(typeAnnotation: TSType, expression: Expression): TSTypeAssertion; - -declare function tsEnumDeclaration(id: Identifier, members: Array): TSEnumDeclaration; - -declare function tsEnumMember(id: Identifier | StringLiteral, initializer?: Expression | null): TSEnumMember; - -declare function tsModuleDeclaration(id: Identifier | StringLiteral, body: TSModuleBlock | TSModuleDeclaration): TSModuleDeclaration; - -declare function tsModuleBlock(body: Array): TSModuleBlock; - -declare function tsImportType(argument: StringLiteral, qualifier?: TSEntityName | null, typeParameters?: TSTypeParameterInstantiation | null): TSImportType; - -declare function tsImportEqualsDeclaration(id: Identifier, moduleReference: TSEntityName | TSExternalModuleReference): TSImportEqualsDeclaration; - -declare function tsExternalModuleReference(expression: StringLiteral): TSExternalModuleReference; - -declare function tsNonNullExpression(expression: Expression): TSNonNullExpression; - -declare function tsExportAssignment(expression: Expression): TSExportAssignment; - -declare function tsNamespaceExportDeclaration(id: Identifier): TSNamespaceExportDeclaration; - -declare function tsTypeAnnotation(typeAnnotation: TSType): TSTypeAnnotation; - -declare function tsTypeParameterInstantiation(params: Array): TSTypeParameterInstantiation; - -declare function tsTypeParameterDeclaration(params: Array): TSTypeParameterDeclaration; - -declare function tsTypeParameter(constraint: TSType | null | undefined, _default: TSType | null | undefined, name: string): TSTypeParameter; - -/** @deprecated */ -declare function NumberLiteral(...args: Array): any; - -/** @deprecated */ -declare function RegexLiteral(...args: Array): any; - -/** @deprecated */ -declare function RestProperty(...args: Array): any; - -/** @deprecated */ -declare function SpreadProperty(...args: Array): any; - -/** - * Create a clone of a `node` including only properties belonging to the node. - * If the second parameter is `false`, cloneNode performs a shallow clone. - * If the third parameter is true, the cloned nodes exclude location properties. - */ -declare function cloneNode(node: T, deep?: boolean, withoutLoc?: boolean): T; - -/** - * Create a shallow clone of a `node`, including only - * properties belonging to the node. - * @deprecated Use t.cloneNode instead. - */ -declare function clone(node: T): T; - -/** - * Create a deep clone of a `node` and all of it's child nodes - * including only properties belonging to the node. - * @deprecated Use t.cloneNode instead. - */ -declare function cloneDeep(node: T): T; - -/** - * Create a deep clone of a `node` and all of it's child nodes - * including only properties belonging to the node. - * excluding `_private` and location properties. - */ -declare function cloneDeepWithoutLoc(node: T): T; - -/** - * Create a shallow clone of a `node` excluding `_private` and location properties. - */ -declare function cloneWithoutLoc(node: T): T; - -/** - * Add comment of certain type to a node. - */ -declare function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T; - -/** - * Add comments of certain type to a node. - */ -declare function addComments(node: T, type: CommentTypeShorthand, comments: ReadonlyArray): T; - -declare function inheritInnerComments(child: Node, parent: Node): void; - -declare function inheritLeadingComments(child: Node, parent: Node): void; - -/** - * Inherit all unique comments from `parent` node to `child` node. - */ -declare function inheritsComments(child: T, parent: Node): T; - -declare function inheritTrailingComments(child: Node, parent: Node): void; - -/** - * Remove comment properties from a node. - */ -declare function removeComments(node: T): T; - -declare const EXPRESSION_TYPES: string[]; -declare const BINARY_TYPES: string[]; -declare const SCOPABLE_TYPES: string[]; -declare const BLOCKPARENT_TYPES: string[]; -declare const BLOCK_TYPES: string[]; -declare const STATEMENT_TYPES: string[]; -declare const TERMINATORLESS_TYPES: string[]; -declare const COMPLETIONSTATEMENT_TYPES: string[]; -declare const CONDITIONAL_TYPES: string[]; -declare const LOOP_TYPES: string[]; -declare const WHILE_TYPES: string[]; -declare const EXPRESSIONWRAPPER_TYPES: string[]; -declare const FOR_TYPES: string[]; -declare const FORXSTATEMENT_TYPES: string[]; -declare const FUNCTION_TYPES: string[]; -declare const FUNCTIONPARENT_TYPES: string[]; -declare const PUREISH_TYPES: string[]; -declare const DECLARATION_TYPES: string[]; -declare const PATTERNLIKE_TYPES: string[]; -declare const LVAL_TYPES: string[]; -declare const TSENTITYNAME_TYPES: string[]; -declare const LITERAL_TYPES: string[]; -declare const IMMUTABLE_TYPES: string[]; -declare const USERWHITESPACABLE_TYPES: string[]; -declare const METHOD_TYPES: string[]; -declare const OBJECTMEMBER_TYPES: string[]; -declare const PROPERTY_TYPES: string[]; -declare const UNARYLIKE_TYPES: string[]; -declare const PATTERN_TYPES: string[]; -declare const CLASS_TYPES: string[]; -declare const MODULEDECLARATION_TYPES: string[]; -declare const EXPORTDECLARATION_TYPES: string[]; -declare const MODULESPECIFIER_TYPES: string[]; -declare const PRIVATE_TYPES: string[]; -declare const FLOW_TYPES: string[]; -declare const FLOWTYPE_TYPES: string[]; -declare const FLOWBASEANNOTATION_TYPES: string[]; -declare const FLOWDECLARATION_TYPES: string[]; -declare const FLOWPREDICATE_TYPES: string[]; -declare const ENUMBODY_TYPES: string[]; -declare const ENUMMEMBER_TYPES: string[]; -declare const JSX_TYPES: string[]; -declare const TSTYPEELEMENT_TYPES: string[]; -declare const TSTYPE_TYPES: string[]; -declare const TSBASETYPE_TYPES: string[]; - -declare const STATEMENT_OR_BLOCK_KEYS: string[]; -declare const FLATTENABLE_KEYS: string[]; -declare const FOR_INIT_KEYS: string[]; -declare const COMMENT_KEYS: string[]; -declare const LOGICAL_OPERATORS: string[]; -declare const UPDATE_OPERATORS: string[]; -declare const BOOLEAN_NUMBER_BINARY_OPERATORS: string[]; -declare const EQUALITY_BINARY_OPERATORS: string[]; -declare const COMPARISON_BINARY_OPERATORS: string[]; -declare const BOOLEAN_BINARY_OPERATORS: string[]; -declare const NUMBER_BINARY_OPERATORS: string[]; -declare const BINARY_OPERATORS: string[]; -declare const ASSIGNMENT_OPERATORS: string[]; -declare const BOOLEAN_UNARY_OPERATORS: string[]; -declare const NUMBER_UNARY_OPERATORS: string[]; -declare const STRING_UNARY_OPERATORS: string[]; -declare const UNARY_OPERATORS: string[]; -declare const INHERIT_KEYS: { - optional: string[]; - force: string[]; -}; -declare const BLOCK_SCOPED_SYMBOL: unique symbol; -declare const NOT_LOCAL_BINDING: unique symbol; - -/** - * Ensure the `key` (defaults to "body") of a `node` is a block. - * Casting it to a block if it is not. - * - * Returns the BlockStatement - */ -declare function ensureBlock(node: Node, key?: string): BlockStatement; - -declare function toBindingIdentifierName(name: string): string; - -declare function toBlock(node: Statement | Expression, parent?: Node): BlockStatement; - -declare function toComputedKey(node: ObjectMember | ObjectProperty | ClassMethod | ClassProperty | MemberExpression | OptionalMemberExpression, key?: Expression): Expression; - -declare const _default$3: { - (node: Function): FunctionExpression; - (node: Class): ClassExpression; - (node: ExpressionStatement | Expression | Class | Function): Expression; -}; -//# sourceMappingURL=toExpression.d.ts.map - -declare function toIdentifier(input: string): string; - -declare function toKeyAlias(node: Method | Property, key?: Node): string; -declare namespace toKeyAlias { - var uid: number; - var increment: () => number; -} -//# sourceMappingURL=toKeyAlias.d.ts.map - -declare type Scope = { - push(value: { - id: LVal; - kind: "var"; - init?: Expression; - }): void; - buildUndefinedNode(): Node; -}; - -/** - * Turn an array of statement `nodes` into a `SequenceExpression`. - * - * Variable declarations are turned into simple assignments and their - * declarations hoisted to the top of the current scope. - * - * Expression statements are just resolved to their expression. - */ -declare function toSequenceExpression(nodes: ReadonlyArray, scope: Scope): SequenceExpression | undefined; - -declare const _default$2: { - (node: AssignmentExpression, ignore?: boolean): ExpressionStatement; - (node: T, ignore: false): T; - (node: T_1, ignore?: boolean): false | T_1; - (node: Class, ignore: false): ClassDeclaration; - (node: Class, ignore?: boolean): ClassDeclaration | false; - (node: Function, ignore: false): FunctionDeclaration; - (node: Function, ignore?: boolean): FunctionDeclaration | false; - (node: Node, ignore: false): Statement; - (node: Node, ignore?: boolean): Statement | false; -}; -//# sourceMappingURL=toStatement.d.ts.map - -declare const _default$1: { - (value: undefined): Identifier; - (value: boolean): BooleanLiteral; - (value: null): NullLiteral; - (value: string): StringLiteral; - (value: number): NumericLiteral | BinaryExpression | UnaryExpression; - (value: RegExp): RegExpLiteral; - (value: ReadonlyArray): ArrayExpression; - (value: object): ObjectExpression; - (value: unknown): Expression; -}; -//# sourceMappingURL=valueToNode.d.ts.map - -declare const VISITOR_KEYS: Record; -declare const ALIAS_KEYS: Record; -declare const FLIPPED_ALIAS_KEYS: Record; -declare const NODE_FIELDS: Record; -declare const BUILDER_KEYS: Record; -declare const DEPRECATED_KEYS: Record; -declare const NODE_PARENT_VALIDATIONS: {}; - -declare const PLACEHOLDERS: string[]; -declare const PLACEHOLDERS_ALIAS: Record; -declare const PLACEHOLDERS_FLIPPED_ALIAS: Record; - -declare const TYPES: Array; -//# sourceMappingURL=index.d.ts.map - -/** - * Append a node to a member expression. - */ -declare function appendToMemberExpression(member: MemberExpression, append: MemberExpression["property"], computed?: boolean): MemberExpression; - -/** - * Inherit all contextual properties from `parent` node to `child` node. - */ -declare function inherits(child: T, parent: Node | null | undefined): T; - -/** - * Prepend a node to a member expression. - */ -declare function prependToMemberExpression>(member: T, prepend: MemberExpression["object"]): T; - -/** - * Remove all of the _* properties from a node along with the additional metadata - * properties like location data and raw token data. - */ -declare function removeProperties(node: Node, opts?: { - preserveComments?: boolean; -}): void; - -declare function removePropertiesDeep(tree: T, opts?: { - preserveComments: boolean; -} | null): T; - -/** - * Dedupe type annotations. - */ -declare function removeTypeDuplicates(nodes: ReadonlyArray): FlowType[]; - -declare function getBindingIdentifiers(node: Node, duplicates: true, outerOnly?: boolean): Record>; -declare namespace getBindingIdentifiers { - var keys: { - DeclareClass: string[]; - DeclareFunction: string[]; - DeclareModule: string[]; - DeclareVariable: string[]; - DeclareInterface: string[]; - DeclareTypeAlias: string[]; - DeclareOpaqueType: string[]; - InterfaceDeclaration: string[]; - TypeAlias: string[]; - OpaqueType: string[]; - CatchClause: string[]; - LabeledStatement: string[]; - UnaryExpression: string[]; - AssignmentExpression: string[]; - ImportSpecifier: string[]; - ImportNamespaceSpecifier: string[]; - ImportDefaultSpecifier: string[]; - ImportDeclaration: string[]; - ExportSpecifier: string[]; - ExportNamespaceSpecifier: string[]; - ExportDefaultSpecifier: string[]; - FunctionDeclaration: string[]; - FunctionExpression: string[]; - ArrowFunctionExpression: string[]; - ObjectMethod: string[]; - ClassMethod: string[]; - ClassPrivateMethod: string[]; - ForInStatement: string[]; - ForOfStatement: string[]; - ClassDeclaration: string[]; - ClassExpression: string[]; - RestElement: string[]; - UpdateExpression: string[]; - ObjectProperty: string[]; - AssignmentPattern: string[]; - ArrayPattern: string[]; - ObjectPattern: string[]; - VariableDeclaration: string[]; - VariableDeclarator: string[]; - }; -} -declare function getBindingIdentifiers(node: Node, duplicates?: false, outerOnly?: boolean): Record; -declare namespace getBindingIdentifiers { - var keys: { - DeclareClass: string[]; - DeclareFunction: string[]; - DeclareModule: string[]; - DeclareVariable: string[]; - DeclareInterface: string[]; - DeclareTypeAlias: string[]; - DeclareOpaqueType: string[]; - InterfaceDeclaration: string[]; - TypeAlias: string[]; - OpaqueType: string[]; - CatchClause: string[]; - LabeledStatement: string[]; - UnaryExpression: string[]; - AssignmentExpression: string[]; - ImportSpecifier: string[]; - ImportNamespaceSpecifier: string[]; - ImportDefaultSpecifier: string[]; - ImportDeclaration: string[]; - ExportSpecifier: string[]; - ExportNamespaceSpecifier: string[]; - ExportDefaultSpecifier: string[]; - FunctionDeclaration: string[]; - FunctionExpression: string[]; - ArrowFunctionExpression: string[]; - ObjectMethod: string[]; - ClassMethod: string[]; - ClassPrivateMethod: string[]; - ForInStatement: string[]; - ForOfStatement: string[]; - ClassDeclaration: string[]; - ClassExpression: string[]; - RestElement: string[]; - UpdateExpression: string[]; - ObjectProperty: string[]; - AssignmentPattern: string[]; - ArrayPattern: string[]; - ObjectPattern: string[]; - VariableDeclaration: string[]; - VariableDeclarator: string[]; - }; -} -declare function getBindingIdentifiers(node: Node, duplicates?: boolean, outerOnly?: boolean): Record | Record>; -declare namespace getBindingIdentifiers { - var keys: { - DeclareClass: string[]; - DeclareFunction: string[]; - DeclareModule: string[]; - DeclareVariable: string[]; - DeclareInterface: string[]; - DeclareTypeAlias: string[]; - DeclareOpaqueType: string[]; - InterfaceDeclaration: string[]; - TypeAlias: string[]; - OpaqueType: string[]; - CatchClause: string[]; - LabeledStatement: string[]; - UnaryExpression: string[]; - AssignmentExpression: string[]; - ImportSpecifier: string[]; - ImportNamespaceSpecifier: string[]; - ImportDefaultSpecifier: string[]; - ImportDeclaration: string[]; - ExportSpecifier: string[]; - ExportNamespaceSpecifier: string[]; - ExportDefaultSpecifier: string[]; - FunctionDeclaration: string[]; - FunctionExpression: string[]; - ArrowFunctionExpression: string[]; - ObjectMethod: string[]; - ClassMethod: string[]; - ClassPrivateMethod: string[]; - ForInStatement: string[]; - ForOfStatement: string[]; - ClassDeclaration: string[]; - ClassExpression: string[]; - RestElement: string[]; - UpdateExpression: string[]; - ObjectProperty: string[]; - AssignmentPattern: string[]; - ArrayPattern: string[]; - ObjectPattern: string[]; - VariableDeclaration: string[]; - VariableDeclarator: string[]; - }; -} -//# sourceMappingURL=getBindingIdentifiers.d.ts.map - -declare const _default: { - (node: Node, duplicates: true): Record>; - (node: Node, duplicates?: false): Record; - (node: Node, duplicates?: boolean): Record | Record>; -}; -//# sourceMappingURL=getOuterBindingIdentifiers.d.ts.map - -declare type TraversalAncestors = Array<{ - node: Node; - key: string; - index?: number; -}>; -declare type TraversalHandler = (this: undefined, node: Node, parent: TraversalAncestors, state: T) => void; -declare type TraversalHandlers = { - enter?: TraversalHandler; - exit?: TraversalHandler; -}; -/** - * A general AST traversal with both prefix and postfix handlers, and a - * state object. Exposes ancestry data to each handler so that more complex - * AST data can be taken into account. - */ -declare function traverse(node: Node, handlers: TraversalHandler | TraversalHandlers, state?: T): void; - -/** - * A prefix AST traversal implementation meant for simple searching - * and processing. - */ -declare function traverseFast(node: Node | null | undefined, enter: (node: Node, opts?: any) => void, opts?: any): void; - -declare function shallowEqual(actual: object, expected: T): actual is T; - -declare function is(type: T, node: Node | null | undefined, opts?: undefined): node is Extract; -declare function is>(type: T, n: Node | null | undefined, required: Partial

): n is P; -declare function is

(type: string, node: Node | null | undefined, opts: Partial

): node is P; -declare function is(type: string, node: Node | null | undefined, opts?: Partial): node is Node; - -/** - * Check if the input `node` is a binding identifier. - */ -declare function isBinding(node: Node, parent: Node, grandparent?: Node): boolean; - -/** - * Check if the input `node` is block scoped. - */ -declare function isBlockScoped(node: Node): boolean; - -/** - * Check if the input `node` is definitely immutable. - */ -declare function isImmutable(node: Node): boolean; - -/** - * Check if the input `node` is a `let` variable declaration. - */ -declare function isLet(node: Node): boolean; - -declare function isNode(node: any): node is Node; - -/** - * Check if two nodes are equivalent - */ -declare function isNodesEquivalent>(a: T, b: any): b is T; - -/** - * Test if a `placeholderType` is a `targetType` or if `targetType` is an alias of `placeholderType`. - */ -declare function isPlaceholderType(placeholderType: string, targetType: string): boolean; - -/** - * Check if the input `node` is a reference to a bound variable. - */ -declare function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean; - -/** - * Check if the input `node` is a scope. - */ -declare function isScope(node: Node, parent: Node): boolean; - -/** - * Check if the input `specifier` is a `default` import or export. - */ -declare function isSpecifierDefault(specifier: ModuleSpecifier): boolean; - -declare function isType(nodeType: string, targetType: T): nodeType is T; -declare function isType(nodeType: string | null | undefined, targetType: string): boolean; - -/** - * Check if the input `name` is a valid identifier name according to the ES3 specification. - * - * Additional ES3 reserved words are - */ -declare function isValidES3Identifier(name: string): boolean; - -/** - * Check if the input `name` is a valid identifier name - * and isn't a reserved word. - */ -declare function isValidIdentifier(name: string, reserved?: boolean): boolean; - -/** - * Check if the input `node` is a variable declaration. - */ -declare function isVar(node: Node): boolean; - -/** - * Determines whether or not the input node `member` matches the - * input `match`. - * - * For example, given the match `React.createClass` it would match the - * parsed nodes of `React.createClass` and `React["createClass"]`. - */ -declare function matchesPattern(member: Node | null | undefined, match: string | string[], allowPartial?: boolean): boolean; - -declare function validate(node: Node | undefined | null, key: string, val: any): void; - -/** - * Build a function that when called will return whether or not the - * input `node` `MemberExpression` matches the input `match`. - * - * For example, given the match `React.createClass` it would match the - * parsed nodes of `React.createClass` and `React["createClass"]`. - */ -declare function buildMatchMemberExpression(match: string, allowPartial?: boolean): (member: Node) => boolean; - -declare function isArrayExpression(node: object | null | undefined, opts?: object | null): node is ArrayExpression; -declare function isAssignmentExpression(node: object | null | undefined, opts?: object | null): node is AssignmentExpression; -declare function isBinaryExpression(node: object | null | undefined, opts?: object | null): node is BinaryExpression; -declare function isInterpreterDirective(node: object | null | undefined, opts?: object | null): node is InterpreterDirective; -declare function isDirective(node: object | null | undefined, opts?: object | null): node is Directive; -declare function isDirectiveLiteral(node: object | null | undefined, opts?: object | null): node is DirectiveLiteral; -declare function isBlockStatement(node: object | null | undefined, opts?: object | null): node is BlockStatement; -declare function isBreakStatement(node: object | null | undefined, opts?: object | null): node is BreakStatement; -declare function isCallExpression(node: object | null | undefined, opts?: object | null): node is CallExpression; -declare function isCatchClause(node: object | null | undefined, opts?: object | null): node is CatchClause; -declare function isConditionalExpression(node: object | null | undefined, opts?: object | null): node is ConditionalExpression; -declare function isContinueStatement(node: object | null | undefined, opts?: object | null): node is ContinueStatement; -declare function isDebuggerStatement(node: object | null | undefined, opts?: object | null): node is DebuggerStatement; -declare function isDoWhileStatement(node: object | null | undefined, opts?: object | null): node is DoWhileStatement; -declare function isEmptyStatement(node: object | null | undefined, opts?: object | null): node is EmptyStatement; -declare function isExpressionStatement(node: object | null | undefined, opts?: object | null): node is ExpressionStatement; -declare function isFile(node: object | null | undefined, opts?: object | null): node is File; -declare function isForInStatement(node: object | null | undefined, opts?: object | null): node is ForInStatement; -declare function isForStatement(node: object | null | undefined, opts?: object | null): node is ForStatement; -declare function isFunctionDeclaration(node: object | null | undefined, opts?: object | null): node is FunctionDeclaration; -declare function isFunctionExpression(node: object | null | undefined, opts?: object | null): node is FunctionExpression; -declare function isIdentifier(node: object | null | undefined, opts?: object | null): node is Identifier; -declare function isIfStatement(node: object | null | undefined, opts?: object | null): node is IfStatement; -declare function isLabeledStatement(node: object | null | undefined, opts?: object | null): node is LabeledStatement; -declare function isStringLiteral(node: object | null | undefined, opts?: object | null): node is StringLiteral; -declare function isNumericLiteral(node: object | null | undefined, opts?: object | null): node is NumericLiteral; -declare function isNullLiteral(node: object | null | undefined, opts?: object | null): node is NullLiteral; -declare function isBooleanLiteral(node: object | null | undefined, opts?: object | null): node is BooleanLiteral; -declare function isRegExpLiteral(node: object | null | undefined, opts?: object | null): node is RegExpLiteral; -declare function isLogicalExpression(node: object | null | undefined, opts?: object | null): node is LogicalExpression; -declare function isMemberExpression(node: object | null | undefined, opts?: object | null): node is MemberExpression; -declare function isNewExpression(node: object | null | undefined, opts?: object | null): node is NewExpression; -declare function isProgram(node: object | null | undefined, opts?: object | null): node is Program; -declare function isObjectExpression(node: object | null | undefined, opts?: object | null): node is ObjectExpression; -declare function isObjectMethod(node: object | null | undefined, opts?: object | null): node is ObjectMethod; -declare function isObjectProperty(node: object | null | undefined, opts?: object | null): node is ObjectProperty; -declare function isRestElement(node: object | null | undefined, opts?: object | null): node is RestElement; -declare function isReturnStatement(node: object | null | undefined, opts?: object | null): node is ReturnStatement; -declare function isSequenceExpression(node: object | null | undefined, opts?: object | null): node is SequenceExpression; -declare function isParenthesizedExpression(node: object | null | undefined, opts?: object | null): node is ParenthesizedExpression; -declare function isSwitchCase(node: object | null | undefined, opts?: object | null): node is SwitchCase; -declare function isSwitchStatement(node: object | null | undefined, opts?: object | null): node is SwitchStatement; -declare function isThisExpression(node: object | null | undefined, opts?: object | null): node is ThisExpression; -declare function isThrowStatement(node: object | null | undefined, opts?: object | null): node is ThrowStatement; -declare function isTryStatement(node: object | null | undefined, opts?: object | null): node is TryStatement; -declare function isUnaryExpression(node: object | null | undefined, opts?: object | null): node is UnaryExpression; -declare function isUpdateExpression(node: object | null | undefined, opts?: object | null): node is UpdateExpression; -declare function isVariableDeclaration(node: object | null | undefined, opts?: object | null): node is VariableDeclaration; -declare function isVariableDeclarator(node: object | null | undefined, opts?: object | null): node is VariableDeclarator; -declare function isWhileStatement(node: object | null | undefined, opts?: object | null): node is WhileStatement; -declare function isWithStatement(node: object | null | undefined, opts?: object | null): node is WithStatement; -declare function isAssignmentPattern(node: object | null | undefined, opts?: object | null): node is AssignmentPattern; -declare function isArrayPattern(node: object | null | undefined, opts?: object | null): node is ArrayPattern; -declare function isArrowFunctionExpression(node: object | null | undefined, opts?: object | null): node is ArrowFunctionExpression; -declare function isClassBody(node: object | null | undefined, opts?: object | null): node is ClassBody; -declare function isClassExpression(node: object | null | undefined, opts?: object | null): node is ClassExpression; -declare function isClassDeclaration(node: object | null | undefined, opts?: object | null): node is ClassDeclaration; -declare function isExportAllDeclaration(node: object | null | undefined, opts?: object | null): node is ExportAllDeclaration; -declare function isExportDefaultDeclaration(node: object | null | undefined, opts?: object | null): node is ExportDefaultDeclaration; -declare function isExportNamedDeclaration(node: object | null | undefined, opts?: object | null): node is ExportNamedDeclaration; -declare function isExportSpecifier(node: object | null | undefined, opts?: object | null): node is ExportSpecifier; -declare function isForOfStatement(node: object | null | undefined, opts?: object | null): node is ForOfStatement; -declare function isImportDeclaration(node: object | null | undefined, opts?: object | null): node is ImportDeclaration; -declare function isImportDefaultSpecifier(node: object | null | undefined, opts?: object | null): node is ImportDefaultSpecifier; -declare function isImportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): node is ImportNamespaceSpecifier; -declare function isImportSpecifier(node: object | null | undefined, opts?: object | null): node is ImportSpecifier; -declare function isMetaProperty(node: object | null | undefined, opts?: object | null): node is MetaProperty; -declare function isClassMethod(node: object | null | undefined, opts?: object | null): node is ClassMethod; -declare function isObjectPattern(node: object | null | undefined, opts?: object | null): node is ObjectPattern; -declare function isSpreadElement(node: object | null | undefined, opts?: object | null): node is SpreadElement; -declare function isSuper(node: object | null | undefined, opts?: object | null): node is Super; -declare function isTaggedTemplateExpression(node: object | null | undefined, opts?: object | null): node is TaggedTemplateExpression; -declare function isTemplateElement(node: object | null | undefined, opts?: object | null): node is TemplateElement; -declare function isTemplateLiteral(node: object | null | undefined, opts?: object | null): node is TemplateLiteral; -declare function isYieldExpression(node: object | null | undefined, opts?: object | null): node is YieldExpression; -declare function isAwaitExpression(node: object | null | undefined, opts?: object | null): node is AwaitExpression; -declare function isImport(node: object | null | undefined, opts?: object | null): node is Import; -declare function isBigIntLiteral(node: object | null | undefined, opts?: object | null): node is BigIntLiteral; -declare function isExportNamespaceSpecifier(node: object | null | undefined, opts?: object | null): node is ExportNamespaceSpecifier; -declare function isOptionalMemberExpression(node: object | null | undefined, opts?: object | null): node is OptionalMemberExpression; -declare function isOptionalCallExpression(node: object | null | undefined, opts?: object | null): node is OptionalCallExpression; -declare function isClassProperty(node: object | null | undefined, opts?: object | null): node is ClassProperty; -declare function isClassPrivateProperty(node: object | null | undefined, opts?: object | null): node is ClassPrivateProperty; -declare function isClassPrivateMethod(node: object | null | undefined, opts?: object | null): node is ClassPrivateMethod; -declare function isPrivateName(node: object | null | undefined, opts?: object | null): node is PrivateName; -declare function isAnyTypeAnnotation(node: object | null | undefined, opts?: object | null): node is AnyTypeAnnotation; -declare function isArrayTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ArrayTypeAnnotation; -declare function isBooleanTypeAnnotation(node: object | null | undefined, opts?: object | null): node is BooleanTypeAnnotation; -declare function isBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is BooleanLiteralTypeAnnotation; -declare function isNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NullLiteralTypeAnnotation; -declare function isClassImplements(node: object | null | undefined, opts?: object | null): node is ClassImplements; -declare function isDeclareClass(node: object | null | undefined, opts?: object | null): node is DeclareClass; -declare function isDeclareFunction(node: object | null | undefined, opts?: object | null): node is DeclareFunction; -declare function isDeclareInterface(node: object | null | undefined, opts?: object | null): node is DeclareInterface; -declare function isDeclareModule(node: object | null | undefined, opts?: object | null): node is DeclareModule; -declare function isDeclareModuleExports(node: object | null | undefined, opts?: object | null): node is DeclareModuleExports; -declare function isDeclareTypeAlias(node: object | null | undefined, opts?: object | null): node is DeclareTypeAlias; -declare function isDeclareOpaqueType(node: object | null | undefined, opts?: object | null): node is DeclareOpaqueType; -declare function isDeclareVariable(node: object | null | undefined, opts?: object | null): node is DeclareVariable; -declare function isDeclareExportDeclaration(node: object | null | undefined, opts?: object | null): node is DeclareExportDeclaration; -declare function isDeclareExportAllDeclaration(node: object | null | undefined, opts?: object | null): node is DeclareExportAllDeclaration; -declare function isDeclaredPredicate(node: object | null | undefined, opts?: object | null): node is DeclaredPredicate; -declare function isExistsTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ExistsTypeAnnotation; -declare function isFunctionTypeAnnotation(node: object | null | undefined, opts?: object | null): node is FunctionTypeAnnotation; -declare function isFunctionTypeParam(node: object | null | undefined, opts?: object | null): node is FunctionTypeParam; -declare function isGenericTypeAnnotation(node: object | null | undefined, opts?: object | null): node is GenericTypeAnnotation; -declare function isInferredPredicate(node: object | null | undefined, opts?: object | null): node is InferredPredicate; -declare function isInterfaceExtends(node: object | null | undefined, opts?: object | null): node is InterfaceExtends; -declare function isInterfaceDeclaration(node: object | null | undefined, opts?: object | null): node is InterfaceDeclaration; -declare function isInterfaceTypeAnnotation(node: object | null | undefined, opts?: object | null): node is InterfaceTypeAnnotation; -declare function isIntersectionTypeAnnotation(node: object | null | undefined, opts?: object | null): node is IntersectionTypeAnnotation; -declare function isMixedTypeAnnotation(node: object | null | undefined, opts?: object | null): node is MixedTypeAnnotation; -declare function isEmptyTypeAnnotation(node: object | null | undefined, opts?: object | null): node is EmptyTypeAnnotation; -declare function isNullableTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NullableTypeAnnotation; -declare function isNumberLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NumberLiteralTypeAnnotation; -declare function isNumberTypeAnnotation(node: object | null | undefined, opts?: object | null): node is NumberTypeAnnotation; -declare function isObjectTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ObjectTypeAnnotation; -declare function isObjectTypeInternalSlot(node: object | null | undefined, opts?: object | null): node is ObjectTypeInternalSlot; -declare function isObjectTypeCallProperty(node: object | null | undefined, opts?: object | null): node is ObjectTypeCallProperty; -declare function isObjectTypeIndexer(node: object | null | undefined, opts?: object | null): node is ObjectTypeIndexer; -declare function isObjectTypeProperty(node: object | null | undefined, opts?: object | null): node is ObjectTypeProperty; -declare function isObjectTypeSpreadProperty(node: object | null | undefined, opts?: object | null): node is ObjectTypeSpreadProperty; -declare function isOpaqueType(node: object | null | undefined, opts?: object | null): node is OpaqueType; -declare function isQualifiedTypeIdentifier(node: object | null | undefined, opts?: object | null): node is QualifiedTypeIdentifier; -declare function isStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object | null): node is StringLiteralTypeAnnotation; -declare function isStringTypeAnnotation(node: object | null | undefined, opts?: object | null): node is StringTypeAnnotation; -declare function isSymbolTypeAnnotation(node: object | null | undefined, opts?: object | null): node is SymbolTypeAnnotation; -declare function isThisTypeAnnotation(node: object | null | undefined, opts?: object | null): node is ThisTypeAnnotation; -declare function isTupleTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TupleTypeAnnotation; -declare function isTypeofTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TypeofTypeAnnotation; -declare function isTypeAlias(node: object | null | undefined, opts?: object | null): node is TypeAlias; -declare function isTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TypeAnnotation; -declare function isTypeCastExpression(node: object | null | undefined, opts?: object | null): node is TypeCastExpression; -declare function isTypeParameter(node: object | null | undefined, opts?: object | null): node is TypeParameter; -declare function isTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): node is TypeParameterDeclaration; -declare function isTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): node is TypeParameterInstantiation; -declare function isUnionTypeAnnotation(node: object | null | undefined, opts?: object | null): node is UnionTypeAnnotation; -declare function isVariance(node: object | null | undefined, opts?: object | null): node is Variance; -declare function isVoidTypeAnnotation(node: object | null | undefined, opts?: object | null): node is VoidTypeAnnotation; -declare function isEnumDeclaration(node: object | null | undefined, opts?: object | null): node is EnumDeclaration; -declare function isEnumBooleanBody(node: object | null | undefined, opts?: object | null): node is EnumBooleanBody; -declare function isEnumNumberBody(node: object | null | undefined, opts?: object | null): node is EnumNumberBody; -declare function isEnumStringBody(node: object | null | undefined, opts?: object | null): node is EnumStringBody; -declare function isEnumSymbolBody(node: object | null | undefined, opts?: object | null): node is EnumSymbolBody; -declare function isEnumBooleanMember(node: object | null | undefined, opts?: object | null): node is EnumBooleanMember; -declare function isEnumNumberMember(node: object | null | undefined, opts?: object | null): node is EnumNumberMember; -declare function isEnumStringMember(node: object | null | undefined, opts?: object | null): node is EnumStringMember; -declare function isEnumDefaultedMember(node: object | null | undefined, opts?: object | null): node is EnumDefaultedMember; -declare function isIndexedAccessType(node: object | null | undefined, opts?: object | null): node is IndexedAccessType; -declare function isOptionalIndexedAccessType(node: object | null | undefined, opts?: object | null): node is OptionalIndexedAccessType; -declare function isJSXAttribute(node: object | null | undefined, opts?: object | null): node is JSXAttribute; -declare function isJSXClosingElement(node: object | null | undefined, opts?: object | null): node is JSXClosingElement; -declare function isJSXElement(node: object | null | undefined, opts?: object | null): node is JSXElement; -declare function isJSXEmptyExpression(node: object | null | undefined, opts?: object | null): node is JSXEmptyExpression; -declare function isJSXExpressionContainer(node: object | null | undefined, opts?: object | null): node is JSXExpressionContainer; -declare function isJSXSpreadChild(node: object | null | undefined, opts?: object | null): node is JSXSpreadChild; -declare function isJSXIdentifier(node: object | null | undefined, opts?: object | null): node is JSXIdentifier; -declare function isJSXMemberExpression(node: object | null | undefined, opts?: object | null): node is JSXMemberExpression; -declare function isJSXNamespacedName(node: object | null | undefined, opts?: object | null): node is JSXNamespacedName; -declare function isJSXOpeningElement(node: object | null | undefined, opts?: object | null): node is JSXOpeningElement; -declare function isJSXSpreadAttribute(node: object | null | undefined, opts?: object | null): node is JSXSpreadAttribute; -declare function isJSXText(node: object | null | undefined, opts?: object | null): node is JSXText; -declare function isJSXFragment(node: object | null | undefined, opts?: object | null): node is JSXFragment; -declare function isJSXOpeningFragment(node: object | null | undefined, opts?: object | null): node is JSXOpeningFragment; -declare function isJSXClosingFragment(node: object | null | undefined, opts?: object | null): node is JSXClosingFragment; -declare function isNoop(node: object | null | undefined, opts?: object | null): node is Noop; -declare function isPlaceholder(node: object | null | undefined, opts?: object | null): node is Placeholder; -declare function isV8IntrinsicIdentifier(node: object | null | undefined, opts?: object | null): node is V8IntrinsicIdentifier; -declare function isArgumentPlaceholder(node: object | null | undefined, opts?: object | null): node is ArgumentPlaceholder; -declare function isBindExpression(node: object | null | undefined, opts?: object | null): node is BindExpression; -declare function isImportAttribute(node: object | null | undefined, opts?: object | null): node is ImportAttribute; -declare function isDecorator(node: object | null | undefined, opts?: object | null): node is Decorator; -declare function isDoExpression(node: object | null | undefined, opts?: object | null): node is DoExpression; -declare function isExportDefaultSpecifier(node: object | null | undefined, opts?: object | null): node is ExportDefaultSpecifier; -declare function isRecordExpression(node: object | null | undefined, opts?: object | null): node is RecordExpression; -declare function isTupleExpression(node: object | null | undefined, opts?: object | null): node is TupleExpression; -declare function isDecimalLiteral(node: object | null | undefined, opts?: object | null): node is DecimalLiteral; -declare function isStaticBlock(node: object | null | undefined, opts?: object | null): node is StaticBlock; -declare function isModuleExpression(node: object | null | undefined, opts?: object | null): node is ModuleExpression; -declare function isTopicReference(node: object | null | undefined, opts?: object | null): node is TopicReference; -declare function isPipelineTopicExpression(node: object | null | undefined, opts?: object | null): node is PipelineTopicExpression; -declare function isPipelineBareFunction(node: object | null | undefined, opts?: object | null): node is PipelineBareFunction; -declare function isPipelinePrimaryTopicReference(node: object | null | undefined, opts?: object | null): node is PipelinePrimaryTopicReference; -declare function isTSParameterProperty(node: object | null | undefined, opts?: object | null): node is TSParameterProperty; -declare function isTSDeclareFunction(node: object | null | undefined, opts?: object | null): node is TSDeclareFunction; -declare function isTSDeclareMethod(node: object | null | undefined, opts?: object | null): node is TSDeclareMethod; -declare function isTSQualifiedName(node: object | null | undefined, opts?: object | null): node is TSQualifiedName; -declare function isTSCallSignatureDeclaration(node: object | null | undefined, opts?: object | null): node is TSCallSignatureDeclaration; -declare function isTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object | null): node is TSConstructSignatureDeclaration; -declare function isTSPropertySignature(node: object | null | undefined, opts?: object | null): node is TSPropertySignature; -declare function isTSMethodSignature(node: object | null | undefined, opts?: object | null): node is TSMethodSignature; -declare function isTSIndexSignature(node: object | null | undefined, opts?: object | null): node is TSIndexSignature; -declare function isTSAnyKeyword(node: object | null | undefined, opts?: object | null): node is TSAnyKeyword; -declare function isTSBooleanKeyword(node: object | null | undefined, opts?: object | null): node is TSBooleanKeyword; -declare function isTSBigIntKeyword(node: object | null | undefined, opts?: object | null): node is TSBigIntKeyword; -declare function isTSIntrinsicKeyword(node: object | null | undefined, opts?: object | null): node is TSIntrinsicKeyword; -declare function isTSNeverKeyword(node: object | null | undefined, opts?: object | null): node is TSNeverKeyword; -declare function isTSNullKeyword(node: object | null | undefined, opts?: object | null): node is TSNullKeyword; -declare function isTSNumberKeyword(node: object | null | undefined, opts?: object | null): node is TSNumberKeyword; -declare function isTSObjectKeyword(node: object | null | undefined, opts?: object | null): node is TSObjectKeyword; -declare function isTSStringKeyword(node: object | null | undefined, opts?: object | null): node is TSStringKeyword; -declare function isTSSymbolKeyword(node: object | null | undefined, opts?: object | null): node is TSSymbolKeyword; -declare function isTSUndefinedKeyword(node: object | null | undefined, opts?: object | null): node is TSUndefinedKeyword; -declare function isTSUnknownKeyword(node: object | null | undefined, opts?: object | null): node is TSUnknownKeyword; -declare function isTSVoidKeyword(node: object | null | undefined, opts?: object | null): node is TSVoidKeyword; -declare function isTSThisType(node: object | null | undefined, opts?: object | null): node is TSThisType; -declare function isTSFunctionType(node: object | null | undefined, opts?: object | null): node is TSFunctionType; -declare function isTSConstructorType(node: object | null | undefined, opts?: object | null): node is TSConstructorType; -declare function isTSTypeReference(node: object | null | undefined, opts?: object | null): node is TSTypeReference; -declare function isTSTypePredicate(node: object | null | undefined, opts?: object | null): node is TSTypePredicate; -declare function isTSTypeQuery(node: object | null | undefined, opts?: object | null): node is TSTypeQuery; -declare function isTSTypeLiteral(node: object | null | undefined, opts?: object | null): node is TSTypeLiteral; -declare function isTSArrayType(node: object | null | undefined, opts?: object | null): node is TSArrayType; -declare function isTSTupleType(node: object | null | undefined, opts?: object | null): node is TSTupleType; -declare function isTSOptionalType(node: object | null | undefined, opts?: object | null): node is TSOptionalType; -declare function isTSRestType(node: object | null | undefined, opts?: object | null): node is TSRestType; -declare function isTSNamedTupleMember(node: object | null | undefined, opts?: object | null): node is TSNamedTupleMember; -declare function isTSUnionType(node: object | null | undefined, opts?: object | null): node is TSUnionType; -declare function isTSIntersectionType(node: object | null | undefined, opts?: object | null): node is TSIntersectionType; -declare function isTSConditionalType(node: object | null | undefined, opts?: object | null): node is TSConditionalType; -declare function isTSInferType(node: object | null | undefined, opts?: object | null): node is TSInferType; -declare function isTSParenthesizedType(node: object | null | undefined, opts?: object | null): node is TSParenthesizedType; -declare function isTSTypeOperator(node: object | null | undefined, opts?: object | null): node is TSTypeOperator; -declare function isTSIndexedAccessType(node: object | null | undefined, opts?: object | null): node is TSIndexedAccessType; -declare function isTSMappedType(node: object | null | undefined, opts?: object | null): node is TSMappedType; -declare function isTSLiteralType(node: object | null | undefined, opts?: object | null): node is TSLiteralType; -declare function isTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object | null): node is TSExpressionWithTypeArguments; -declare function isTSInterfaceDeclaration(node: object | null | undefined, opts?: object | null): node is TSInterfaceDeclaration; -declare function isTSInterfaceBody(node: object | null | undefined, opts?: object | null): node is TSInterfaceBody; -declare function isTSTypeAliasDeclaration(node: object | null | undefined, opts?: object | null): node is TSTypeAliasDeclaration; -declare function isTSAsExpression(node: object | null | undefined, opts?: object | null): node is TSAsExpression; -declare function isTSTypeAssertion(node: object | null | undefined, opts?: object | null): node is TSTypeAssertion; -declare function isTSEnumDeclaration(node: object | null | undefined, opts?: object | null): node is TSEnumDeclaration; -declare function isTSEnumMember(node: object | null | undefined, opts?: object | null): node is TSEnumMember; -declare function isTSModuleDeclaration(node: object | null | undefined, opts?: object | null): node is TSModuleDeclaration; -declare function isTSModuleBlock(node: object | null | undefined, opts?: object | null): node is TSModuleBlock; -declare function isTSImportType(node: object | null | undefined, opts?: object | null): node is TSImportType; -declare function isTSImportEqualsDeclaration(node: object | null | undefined, opts?: object | null): node is TSImportEqualsDeclaration; -declare function isTSExternalModuleReference(node: object | null | undefined, opts?: object | null): node is TSExternalModuleReference; -declare function isTSNonNullExpression(node: object | null | undefined, opts?: object | null): node is TSNonNullExpression; -declare function isTSExportAssignment(node: object | null | undefined, opts?: object | null): node is TSExportAssignment; -declare function isTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object | null): node is TSNamespaceExportDeclaration; -declare function isTSTypeAnnotation(node: object | null | undefined, opts?: object | null): node is TSTypeAnnotation; -declare function isTSTypeParameterInstantiation(node: object | null | undefined, opts?: object | null): node is TSTypeParameterInstantiation; -declare function isTSTypeParameterDeclaration(node: object | null | undefined, opts?: object | null): node is TSTypeParameterDeclaration; -declare function isTSTypeParameter(node: object | null | undefined, opts?: object | null): node is TSTypeParameter; -declare function isExpression(node: object | null | undefined, opts?: object | null): node is Expression; -declare function isBinary(node: object | null | undefined, opts?: object | null): node is Binary; -declare function isScopable(node: object | null | undefined, opts?: object | null): node is Scopable; -declare function isBlockParent(node: object | null | undefined, opts?: object | null): node is BlockParent; -declare function isBlock(node: object | null | undefined, opts?: object | null): node is Block; -declare function isStatement(node: object | null | undefined, opts?: object | null): node is Statement; -declare function isTerminatorless(node: object | null | undefined, opts?: object | null): node is Terminatorless; -declare function isCompletionStatement(node: object | null | undefined, opts?: object | null): node is CompletionStatement; -declare function isConditional(node: object | null | undefined, opts?: object | null): node is Conditional; -declare function isLoop(node: object | null | undefined, opts?: object | null): node is Loop; -declare function isWhile(node: object | null | undefined, opts?: object | null): node is While; -declare function isExpressionWrapper(node: object | null | undefined, opts?: object | null): node is ExpressionWrapper; -declare function isFor(node: object | null | undefined, opts?: object | null): node is For; -declare function isForXStatement(node: object | null | undefined, opts?: object | null): node is ForXStatement; -declare function isFunction(node: object | null | undefined, opts?: object | null): node is Function; -declare function isFunctionParent(node: object | null | undefined, opts?: object | null): node is FunctionParent; -declare function isPureish(node: object | null | undefined, opts?: object | null): node is Pureish; -declare function isDeclaration(node: object | null | undefined, opts?: object | null): node is Declaration; -declare function isPatternLike(node: object | null | undefined, opts?: object | null): node is PatternLike; -declare function isLVal(node: object | null | undefined, opts?: object | null): node is LVal; -declare function isTSEntityName(node: object | null | undefined, opts?: object | null): node is TSEntityName; -declare function isLiteral(node: object | null | undefined, opts?: object | null): node is Literal; -declare function isUserWhitespacable(node: object | null | undefined, opts?: object | null): node is UserWhitespacable; -declare function isMethod(node: object | null | undefined, opts?: object | null): node is Method; -declare function isObjectMember(node: object | null | undefined, opts?: object | null): node is ObjectMember; -declare function isProperty(node: object | null | undefined, opts?: object | null): node is Property; -declare function isUnaryLike(node: object | null | undefined, opts?: object | null): node is UnaryLike; -declare function isPattern(node: object | null | undefined, opts?: object | null): node is Pattern; -declare function isClass(node: object | null | undefined, opts?: object | null): node is Class; -declare function isModuleDeclaration(node: object | null | undefined, opts?: object | null): node is ModuleDeclaration; -declare function isExportDeclaration(node: object | null | undefined, opts?: object | null): node is ExportDeclaration; -declare function isModuleSpecifier(node: object | null | undefined, opts?: object | null): node is ModuleSpecifier; -declare function isPrivate(node: object | null | undefined, opts?: object | null): node is Private; -declare function isFlow(node: object | null | undefined, opts?: object | null): node is Flow; -declare function isFlowType(node: object | null | undefined, opts?: object | null): node is FlowType; -declare function isFlowBaseAnnotation(node: object | null | undefined, opts?: object | null): node is FlowBaseAnnotation; -declare function isFlowDeclaration(node: object | null | undefined, opts?: object | null): node is FlowDeclaration; -declare function isFlowPredicate(node: object | null | undefined, opts?: object | null): node is FlowPredicate; -declare function isEnumBody(node: object | null | undefined, opts?: object | null): node is EnumBody; -declare function isEnumMember(node: object | null | undefined, opts?: object | null): node is EnumMember; -declare function isJSX(node: object | null | undefined, opts?: object | null): node is JSX; -declare function isTSTypeElement(node: object | null | undefined, opts?: object | null): node is TSTypeElement; -declare function isTSType(node: object | null | undefined, opts?: object | null): node is TSType; -declare function isTSBaseType(node: object | null | undefined, opts?: object | null): node is TSBaseType; -declare function isNumberLiteral(node: object | null | undefined, opts?: object | null): boolean; -declare function isRegexLiteral(node: object | null | undefined, opts?: object | null): boolean; -declare function isRestProperty(node: object | null | undefined, opts?: object | null): boolean; -declare function isSpreadProperty(node: object | null | undefined, opts?: object | null): boolean; - -declare const react: { - isReactComponent: (member: Node) => boolean; - isCompatTag: typeof isCompatTag; - buildChildren: typeof buildChildren; -}; - -export { ALIAS_KEYS, ASSIGNMENT_OPERATORS, Aliases, AnyTypeAnnotation, ArgumentPlaceholder, ArrayExpression, ArrayPattern, ArrayTypeAnnotation, ArrowFunctionExpression, AssignmentExpression, AssignmentPattern, AwaitExpression, BINARY_OPERATORS, BINARY_TYPES, BLOCKPARENT_TYPES, BLOCK_SCOPED_SYMBOL, BLOCK_TYPES, BOOLEAN_BINARY_OPERATORS, BOOLEAN_NUMBER_BINARY_OPERATORS, BOOLEAN_UNARY_OPERATORS, BUILDER_KEYS, BigIntLiteral, Binary, BinaryExpression, BindExpression, Block, BlockParent, BlockStatement, BooleanLiteral, BooleanLiteralTypeAnnotation, BooleanTypeAnnotation, BreakStatement, CLASS_TYPES, COMMENT_KEYS, COMPARISON_BINARY_OPERATORS, COMPLETIONSTATEMENT_TYPES, CONDITIONAL_TYPES, CallExpression, CatchClause, Class, ClassBody, ClassDeclaration, ClassExpression, ClassImplements, ClassMethod, ClassPrivateMethod, ClassPrivateProperty, ClassProperty, Comment, CommentBlock, CommentLine, CommentTypeShorthand, CompletionStatement, Conditional, ConditionalExpression, ContinueStatement, DECLARATION_TYPES, DEPRECATED_KEYS, DebuggerStatement, DecimalLiteral, Declaration, DeclareClass, DeclareExportAllDeclaration, DeclareExportDeclaration, DeclareFunction, DeclareInterface, DeclareModule, DeclareModuleExports, DeclareOpaqueType, DeclareTypeAlias, DeclareVariable, DeclaredPredicate, Decorator, Directive, DirectiveLiteral, DoExpression, DoWhileStatement, ENUMBODY_TYPES, ENUMMEMBER_TYPES, EQUALITY_BINARY_OPERATORS, EXPORTDECLARATION_TYPES, EXPRESSIONWRAPPER_TYPES, EXPRESSION_TYPES, EmptyStatement, EmptyTypeAnnotation, EnumBody, EnumBooleanBody, EnumBooleanMember, EnumDeclaration, EnumDefaultedMember, EnumMember, EnumNumberBody, EnumNumberMember, EnumStringBody, EnumStringMember, EnumSymbolBody, ExistsTypeAnnotation, ExportAllDeclaration, ExportDeclaration, ExportDefaultDeclaration, ExportDefaultSpecifier, ExportNamedDeclaration, ExportNamespaceSpecifier, ExportSpecifier, Expression, ExpressionStatement, ExpressionWrapper, FLATTENABLE_KEYS, FLIPPED_ALIAS_KEYS, FLOWBASEANNOTATION_TYPES, FLOWDECLARATION_TYPES, FLOWPREDICATE_TYPES, FLOWTYPE_TYPES, FLOW_TYPES, FORXSTATEMENT_TYPES, FOR_INIT_KEYS, FOR_TYPES, FUNCTIONPARENT_TYPES, FUNCTION_TYPES, File, Flow, FlowBaseAnnotation, FlowDeclaration, FlowPredicate, FlowType, For, ForInStatement, ForOfStatement, ForStatement, ForXStatement, Function, FunctionDeclaration, FunctionExpression, FunctionParent, FunctionTypeAnnotation, FunctionTypeParam, GenericTypeAnnotation, IMMUTABLE_TYPES, INHERIT_KEYS, Identifier, IfStatement, Immutable, Import, ImportAttribute, ImportDeclaration, ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier, IndexedAccessType, InferredPredicate, InterfaceDeclaration, InterfaceExtends, InterfaceTypeAnnotation, InterpreterDirective, IntersectionTypeAnnotation, JSX, JSXAttribute, JSXClosingElement, JSXClosingFragment, JSXElement, JSXEmptyExpression, JSXExpressionContainer, JSXFragment, JSXIdentifier, JSXMemberExpression, JSXNamespacedName, JSXOpeningElement, JSXOpeningFragment, JSXSpreadAttribute, JSXSpreadChild, JSXText, JSX_TYPES, LITERAL_TYPES, LOGICAL_OPERATORS, LOOP_TYPES, LVAL_TYPES, LVal, LabeledStatement, Literal, LogicalExpression, Loop, METHOD_TYPES, MODULEDECLARATION_TYPES, MODULESPECIFIER_TYPES, MemberExpression, MetaProperty, Method, MixedTypeAnnotation, ModuleDeclaration, ModuleExpression, ModuleSpecifier, NODE_FIELDS, NODE_PARENT_VALIDATIONS, NOT_LOCAL_BINDING, NUMBER_BINARY_OPERATORS, NUMBER_UNARY_OPERATORS, NewExpression, Node, Noop, NullLiteral, NullLiteralTypeAnnotation, NullableTypeAnnotation, NumberLiteral$1 as NumberLiteral, NumberLiteralTypeAnnotation, NumberTypeAnnotation, NumericLiteral, OBJECTMEMBER_TYPES, ObjectExpression, ObjectMember, ObjectMethod, ObjectPattern, ObjectProperty, ObjectTypeAnnotation, ObjectTypeCallProperty, ObjectTypeIndexer, ObjectTypeInternalSlot, ObjectTypeProperty, ObjectTypeSpreadProperty, OpaqueType, OptionalCallExpression, OptionalIndexedAccessType, OptionalMemberExpression, PATTERNLIKE_TYPES, PATTERN_TYPES, PLACEHOLDERS, PLACEHOLDERS_ALIAS, PLACEHOLDERS_FLIPPED_ALIAS, PRIVATE_TYPES, PROPERTY_TYPES, PUREISH_TYPES, ParenthesizedExpression, Pattern, PatternLike, PipelineBareFunction, PipelinePrimaryTopicReference, PipelineTopicExpression, Placeholder, Private, PrivateName, Program, Property, Pureish, QualifiedTypeIdentifier, RecordExpression, RegExpLiteral, RegexLiteral$1 as RegexLiteral, RestElement, RestProperty$1 as RestProperty, ReturnStatement, SCOPABLE_TYPES, STATEMENT_OR_BLOCK_KEYS, STATEMENT_TYPES, STRING_UNARY_OPERATORS, Scopable, SequenceExpression, SourceLocation, SpreadElement, SpreadProperty$1 as SpreadProperty, Statement, StaticBlock, StringLiteral, StringLiteralTypeAnnotation, StringTypeAnnotation, Super, SwitchCase, SwitchStatement, SymbolTypeAnnotation, TERMINATORLESS_TYPES, TSAnyKeyword, TSArrayType, TSAsExpression, TSBASETYPE_TYPES, TSBaseType, TSBigIntKeyword, TSBooleanKeyword, TSCallSignatureDeclaration, TSConditionalType, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSDeclareMethod, TSENTITYNAME_TYPES, TSEntityName, TSEnumDeclaration, TSEnumMember, TSExportAssignment, TSExpressionWithTypeArguments, TSExternalModuleReference, TSFunctionType, TSImportEqualsDeclaration, TSImportType, TSIndexSignature, TSIndexedAccessType, TSInferType, TSInterfaceBody, TSInterfaceDeclaration, TSIntersectionType, TSIntrinsicKeyword, TSLiteralType, TSMappedType, TSMethodSignature, TSModuleBlock, TSModuleDeclaration, TSNamedTupleMember, TSNamespaceExportDeclaration, TSNeverKeyword, TSNonNullExpression, TSNullKeyword, TSNumberKeyword, TSObjectKeyword, TSOptionalType, TSParameterProperty, TSParenthesizedType, TSPropertySignature, TSQualifiedName, TSRestType, TSStringKeyword, TSSymbolKeyword, TSTYPEELEMENT_TYPES, TSTYPE_TYPES, TSThisType, TSTupleType, TSType, TSTypeAliasDeclaration, TSTypeAnnotation, TSTypeAssertion, TSTypeElement, TSTypeLiteral, TSTypeOperator, TSTypeParameter, TSTypeParameterDeclaration, TSTypeParameterInstantiation, TSTypePredicate, TSTypeQuery, TSTypeReference, TSUndefinedKeyword, TSUnionType, TSUnknownKeyword, TSVoidKeyword, TYPES, TaggedTemplateExpression, TemplateElement, TemplateLiteral, Terminatorless, ThisExpression, ThisTypeAnnotation, ThrowStatement, TopicReference, TraversalAncestors, TraversalHandler, TraversalHandlers, TryStatement, TupleExpression, TupleTypeAnnotation, TypeAlias, TypeAnnotation, TypeCastExpression, TypeParameter, TypeParameterDeclaration, TypeParameterInstantiation, TypeofTypeAnnotation, UNARYLIKE_TYPES, UNARY_OPERATORS, UPDATE_OPERATORS, USERWHITESPACABLE_TYPES, UnaryExpression, UnaryLike, UnionTypeAnnotation, UpdateExpression, UserWhitespacable, V8IntrinsicIdentifier, VISITOR_KEYS, VariableDeclaration, VariableDeclarator, Variance, VoidTypeAnnotation, WHILE_TYPES, While, WhileStatement, WithStatement, YieldExpression, addComment, addComments, anyTypeAnnotation, appendToMemberExpression, argumentPlaceholder, arrayExpression, arrayPattern, arrayTypeAnnotation, arrowFunctionExpression, assertAnyTypeAnnotation, assertArgumentPlaceholder, assertArrayExpression, assertArrayPattern, assertArrayTypeAnnotation, assertArrowFunctionExpression, assertAssignmentExpression, assertAssignmentPattern, assertAwaitExpression, assertBigIntLiteral, assertBinary, assertBinaryExpression, assertBindExpression, assertBlock, assertBlockParent, assertBlockStatement, assertBooleanLiteral, assertBooleanLiteralTypeAnnotation, assertBooleanTypeAnnotation, assertBreakStatement, assertCallExpression, assertCatchClause, assertClass, assertClassBody, assertClassDeclaration, assertClassExpression, assertClassImplements, assertClassMethod, assertClassPrivateMethod, assertClassPrivateProperty, assertClassProperty, assertCompletionStatement, assertConditional, assertConditionalExpression, assertContinueStatement, assertDebuggerStatement, assertDecimalLiteral, assertDeclaration, assertDeclareClass, assertDeclareExportAllDeclaration, assertDeclareExportDeclaration, assertDeclareFunction, assertDeclareInterface, assertDeclareModule, assertDeclareModuleExports, assertDeclareOpaqueType, assertDeclareTypeAlias, assertDeclareVariable, assertDeclaredPredicate, assertDecorator, assertDirective, assertDirectiveLiteral, assertDoExpression, assertDoWhileStatement, assertEmptyStatement, assertEmptyTypeAnnotation, assertEnumBody, assertEnumBooleanBody, assertEnumBooleanMember, assertEnumDeclaration, assertEnumDefaultedMember, assertEnumMember, assertEnumNumberBody, assertEnumNumberMember, assertEnumStringBody, assertEnumStringMember, assertEnumSymbolBody, assertExistsTypeAnnotation, assertExportAllDeclaration, assertExportDeclaration, assertExportDefaultDeclaration, assertExportDefaultSpecifier, assertExportNamedDeclaration, assertExportNamespaceSpecifier, assertExportSpecifier, assertExpression, assertExpressionStatement, assertExpressionWrapper, assertFile, assertFlow, assertFlowBaseAnnotation, assertFlowDeclaration, assertFlowPredicate, assertFlowType, assertFor, assertForInStatement, assertForOfStatement, assertForStatement, assertForXStatement, assertFunction, assertFunctionDeclaration, assertFunctionExpression, assertFunctionParent, assertFunctionTypeAnnotation, assertFunctionTypeParam, assertGenericTypeAnnotation, assertIdentifier, assertIfStatement, assertImmutable, assertImport, assertImportAttribute, assertImportDeclaration, assertImportDefaultSpecifier, assertImportNamespaceSpecifier, assertImportSpecifier, assertIndexedAccessType, assertInferredPredicate, assertInterfaceDeclaration, assertInterfaceExtends, assertInterfaceTypeAnnotation, assertInterpreterDirective, assertIntersectionTypeAnnotation, assertJSX, assertJSXAttribute, assertJSXClosingElement, assertJSXClosingFragment, assertJSXElement, assertJSXEmptyExpression, assertJSXExpressionContainer, assertJSXFragment, assertJSXIdentifier, assertJSXMemberExpression, assertJSXNamespacedName, assertJSXOpeningElement, assertJSXOpeningFragment, assertJSXSpreadAttribute, assertJSXSpreadChild, assertJSXText, assertLVal, assertLabeledStatement, assertLiteral, assertLogicalExpression, assertLoop, assertMemberExpression, assertMetaProperty, assertMethod, assertMixedTypeAnnotation, assertModuleDeclaration, assertModuleExpression, assertModuleSpecifier, assertNewExpression, assertNode, assertNoop, assertNullLiteral, assertNullLiteralTypeAnnotation, assertNullableTypeAnnotation, assertNumberLiteral, assertNumberLiteralTypeAnnotation, assertNumberTypeAnnotation, assertNumericLiteral, assertObjectExpression, assertObjectMember, assertObjectMethod, assertObjectPattern, assertObjectProperty, assertObjectTypeAnnotation, assertObjectTypeCallProperty, assertObjectTypeIndexer, assertObjectTypeInternalSlot, assertObjectTypeProperty, assertObjectTypeSpreadProperty, assertOpaqueType, assertOptionalCallExpression, assertOptionalIndexedAccessType, assertOptionalMemberExpression, assertParenthesizedExpression, assertPattern, assertPatternLike, assertPipelineBareFunction, assertPipelinePrimaryTopicReference, assertPipelineTopicExpression, assertPlaceholder, assertPrivate, assertPrivateName, assertProgram, assertProperty, assertPureish, assertQualifiedTypeIdentifier, assertRecordExpression, assertRegExpLiteral, assertRegexLiteral, assertRestElement, assertRestProperty, assertReturnStatement, assertScopable, assertSequenceExpression, assertSpreadElement, assertSpreadProperty, assertStatement, assertStaticBlock, assertStringLiteral, assertStringLiteralTypeAnnotation, assertStringTypeAnnotation, assertSuper, assertSwitchCase, assertSwitchStatement, assertSymbolTypeAnnotation, assertTSAnyKeyword, assertTSArrayType, assertTSAsExpression, assertTSBaseType, assertTSBigIntKeyword, assertTSBooleanKeyword, assertTSCallSignatureDeclaration, assertTSConditionalType, assertTSConstructSignatureDeclaration, assertTSConstructorType, assertTSDeclareFunction, assertTSDeclareMethod, assertTSEntityName, assertTSEnumDeclaration, assertTSEnumMember, assertTSExportAssignment, assertTSExpressionWithTypeArguments, assertTSExternalModuleReference, assertTSFunctionType, assertTSImportEqualsDeclaration, assertTSImportType, assertTSIndexSignature, assertTSIndexedAccessType, assertTSInferType, assertTSInterfaceBody, assertTSInterfaceDeclaration, assertTSIntersectionType, assertTSIntrinsicKeyword, assertTSLiteralType, assertTSMappedType, assertTSMethodSignature, assertTSModuleBlock, assertTSModuleDeclaration, assertTSNamedTupleMember, assertTSNamespaceExportDeclaration, assertTSNeverKeyword, assertTSNonNullExpression, assertTSNullKeyword, assertTSNumberKeyword, assertTSObjectKeyword, assertTSOptionalType, assertTSParameterProperty, assertTSParenthesizedType, assertTSPropertySignature, assertTSQualifiedName, assertTSRestType, assertTSStringKeyword, assertTSSymbolKeyword, assertTSThisType, assertTSTupleType, assertTSType, assertTSTypeAliasDeclaration, assertTSTypeAnnotation, assertTSTypeAssertion, assertTSTypeElement, assertTSTypeLiteral, assertTSTypeOperator, assertTSTypeParameter, assertTSTypeParameterDeclaration, assertTSTypeParameterInstantiation, assertTSTypePredicate, assertTSTypeQuery, assertTSTypeReference, assertTSUndefinedKeyword, assertTSUnionType, assertTSUnknownKeyword, assertTSVoidKeyword, assertTaggedTemplateExpression, assertTemplateElement, assertTemplateLiteral, assertTerminatorless, assertThisExpression, assertThisTypeAnnotation, assertThrowStatement, assertTopicReference, assertTryStatement, assertTupleExpression, assertTupleTypeAnnotation, assertTypeAlias, assertTypeAnnotation, assertTypeCastExpression, assertTypeParameter, assertTypeParameterDeclaration, assertTypeParameterInstantiation, assertTypeofTypeAnnotation, assertUnaryExpression, assertUnaryLike, assertUnionTypeAnnotation, assertUpdateExpression, assertUserWhitespacable, assertV8IntrinsicIdentifier, assertVariableDeclaration, assertVariableDeclarator, assertVariance, assertVoidTypeAnnotation, assertWhile, assertWhileStatement, assertWithStatement, assertYieldExpression, assignmentExpression, assignmentPattern, awaitExpression, bigIntLiteral, binaryExpression, bindExpression, blockStatement, booleanLiteral, booleanLiteralTypeAnnotation, booleanTypeAnnotation, breakStatement, buildMatchMemberExpression, callExpression, catchClause, classBody, classDeclaration, classExpression, classImplements, classMethod, classPrivateMethod, classPrivateProperty, classProperty, clone, cloneDeep, cloneDeepWithoutLoc, cloneNode, cloneWithoutLoc, conditionalExpression, continueStatement, createFlowUnionType, createTSUnionType, createTypeAnnotationBasedOnTypeof, createFlowUnionType as createUnionTypeAnnotation, debuggerStatement, decimalLiteral, declareClass, declareExportAllDeclaration, declareExportDeclaration, declareFunction, declareInterface, declareModule, declareModuleExports, declareOpaqueType, declareTypeAlias, declareVariable, declaredPredicate, decorator, directive, directiveLiteral, doExpression, doWhileStatement, emptyStatement, emptyTypeAnnotation, ensureBlock, enumBooleanBody, enumBooleanMember, enumDeclaration, enumDefaultedMember, enumNumberBody, enumNumberMember, enumStringBody, enumStringMember, enumSymbolBody, existsTypeAnnotation, exportAllDeclaration, exportDefaultDeclaration, exportDefaultSpecifier, exportNamedDeclaration, exportNamespaceSpecifier, exportSpecifier, expressionStatement, file, forInStatement, forOfStatement, forStatement, functionDeclaration, functionExpression, functionTypeAnnotation, functionTypeParam, genericTypeAnnotation, getBindingIdentifiers, _default as getOuterBindingIdentifiers, identifier, ifStatement, _import as import, importAttribute, importDeclaration, importDefaultSpecifier, importNamespaceSpecifier, importSpecifier, indexedAccessType, inferredPredicate, inheritInnerComments, inheritLeadingComments, inheritTrailingComments, inherits, inheritsComments, interfaceDeclaration, interfaceExtends, interfaceTypeAnnotation, interpreterDirective, intersectionTypeAnnotation, is, isAnyTypeAnnotation, isArgumentPlaceholder, isArrayExpression, isArrayPattern, isArrayTypeAnnotation, isArrowFunctionExpression, isAssignmentExpression, isAssignmentPattern, isAwaitExpression, isBigIntLiteral, isBinary, isBinaryExpression, isBindExpression, isBinding, isBlock, isBlockParent, isBlockScoped, isBlockStatement, isBooleanLiteral, isBooleanLiteralTypeAnnotation, isBooleanTypeAnnotation, isBreakStatement, isCallExpression, isCatchClause, isClass, isClassBody, isClassDeclaration, isClassExpression, isClassImplements, isClassMethod, isClassPrivateMethod, isClassPrivateProperty, isClassProperty, isCompletionStatement, isConditional, isConditionalExpression, isContinueStatement, isDebuggerStatement, isDecimalLiteral, isDeclaration, isDeclareClass, isDeclareExportAllDeclaration, isDeclareExportDeclaration, isDeclareFunction, isDeclareInterface, isDeclareModule, isDeclareModuleExports, isDeclareOpaqueType, isDeclareTypeAlias, isDeclareVariable, isDeclaredPredicate, isDecorator, isDirective, isDirectiveLiteral, isDoExpression, isDoWhileStatement, isEmptyStatement, isEmptyTypeAnnotation, isEnumBody, isEnumBooleanBody, isEnumBooleanMember, isEnumDeclaration, isEnumDefaultedMember, isEnumMember, isEnumNumberBody, isEnumNumberMember, isEnumStringBody, isEnumStringMember, isEnumSymbolBody, isExistsTypeAnnotation, isExportAllDeclaration, isExportDeclaration, isExportDefaultDeclaration, isExportDefaultSpecifier, isExportNamedDeclaration, isExportNamespaceSpecifier, isExportSpecifier, isExpression, isExpressionStatement, isExpressionWrapper, isFile, isFlow, isFlowBaseAnnotation, isFlowDeclaration, isFlowPredicate, isFlowType, isFor, isForInStatement, isForOfStatement, isForStatement, isForXStatement, isFunction, isFunctionDeclaration, isFunctionExpression, isFunctionParent, isFunctionTypeAnnotation, isFunctionTypeParam, isGenericTypeAnnotation, isIdentifier, isIfStatement, isImmutable, isImport, isImportAttribute, isImportDeclaration, isImportDefaultSpecifier, isImportNamespaceSpecifier, isImportSpecifier, isIndexedAccessType, isInferredPredicate, isInterfaceDeclaration, isInterfaceExtends, isInterfaceTypeAnnotation, isInterpreterDirective, isIntersectionTypeAnnotation, isJSX, isJSXAttribute, isJSXClosingElement, isJSXClosingFragment, isJSXElement, isJSXEmptyExpression, isJSXExpressionContainer, isJSXFragment, isJSXIdentifier, isJSXMemberExpression, isJSXNamespacedName, isJSXOpeningElement, isJSXOpeningFragment, isJSXSpreadAttribute, isJSXSpreadChild, isJSXText, isLVal, isLabeledStatement, isLet, isLiteral, isLogicalExpression, isLoop, isMemberExpression, isMetaProperty, isMethod, isMixedTypeAnnotation, isModuleDeclaration, isModuleExpression, isModuleSpecifier, isNewExpression, isNode, isNodesEquivalent, isNoop, isNullLiteral, isNullLiteralTypeAnnotation, isNullableTypeAnnotation, isNumberLiteral, isNumberLiteralTypeAnnotation, isNumberTypeAnnotation, isNumericLiteral, isObjectExpression, isObjectMember, isObjectMethod, isObjectPattern, isObjectProperty, isObjectTypeAnnotation, isObjectTypeCallProperty, isObjectTypeIndexer, isObjectTypeInternalSlot, isObjectTypeProperty, isObjectTypeSpreadProperty, isOpaqueType, isOptionalCallExpression, isOptionalIndexedAccessType, isOptionalMemberExpression, isParenthesizedExpression, isPattern, isPatternLike, isPipelineBareFunction, isPipelinePrimaryTopicReference, isPipelineTopicExpression, isPlaceholder, isPlaceholderType, isPrivate, isPrivateName, isProgram, isProperty, isPureish, isQualifiedTypeIdentifier, isRecordExpression, isReferenced, isRegExpLiteral, isRegexLiteral, isRestElement, isRestProperty, isReturnStatement, isScopable, isScope, isSequenceExpression, isSpecifierDefault, isSpreadElement, isSpreadProperty, isStatement, isStaticBlock, isStringLiteral, isStringLiteralTypeAnnotation, isStringTypeAnnotation, isSuper, isSwitchCase, isSwitchStatement, isSymbolTypeAnnotation, isTSAnyKeyword, isTSArrayType, isTSAsExpression, isTSBaseType, isTSBigIntKeyword, isTSBooleanKeyword, isTSCallSignatureDeclaration, isTSConditionalType, isTSConstructSignatureDeclaration, isTSConstructorType, isTSDeclareFunction, isTSDeclareMethod, isTSEntityName, isTSEnumDeclaration, isTSEnumMember, isTSExportAssignment, isTSExpressionWithTypeArguments, isTSExternalModuleReference, isTSFunctionType, isTSImportEqualsDeclaration, isTSImportType, isTSIndexSignature, isTSIndexedAccessType, isTSInferType, isTSInterfaceBody, isTSInterfaceDeclaration, isTSIntersectionType, isTSIntrinsicKeyword, isTSLiteralType, isTSMappedType, isTSMethodSignature, isTSModuleBlock, isTSModuleDeclaration, isTSNamedTupleMember, isTSNamespaceExportDeclaration, isTSNeverKeyword, isTSNonNullExpression, isTSNullKeyword, isTSNumberKeyword, isTSObjectKeyword, isTSOptionalType, isTSParameterProperty, isTSParenthesizedType, isTSPropertySignature, isTSQualifiedName, isTSRestType, isTSStringKeyword, isTSSymbolKeyword, isTSThisType, isTSTupleType, isTSType, isTSTypeAliasDeclaration, isTSTypeAnnotation, isTSTypeAssertion, isTSTypeElement, isTSTypeLiteral, isTSTypeOperator, isTSTypeParameter, isTSTypeParameterDeclaration, isTSTypeParameterInstantiation, isTSTypePredicate, isTSTypeQuery, isTSTypeReference, isTSUndefinedKeyword, isTSUnionType, isTSUnknownKeyword, isTSVoidKeyword, isTaggedTemplateExpression, isTemplateElement, isTemplateLiteral, isTerminatorless, isThisExpression, isThisTypeAnnotation, isThrowStatement, isTopicReference, isTryStatement, isTupleExpression, isTupleTypeAnnotation, isType, isTypeAlias, isTypeAnnotation, isTypeCastExpression, isTypeParameter, isTypeParameterDeclaration, isTypeParameterInstantiation, isTypeofTypeAnnotation, isUnaryExpression, isUnaryLike, isUnionTypeAnnotation, isUpdateExpression, isUserWhitespacable, isV8IntrinsicIdentifier, isValidES3Identifier, isValidIdentifier, isVar, isVariableDeclaration, isVariableDeclarator, isVariance, isVoidTypeAnnotation, isWhile, isWhileStatement, isWithStatement, isYieldExpression, jsxAttribute as jSXAttribute, jsxClosingElement as jSXClosingElement, jsxClosingFragment as jSXClosingFragment, jsxElement as jSXElement, jsxEmptyExpression as jSXEmptyExpression, jsxExpressionContainer as jSXExpressionContainer, jsxFragment as jSXFragment, jsxIdentifier as jSXIdentifier, jsxMemberExpression as jSXMemberExpression, jsxNamespacedName as jSXNamespacedName, jsxOpeningElement as jSXOpeningElement, jsxOpeningFragment as jSXOpeningFragment, jsxSpreadAttribute as jSXSpreadAttribute, jsxSpreadChild as jSXSpreadChild, jsxText as jSXText, jsxAttribute, jsxClosingElement, jsxClosingFragment, jsxElement, jsxEmptyExpression, jsxExpressionContainer, jsxFragment, jsxIdentifier, jsxMemberExpression, jsxNamespacedName, jsxOpeningElement, jsxOpeningFragment, jsxSpreadAttribute, jsxSpreadChild, jsxText, labeledStatement, logicalExpression, matchesPattern, memberExpression, metaProperty, mixedTypeAnnotation, moduleExpression, newExpression, noop, nullLiteral, nullLiteralTypeAnnotation, nullableTypeAnnotation, NumberLiteral as numberLiteral, numberLiteralTypeAnnotation, numberTypeAnnotation, numericLiteral, objectExpression, objectMethod, objectPattern, objectProperty, objectTypeAnnotation, objectTypeCallProperty, objectTypeIndexer, objectTypeInternalSlot, objectTypeProperty, objectTypeSpreadProperty, opaqueType, optionalCallExpression, optionalIndexedAccessType, optionalMemberExpression, parenthesizedExpression, pipelineBareFunction, pipelinePrimaryTopicReference, pipelineTopicExpression, placeholder, prependToMemberExpression, privateName, program, qualifiedTypeIdentifier, react, recordExpression, regExpLiteral, RegexLiteral as regexLiteral, removeComments, removeProperties, removePropertiesDeep, removeTypeDuplicates, restElement, RestProperty as restProperty, returnStatement, sequenceExpression, shallowEqual, spreadElement, SpreadProperty as spreadProperty, staticBlock, stringLiteral, stringLiteralTypeAnnotation, stringTypeAnnotation, _super as super, switchCase, switchStatement, symbolTypeAnnotation, tsAnyKeyword as tSAnyKeyword, tsArrayType as tSArrayType, tsAsExpression as tSAsExpression, tsBigIntKeyword as tSBigIntKeyword, tsBooleanKeyword as tSBooleanKeyword, tsCallSignatureDeclaration as tSCallSignatureDeclaration, tsConditionalType as tSConditionalType, tsConstructSignatureDeclaration as tSConstructSignatureDeclaration, tsConstructorType as tSConstructorType, tsDeclareFunction as tSDeclareFunction, tsDeclareMethod as tSDeclareMethod, tsEnumDeclaration as tSEnumDeclaration, tsEnumMember as tSEnumMember, tsExportAssignment as tSExportAssignment, tsExpressionWithTypeArguments as tSExpressionWithTypeArguments, tsExternalModuleReference as tSExternalModuleReference, tsFunctionType as tSFunctionType, tsImportEqualsDeclaration as tSImportEqualsDeclaration, tsImportType as tSImportType, tsIndexSignature as tSIndexSignature, tsIndexedAccessType as tSIndexedAccessType, tsInferType as tSInferType, tsInterfaceBody as tSInterfaceBody, tsInterfaceDeclaration as tSInterfaceDeclaration, tsIntersectionType as tSIntersectionType, tsIntrinsicKeyword as tSIntrinsicKeyword, tsLiteralType as tSLiteralType, tsMappedType as tSMappedType, tsMethodSignature as tSMethodSignature, tsModuleBlock as tSModuleBlock, tsModuleDeclaration as tSModuleDeclaration, tsNamedTupleMember as tSNamedTupleMember, tsNamespaceExportDeclaration as tSNamespaceExportDeclaration, tsNeverKeyword as tSNeverKeyword, tsNonNullExpression as tSNonNullExpression, tsNullKeyword as tSNullKeyword, tsNumberKeyword as tSNumberKeyword, tsObjectKeyword as tSObjectKeyword, tsOptionalType as tSOptionalType, tsParameterProperty as tSParameterProperty, tsParenthesizedType as tSParenthesizedType, tsPropertySignature as tSPropertySignature, tsQualifiedName as tSQualifiedName, tsRestType as tSRestType, tsStringKeyword as tSStringKeyword, tsSymbolKeyword as tSSymbolKeyword, tsThisType as tSThisType, tsTupleType as tSTupleType, tsTypeAliasDeclaration as tSTypeAliasDeclaration, tsTypeAnnotation as tSTypeAnnotation, tsTypeAssertion as tSTypeAssertion, tsTypeLiteral as tSTypeLiteral, tsTypeOperator as tSTypeOperator, tsTypeParameter as tSTypeParameter, tsTypeParameterDeclaration as tSTypeParameterDeclaration, tsTypeParameterInstantiation as tSTypeParameterInstantiation, tsTypePredicate as tSTypePredicate, tsTypeQuery as tSTypeQuery, tsTypeReference as tSTypeReference, tsUndefinedKeyword as tSUndefinedKeyword, tsUnionType as tSUnionType, tsUnknownKeyword as tSUnknownKeyword, tsVoidKeyword as tSVoidKeyword, taggedTemplateExpression, templateElement, templateLiteral, thisExpression, thisTypeAnnotation, throwStatement, toBindingIdentifierName, toBlock, toComputedKey, _default$3 as toExpression, toIdentifier, toKeyAlias, toSequenceExpression, _default$2 as toStatement, topicReference, traverse, traverseFast, tryStatement, tsAnyKeyword, tsArrayType, tsAsExpression, tsBigIntKeyword, tsBooleanKeyword, tsCallSignatureDeclaration, tsConditionalType, tsConstructSignatureDeclaration, tsConstructorType, tsDeclareFunction, tsDeclareMethod, tsEnumDeclaration, tsEnumMember, tsExportAssignment, tsExpressionWithTypeArguments, tsExternalModuleReference, tsFunctionType, tsImportEqualsDeclaration, tsImportType, tsIndexSignature, tsIndexedAccessType, tsInferType, tsInterfaceBody, tsInterfaceDeclaration, tsIntersectionType, tsIntrinsicKeyword, tsLiteralType, tsMappedType, tsMethodSignature, tsModuleBlock, tsModuleDeclaration, tsNamedTupleMember, tsNamespaceExportDeclaration, tsNeverKeyword, tsNonNullExpression, tsNullKeyword, tsNumberKeyword, tsObjectKeyword, tsOptionalType, tsParameterProperty, tsParenthesizedType, tsPropertySignature, tsQualifiedName, tsRestType, tsStringKeyword, tsSymbolKeyword, tsThisType, tsTupleType, tsTypeAliasDeclaration, tsTypeAnnotation, tsTypeAssertion, tsTypeLiteral, tsTypeOperator, tsTypeParameter, tsTypeParameterDeclaration, tsTypeParameterInstantiation, tsTypePredicate, tsTypeQuery, tsTypeReference, tsUndefinedKeyword, tsUnionType, tsUnknownKeyword, tsVoidKeyword, tupleExpression, tupleTypeAnnotation, typeAlias, typeAnnotation, typeCastExpression, typeParameter, typeParameterDeclaration, typeParameterInstantiation, typeofTypeAnnotation, unaryExpression, unionTypeAnnotation, updateExpression, v8IntrinsicIdentifier, validate, _default$1 as valueToNode, variableDeclaration, variableDeclarator, variance, voidTypeAnnotation, whileStatement, withStatement, yieldExpression }; diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index.js deleted file mode 100644 index 6fd730b5..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index.js +++ /dev/null @@ -1,647 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var _exportNames = { - react: true, - assertNode: true, - createTypeAnnotationBasedOnTypeof: true, - createUnionTypeAnnotation: true, - createFlowUnionType: true, - createTSUnionType: true, - cloneNode: true, - clone: true, - cloneDeep: true, - cloneDeepWithoutLoc: true, - cloneWithoutLoc: true, - addComment: true, - addComments: true, - inheritInnerComments: true, - inheritLeadingComments: true, - inheritsComments: true, - inheritTrailingComments: true, - removeComments: true, - ensureBlock: true, - toBindingIdentifierName: true, - toBlock: true, - toComputedKey: true, - toExpression: true, - toIdentifier: true, - toKeyAlias: true, - toSequenceExpression: true, - toStatement: true, - valueToNode: true, - appendToMemberExpression: true, - inherits: true, - prependToMemberExpression: true, - removeProperties: true, - removePropertiesDeep: true, - removeTypeDuplicates: true, - getBindingIdentifiers: true, - getOuterBindingIdentifiers: true, - traverse: true, - traverseFast: true, - shallowEqual: true, - is: true, - isBinding: true, - isBlockScoped: true, - isImmutable: true, - isLet: true, - isNode: true, - isNodesEquivalent: true, - isPlaceholderType: true, - isReferenced: true, - isScope: true, - isSpecifierDefault: true, - isType: true, - isValidES3Identifier: true, - isValidIdentifier: true, - isVar: true, - matchesPattern: true, - validate: true, - buildMatchMemberExpression: true -}; -Object.defineProperty(exports, "assertNode", { - enumerable: true, - get: function () { - return _assertNode.default; - } -}); -Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", { - enumerable: true, - get: function () { - return _createTypeAnnotationBasedOnTypeof.default; - } -}); -Object.defineProperty(exports, "createUnionTypeAnnotation", { - enumerable: true, - get: function () { - return _createFlowUnionType.default; - } -}); -Object.defineProperty(exports, "createFlowUnionType", { - enumerable: true, - get: function () { - return _createFlowUnionType.default; - } -}); -Object.defineProperty(exports, "createTSUnionType", { - enumerable: true, - get: function () { - return _createTSUnionType.default; - } -}); -Object.defineProperty(exports, "cloneNode", { - enumerable: true, - get: function () { - return _cloneNode.default; - } -}); -Object.defineProperty(exports, "clone", { - enumerable: true, - get: function () { - return _clone.default; - } -}); -Object.defineProperty(exports, "cloneDeep", { - enumerable: true, - get: function () { - return _cloneDeep.default; - } -}); -Object.defineProperty(exports, "cloneDeepWithoutLoc", { - enumerable: true, - get: function () { - return _cloneDeepWithoutLoc.default; - } -}); -Object.defineProperty(exports, "cloneWithoutLoc", { - enumerable: true, - get: function () { - return _cloneWithoutLoc.default; - } -}); -Object.defineProperty(exports, "addComment", { - enumerable: true, - get: function () { - return _addComment.default; - } -}); -Object.defineProperty(exports, "addComments", { - enumerable: true, - get: function () { - return _addComments.default; - } -}); -Object.defineProperty(exports, "inheritInnerComments", { - enumerable: true, - get: function () { - return _inheritInnerComments.default; - } -}); -Object.defineProperty(exports, "inheritLeadingComments", { - enumerable: true, - get: function () { - return _inheritLeadingComments.default; - } -}); -Object.defineProperty(exports, "inheritsComments", { - enumerable: true, - get: function () { - return _inheritsComments.default; - } -}); -Object.defineProperty(exports, "inheritTrailingComments", { - enumerable: true, - get: function () { - return _inheritTrailingComments.default; - } -}); -Object.defineProperty(exports, "removeComments", { - enumerable: true, - get: function () { - return _removeComments.default; - } -}); -Object.defineProperty(exports, "ensureBlock", { - enumerable: true, - get: function () { - return _ensureBlock.default; - } -}); -Object.defineProperty(exports, "toBindingIdentifierName", { - enumerable: true, - get: function () { - return _toBindingIdentifierName.default; - } -}); -Object.defineProperty(exports, "toBlock", { - enumerable: true, - get: function () { - return _toBlock.default; - } -}); -Object.defineProperty(exports, "toComputedKey", { - enumerable: true, - get: function () { - return _toComputedKey.default; - } -}); -Object.defineProperty(exports, "toExpression", { - enumerable: true, - get: function () { - return _toExpression.default; - } -}); -Object.defineProperty(exports, "toIdentifier", { - enumerable: true, - get: function () { - return _toIdentifier.default; - } -}); -Object.defineProperty(exports, "toKeyAlias", { - enumerable: true, - get: function () { - return _toKeyAlias.default; - } -}); -Object.defineProperty(exports, "toSequenceExpression", { - enumerable: true, - get: function () { - return _toSequenceExpression.default; - } -}); -Object.defineProperty(exports, "toStatement", { - enumerable: true, - get: function () { - return _toStatement.default; - } -}); -Object.defineProperty(exports, "valueToNode", { - enumerable: true, - get: function () { - return _valueToNode.default; - } -}); -Object.defineProperty(exports, "appendToMemberExpression", { - enumerable: true, - get: function () { - return _appendToMemberExpression.default; - } -}); -Object.defineProperty(exports, "inherits", { - enumerable: true, - get: function () { - return _inherits.default; - } -}); -Object.defineProperty(exports, "prependToMemberExpression", { - enumerable: true, - get: function () { - return _prependToMemberExpression.default; - } -}); -Object.defineProperty(exports, "removeProperties", { - enumerable: true, - get: function () { - return _removeProperties.default; - } -}); -Object.defineProperty(exports, "removePropertiesDeep", { - enumerable: true, - get: function () { - return _removePropertiesDeep.default; - } -}); -Object.defineProperty(exports, "removeTypeDuplicates", { - enumerable: true, - get: function () { - return _removeTypeDuplicates.default; - } -}); -Object.defineProperty(exports, "getBindingIdentifiers", { - enumerable: true, - get: function () { - return _getBindingIdentifiers.default; - } -}); -Object.defineProperty(exports, "getOuterBindingIdentifiers", { - enumerable: true, - get: function () { - return _getOuterBindingIdentifiers.default; - } -}); -Object.defineProperty(exports, "traverse", { - enumerable: true, - get: function () { - return _traverse.default; - } -}); -Object.defineProperty(exports, "traverseFast", { - enumerable: true, - get: function () { - return _traverseFast.default; - } -}); -Object.defineProperty(exports, "shallowEqual", { - enumerable: true, - get: function () { - return _shallowEqual.default; - } -}); -Object.defineProperty(exports, "is", { - enumerable: true, - get: function () { - return _is.default; - } -}); -Object.defineProperty(exports, "isBinding", { - enumerable: true, - get: function () { - return _isBinding.default; - } -}); -Object.defineProperty(exports, "isBlockScoped", { - enumerable: true, - get: function () { - return _isBlockScoped.default; - } -}); -Object.defineProperty(exports, "isImmutable", { - enumerable: true, - get: function () { - return _isImmutable.default; - } -}); -Object.defineProperty(exports, "isLet", { - enumerable: true, - get: function () { - return _isLet.default; - } -}); -Object.defineProperty(exports, "isNode", { - enumerable: true, - get: function () { - return _isNode.default; - } -}); -Object.defineProperty(exports, "isNodesEquivalent", { - enumerable: true, - get: function () { - return _isNodesEquivalent.default; - } -}); -Object.defineProperty(exports, "isPlaceholderType", { - enumerable: true, - get: function () { - return _isPlaceholderType.default; - } -}); -Object.defineProperty(exports, "isReferenced", { - enumerable: true, - get: function () { - return _isReferenced.default; - } -}); -Object.defineProperty(exports, "isScope", { - enumerable: true, - get: function () { - return _isScope.default; - } -}); -Object.defineProperty(exports, "isSpecifierDefault", { - enumerable: true, - get: function () { - return _isSpecifierDefault.default; - } -}); -Object.defineProperty(exports, "isType", { - enumerable: true, - get: function () { - return _isType.default; - } -}); -Object.defineProperty(exports, "isValidES3Identifier", { - enumerable: true, - get: function () { - return _isValidES3Identifier.default; - } -}); -Object.defineProperty(exports, "isValidIdentifier", { - enumerable: true, - get: function () { - return _isValidIdentifier.default; - } -}); -Object.defineProperty(exports, "isVar", { - enumerable: true, - get: function () { - return _isVar.default; - } -}); -Object.defineProperty(exports, "matchesPattern", { - enumerable: true, - get: function () { - return _matchesPattern.default; - } -}); -Object.defineProperty(exports, "validate", { - enumerable: true, - get: function () { - return _validate.default; - } -}); -Object.defineProperty(exports, "buildMatchMemberExpression", { - enumerable: true, - get: function () { - return _buildMatchMemberExpression.default; - } -}); -exports.react = void 0; - -var _isReactComponent = require("./validators/react/isReactComponent"); - -var _isCompatTag = require("./validators/react/isCompatTag"); - -var _buildChildren = require("./builders/react/buildChildren"); - -var _assertNode = require("./asserts/assertNode"); - -var _generated = require("./asserts/generated"); - -Object.keys(_generated).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in exports && exports[key] === _generated[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _generated[key]; - } - }); -}); - -var _createTypeAnnotationBasedOnTypeof = require("./builders/flow/createTypeAnnotationBasedOnTypeof"); - -var _createFlowUnionType = require("./builders/flow/createFlowUnionType"); - -var _createTSUnionType = require("./builders/typescript/createTSUnionType"); - -var _generated2 = require("./builders/generated"); - -Object.keys(_generated2).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in exports && exports[key] === _generated2[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _generated2[key]; - } - }); -}); - -var _uppercase = require("./builders/generated/uppercase"); - -Object.keys(_uppercase).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in exports && exports[key] === _uppercase[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _uppercase[key]; - } - }); -}); - -var _cloneNode = require("./clone/cloneNode"); - -var _clone = require("./clone/clone"); - -var _cloneDeep = require("./clone/cloneDeep"); - -var _cloneDeepWithoutLoc = require("./clone/cloneDeepWithoutLoc"); - -var _cloneWithoutLoc = require("./clone/cloneWithoutLoc"); - -var _addComment = require("./comments/addComment"); - -var _addComments = require("./comments/addComments"); - -var _inheritInnerComments = require("./comments/inheritInnerComments"); - -var _inheritLeadingComments = require("./comments/inheritLeadingComments"); - -var _inheritsComments = require("./comments/inheritsComments"); - -var _inheritTrailingComments = require("./comments/inheritTrailingComments"); - -var _removeComments = require("./comments/removeComments"); - -var _generated3 = require("./constants/generated"); - -Object.keys(_generated3).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in exports && exports[key] === _generated3[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _generated3[key]; - } - }); -}); - -var _constants = require("./constants"); - -Object.keys(_constants).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in exports && exports[key] === _constants[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _constants[key]; - } - }); -}); - -var _ensureBlock = require("./converters/ensureBlock"); - -var _toBindingIdentifierName = require("./converters/toBindingIdentifierName"); - -var _toBlock = require("./converters/toBlock"); - -var _toComputedKey = require("./converters/toComputedKey"); - -var _toExpression = require("./converters/toExpression"); - -var _toIdentifier = require("./converters/toIdentifier"); - -var _toKeyAlias = require("./converters/toKeyAlias"); - -var _toSequenceExpression = require("./converters/toSequenceExpression"); - -var _toStatement = require("./converters/toStatement"); - -var _valueToNode = require("./converters/valueToNode"); - -var _definitions = require("./definitions"); - -Object.keys(_definitions).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in exports && exports[key] === _definitions[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _definitions[key]; - } - }); -}); - -var _appendToMemberExpression = require("./modifications/appendToMemberExpression"); - -var _inherits = require("./modifications/inherits"); - -var _prependToMemberExpression = require("./modifications/prependToMemberExpression"); - -var _removeProperties = require("./modifications/removeProperties"); - -var _removePropertiesDeep = require("./modifications/removePropertiesDeep"); - -var _removeTypeDuplicates = require("./modifications/flow/removeTypeDuplicates"); - -var _getBindingIdentifiers = require("./retrievers/getBindingIdentifiers"); - -var _getOuterBindingIdentifiers = require("./retrievers/getOuterBindingIdentifiers"); - -var _traverse = require("./traverse/traverse"); - -Object.keys(_traverse).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in exports && exports[key] === _traverse[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _traverse[key]; - } - }); -}); - -var _traverseFast = require("./traverse/traverseFast"); - -var _shallowEqual = require("./utils/shallowEqual"); - -var _is = require("./validators/is"); - -var _isBinding = require("./validators/isBinding"); - -var _isBlockScoped = require("./validators/isBlockScoped"); - -var _isImmutable = require("./validators/isImmutable"); - -var _isLet = require("./validators/isLet"); - -var _isNode = require("./validators/isNode"); - -var _isNodesEquivalent = require("./validators/isNodesEquivalent"); - -var _isPlaceholderType = require("./validators/isPlaceholderType"); - -var _isReferenced = require("./validators/isReferenced"); - -var _isScope = require("./validators/isScope"); - -var _isSpecifierDefault = require("./validators/isSpecifierDefault"); - -var _isType = require("./validators/isType"); - -var _isValidES3Identifier = require("./validators/isValidES3Identifier"); - -var _isValidIdentifier = require("./validators/isValidIdentifier"); - -var _isVar = require("./validators/isVar"); - -var _matchesPattern = require("./validators/matchesPattern"); - -var _validate = require("./validators/validate"); - -var _buildMatchMemberExpression = require("./validators/buildMatchMemberExpression"); - -var _generated4 = require("./validators/generated"); - -Object.keys(_generated4).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in exports && exports[key] === _generated4[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _generated4[key]; - } - }); -}); - -var _generated5 = require("./ast-types/generated"); - -Object.keys(_generated5).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - if (key in exports && exports[key] === _generated5[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _generated5[key]; - } - }); -}); -const react = { - isReactComponent: _isReactComponent.default, - isCompatTag: _isCompatTag.default, - buildChildren: _buildChildren.default -}; -exports.react = react; \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index.js.flow b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index.js.flow deleted file mode 100644 index 315ab9c9..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/index.js.flow +++ /dev/null @@ -1,2539 +0,0 @@ -// NOTE: This file is autogenerated. Do not modify. -// See packages/babel-types/scripts/generators/flow.js for script used. - -declare class BabelNodeComment { - value: string; - start: number; - end: number; - loc: BabelNodeSourceLocation; -} - -declare class BabelNodeCommentBlock extends BabelNodeComment { - type: "CommentBlock"; -} - -declare class BabelNodeCommentLine extends BabelNodeComment { - type: "CommentLine"; -} - -declare class BabelNodeSourceLocation { - start: { - line: number; - column: number; - }; - - end: { - line: number; - column: number; - }; -} - -declare class BabelNode { - leadingComments?: Array; - innerComments?: Array; - trailingComments?: Array; - start: ?number; - end: ?number; - loc: ?BabelNodeSourceLocation; - extra?: { [string]: mixed }; -} - -declare class BabelNodeArrayExpression extends BabelNode { - type: "ArrayExpression"; - elements?: Array; -} - -declare class BabelNodeAssignmentExpression extends BabelNode { - type: "AssignmentExpression"; - operator: string; - left: BabelNodeLVal; - right: BabelNodeExpression; -} - -declare class BabelNodeBinaryExpression extends BabelNode { - type: "BinaryExpression"; - operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<="; - left: BabelNodeExpression | BabelNodePrivateName; - right: BabelNodeExpression; -} - -declare class BabelNodeInterpreterDirective extends BabelNode { - type: "InterpreterDirective"; - value: string; -} - -declare class BabelNodeDirective extends BabelNode { - type: "Directive"; - value: BabelNodeDirectiveLiteral; -} - -declare class BabelNodeDirectiveLiteral extends BabelNode { - type: "DirectiveLiteral"; - value: string; -} - -declare class BabelNodeBlockStatement extends BabelNode { - type: "BlockStatement"; - body: Array; - directives?: Array; -} - -declare class BabelNodeBreakStatement extends BabelNode { - type: "BreakStatement"; - label?: BabelNodeIdentifier; -} - -declare class BabelNodeCallExpression extends BabelNode { - type: "CallExpression"; - callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier; - arguments: Array; - optional?: true | false; - typeArguments?: BabelNodeTypeParameterInstantiation; - typeParameters?: BabelNodeTSTypeParameterInstantiation; -} - -declare class BabelNodeCatchClause extends BabelNode { - type: "CatchClause"; - param?: BabelNodeIdentifier | BabelNodeArrayPattern | BabelNodeObjectPattern; - body: BabelNodeBlockStatement; -} - -declare class BabelNodeConditionalExpression extends BabelNode { - type: "ConditionalExpression"; - test: BabelNodeExpression; - consequent: BabelNodeExpression; - alternate: BabelNodeExpression; -} - -declare class BabelNodeContinueStatement extends BabelNode { - type: "ContinueStatement"; - label?: BabelNodeIdentifier; -} - -declare class BabelNodeDebuggerStatement extends BabelNode { - type: "DebuggerStatement"; -} - -declare class BabelNodeDoWhileStatement extends BabelNode { - type: "DoWhileStatement"; - test: BabelNodeExpression; - body: BabelNodeStatement; -} - -declare class BabelNodeEmptyStatement extends BabelNode { - type: "EmptyStatement"; -} - -declare class BabelNodeExpressionStatement extends BabelNode { - type: "ExpressionStatement"; - expression: BabelNodeExpression; -} - -declare class BabelNodeFile extends BabelNode { - type: "File"; - program: BabelNodeProgram; - comments?: Array; - tokens?: Array; -} - -declare class BabelNodeForInStatement extends BabelNode { - type: "ForInStatement"; - left: BabelNodeVariableDeclaration | BabelNodeLVal; - right: BabelNodeExpression; - body: BabelNodeStatement; -} - -declare class BabelNodeForStatement extends BabelNode { - type: "ForStatement"; - init?: BabelNodeVariableDeclaration | BabelNodeExpression; - test?: BabelNodeExpression; - update?: BabelNodeExpression; - body: BabelNodeStatement; -} - -declare class BabelNodeFunctionDeclaration extends BabelNode { - type: "FunctionDeclaration"; - id?: BabelNodeIdentifier; - params: Array; - body: BabelNodeBlockStatement; - generator?: boolean; - async?: boolean; - declare?: boolean; - returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; - typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; -} - -declare class BabelNodeFunctionExpression extends BabelNode { - type: "FunctionExpression"; - id?: BabelNodeIdentifier; - params: Array; - body: BabelNodeBlockStatement; - generator?: boolean; - async?: boolean; - returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; - typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; -} - -declare class BabelNodeIdentifier extends BabelNode { - type: "Identifier"; - name: string; - decorators?: Array; - optional?: boolean; - typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; -} - -declare class BabelNodeIfStatement extends BabelNode { - type: "IfStatement"; - test: BabelNodeExpression; - consequent: BabelNodeStatement; - alternate?: BabelNodeStatement; -} - -declare class BabelNodeLabeledStatement extends BabelNode { - type: "LabeledStatement"; - label: BabelNodeIdentifier; - body: BabelNodeStatement; -} - -declare class BabelNodeStringLiteral extends BabelNode { - type: "StringLiteral"; - value: string; -} - -declare class BabelNodeNumericLiteral extends BabelNode { - type: "NumericLiteral"; - value: number; -} - -declare class BabelNodeNullLiteral extends BabelNode { - type: "NullLiteral"; -} - -declare class BabelNodeBooleanLiteral extends BabelNode { - type: "BooleanLiteral"; - value: boolean; -} - -declare class BabelNodeRegExpLiteral extends BabelNode { - type: "RegExpLiteral"; - pattern: string; - flags?: string; -} - -declare class BabelNodeLogicalExpression extends BabelNode { - type: "LogicalExpression"; - operator: "||" | "&&" | "??"; - left: BabelNodeExpression; - right: BabelNodeExpression; -} - -declare class BabelNodeMemberExpression extends BabelNode { - type: "MemberExpression"; - object: BabelNodeExpression; - property: BabelNodeExpression | BabelNodeIdentifier | BabelNodePrivateName; - computed?: boolean; - optional?: true | false; -} - -declare class BabelNodeNewExpression extends BabelNode { - type: "NewExpression"; - callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier; - arguments: Array; - optional?: true | false; - typeArguments?: BabelNodeTypeParameterInstantiation; - typeParameters?: BabelNodeTSTypeParameterInstantiation; -} - -declare class BabelNodeProgram extends BabelNode { - type: "Program"; - body: Array; - directives?: Array; - sourceType?: "script" | "module"; - interpreter?: BabelNodeInterpreterDirective; - sourceFile: string; -} - -declare class BabelNodeObjectExpression extends BabelNode { - type: "ObjectExpression"; - properties: Array; -} - -declare class BabelNodeObjectMethod extends BabelNode { - type: "ObjectMethod"; - kind?: "method" | "get" | "set"; - key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral; - params: Array; - body: BabelNodeBlockStatement; - computed?: boolean; - generator?: boolean; - async?: boolean; - decorators?: Array; - returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; - typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; -} - -declare class BabelNodeObjectProperty extends BabelNode { - type: "ObjectProperty"; - key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral; - value: BabelNodeExpression | BabelNodePatternLike; - computed?: boolean; - shorthand?: boolean; - decorators?: Array; -} - -declare class BabelNodeRestElement extends BabelNode { - type: "RestElement"; - argument: BabelNodeLVal; - decorators?: Array; - optional?: boolean; - typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; -} - -declare class BabelNodeReturnStatement extends BabelNode { - type: "ReturnStatement"; - argument?: BabelNodeExpression; -} - -declare class BabelNodeSequenceExpression extends BabelNode { - type: "SequenceExpression"; - expressions: Array; -} - -declare class BabelNodeParenthesizedExpression extends BabelNode { - type: "ParenthesizedExpression"; - expression: BabelNodeExpression; -} - -declare class BabelNodeSwitchCase extends BabelNode { - type: "SwitchCase"; - test?: BabelNodeExpression; - consequent: Array; -} - -declare class BabelNodeSwitchStatement extends BabelNode { - type: "SwitchStatement"; - discriminant: BabelNodeExpression; - cases: Array; -} - -declare class BabelNodeThisExpression extends BabelNode { - type: "ThisExpression"; -} - -declare class BabelNodeThrowStatement extends BabelNode { - type: "ThrowStatement"; - argument: BabelNodeExpression; -} - -declare class BabelNodeTryStatement extends BabelNode { - type: "TryStatement"; - block: BabelNodeBlockStatement; - handler?: BabelNodeCatchClause; - finalizer?: BabelNodeBlockStatement; -} - -declare class BabelNodeUnaryExpression extends BabelNode { - type: "UnaryExpression"; - operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof"; - argument: BabelNodeExpression; - prefix?: boolean; -} - -declare class BabelNodeUpdateExpression extends BabelNode { - type: "UpdateExpression"; - operator: "++" | "--"; - argument: BabelNodeExpression; - prefix?: boolean; -} - -declare class BabelNodeVariableDeclaration extends BabelNode { - type: "VariableDeclaration"; - kind: "var" | "let" | "const"; - declarations: Array; - declare?: boolean; -} - -declare class BabelNodeVariableDeclarator extends BabelNode { - type: "VariableDeclarator"; - id: BabelNodeLVal; - init?: BabelNodeExpression; - definite?: boolean; -} - -declare class BabelNodeWhileStatement extends BabelNode { - type: "WhileStatement"; - test: BabelNodeExpression; - body: BabelNodeStatement; -} - -declare class BabelNodeWithStatement extends BabelNode { - type: "WithStatement"; - object: BabelNodeExpression; - body: BabelNodeStatement; -} - -declare class BabelNodeAssignmentPattern extends BabelNode { - type: "AssignmentPattern"; - left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern | BabelNodeMemberExpression; - right: BabelNodeExpression; - decorators?: Array; - typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; -} - -declare class BabelNodeArrayPattern extends BabelNode { - type: "ArrayPattern"; - elements: Array; - decorators?: Array; - optional?: boolean; - typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; -} - -declare class BabelNodeArrowFunctionExpression extends BabelNode { - type: "ArrowFunctionExpression"; - params: Array; - body: BabelNodeBlockStatement | BabelNodeExpression; - async?: boolean; - expression: boolean; - generator?: boolean; - returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; - typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; -} - -declare class BabelNodeClassBody extends BabelNode { - type: "ClassBody"; - body: Array; -} - -declare class BabelNodeClassExpression extends BabelNode { - type: "ClassExpression"; - id?: BabelNodeIdentifier; - superClass?: BabelNodeExpression; - body: BabelNodeClassBody; - decorators?: Array; - mixins?: BabelNodeInterfaceExtends; - superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; - typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; -} - -declare class BabelNodeClassDeclaration extends BabelNode { - type: "ClassDeclaration"; - id: BabelNodeIdentifier; - superClass?: BabelNodeExpression; - body: BabelNodeClassBody; - decorators?: Array; - abstract?: boolean; - declare?: boolean; - mixins?: BabelNodeInterfaceExtends; - superTypeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; - typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; -} - -declare class BabelNodeExportAllDeclaration extends BabelNode { - type: "ExportAllDeclaration"; - source: BabelNodeStringLiteral; - assertions?: Array; - exportKind?: "type" | "value"; -} - -declare class BabelNodeExportDefaultDeclaration extends BabelNode { - type: "ExportDefaultDeclaration"; - declaration: BabelNodeFunctionDeclaration | BabelNodeTSDeclareFunction | BabelNodeClassDeclaration | BabelNodeExpression; - exportKind?: "value"; -} - -declare class BabelNodeExportNamedDeclaration extends BabelNode { - type: "ExportNamedDeclaration"; - declaration?: BabelNodeDeclaration; - specifiers?: Array; - source?: BabelNodeStringLiteral; - assertions?: Array; - exportKind?: "type" | "value"; -} - -declare class BabelNodeExportSpecifier extends BabelNode { - type: "ExportSpecifier"; - local: BabelNodeIdentifier; - exported: BabelNodeIdentifier | BabelNodeStringLiteral; -} - -declare class BabelNodeForOfStatement extends BabelNode { - type: "ForOfStatement"; - left: BabelNodeVariableDeclaration | BabelNodeLVal; - right: BabelNodeExpression; - body: BabelNodeStatement; -} - -declare class BabelNodeImportDeclaration extends BabelNode { - type: "ImportDeclaration"; - specifiers: Array; - source: BabelNodeStringLiteral; - assertions?: Array; - importKind?: "type" | "typeof" | "value"; -} - -declare class BabelNodeImportDefaultSpecifier extends BabelNode { - type: "ImportDefaultSpecifier"; - local: BabelNodeIdentifier; -} - -declare class BabelNodeImportNamespaceSpecifier extends BabelNode { - type: "ImportNamespaceSpecifier"; - local: BabelNodeIdentifier; -} - -declare class BabelNodeImportSpecifier extends BabelNode { - type: "ImportSpecifier"; - local: BabelNodeIdentifier; - imported: BabelNodeIdentifier | BabelNodeStringLiteral; - importKind?: "type" | "typeof"; -} - -declare class BabelNodeMetaProperty extends BabelNode { - type: "MetaProperty"; - meta: BabelNodeIdentifier; - property: BabelNodeIdentifier; -} - -declare class BabelNodeClassMethod extends BabelNode { - type: "ClassMethod"; - kind?: "get" | "set" | "method" | "constructor"; - key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression; - params: Array; - body: BabelNodeBlockStatement; - computed?: boolean; - generator?: boolean; - async?: boolean; - abstract?: boolean; - access?: "public" | "private" | "protected"; - accessibility?: "public" | "private" | "protected"; - decorators?: Array; - optional?: boolean; - override?: boolean; - returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; - typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; -} - -declare class BabelNodeObjectPattern extends BabelNode { - type: "ObjectPattern"; - properties: Array; - decorators?: Array; - typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; -} - -declare class BabelNodeSpreadElement extends BabelNode { - type: "SpreadElement"; - argument: BabelNodeExpression; -} - -declare class BabelNodeSuper extends BabelNode { - type: "Super"; -} - -declare class BabelNodeTaggedTemplateExpression extends BabelNode { - type: "TaggedTemplateExpression"; - tag: BabelNodeExpression; - quasi: BabelNodeTemplateLiteral; - typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; -} - -declare class BabelNodeTemplateElement extends BabelNode { - type: "TemplateElement"; - value: { raw: string, cooked?: string }; - tail?: boolean; -} - -declare class BabelNodeTemplateLiteral extends BabelNode { - type: "TemplateLiteral"; - quasis: Array; - expressions: Array; -} - -declare class BabelNodeYieldExpression extends BabelNode { - type: "YieldExpression"; - argument?: BabelNodeExpression; - delegate?: boolean; -} - -declare class BabelNodeAwaitExpression extends BabelNode { - type: "AwaitExpression"; - argument: BabelNodeExpression; -} - -declare class BabelNodeImport extends BabelNode { - type: "Import"; -} - -declare class BabelNodeBigIntLiteral extends BabelNode { - type: "BigIntLiteral"; - value: string; -} - -declare class BabelNodeExportNamespaceSpecifier extends BabelNode { - type: "ExportNamespaceSpecifier"; - exported: BabelNodeIdentifier; -} - -declare class BabelNodeOptionalMemberExpression extends BabelNode { - type: "OptionalMemberExpression"; - object: BabelNodeExpression; - property: BabelNodeExpression | BabelNodeIdentifier; - computed?: boolean; - optional: boolean; -} - -declare class BabelNodeOptionalCallExpression extends BabelNode { - type: "OptionalCallExpression"; - callee: BabelNodeExpression; - arguments: Array; - optional: boolean; - typeArguments?: BabelNodeTypeParameterInstantiation; - typeParameters?: BabelNodeTSTypeParameterInstantiation; -} - -declare class BabelNodeClassProperty extends BabelNode { - type: "ClassProperty"; - key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression; - value?: BabelNodeExpression; - typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; - decorators?: Array; - computed?: boolean; - abstract?: boolean; - accessibility?: "public" | "private" | "protected"; - declare?: boolean; - definite?: boolean; - optional?: boolean; - override?: boolean; - readonly?: boolean; - variance?: BabelNodeVariance; -} - -declare class BabelNodeClassPrivateProperty extends BabelNode { - type: "ClassPrivateProperty"; - key: BabelNodePrivateName; - value?: BabelNodeExpression; - decorators?: Array; - definite?: boolean; - readonly?: boolean; - typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; - variance?: BabelNodeVariance; -} - -declare class BabelNodeClassPrivateMethod extends BabelNode { - type: "ClassPrivateMethod"; - kind?: "get" | "set" | "method" | "constructor"; - key: BabelNodePrivateName; - params: Array; - body: BabelNodeBlockStatement; - abstract?: boolean; - access?: "public" | "private" | "protected"; - accessibility?: "public" | "private" | "protected"; - async?: boolean; - computed?: boolean; - decorators?: Array; - generator?: boolean; - optional?: boolean; - override?: boolean; - returnType?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop; - typeParameters?: BabelNodeTypeParameterDeclaration | BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; -} - -declare class BabelNodePrivateName extends BabelNode { - type: "PrivateName"; - id: BabelNodeIdentifier; -} - -declare class BabelNodeAnyTypeAnnotation extends BabelNode { - type: "AnyTypeAnnotation"; -} - -declare class BabelNodeArrayTypeAnnotation extends BabelNode { - type: "ArrayTypeAnnotation"; - elementType: BabelNodeFlowType; -} - -declare class BabelNodeBooleanTypeAnnotation extends BabelNode { - type: "BooleanTypeAnnotation"; -} - -declare class BabelNodeBooleanLiteralTypeAnnotation extends BabelNode { - type: "BooleanLiteralTypeAnnotation"; - value: boolean; -} - -declare class BabelNodeNullLiteralTypeAnnotation extends BabelNode { - type: "NullLiteralTypeAnnotation"; -} - -declare class BabelNodeClassImplements extends BabelNode { - type: "ClassImplements"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTypeParameterInstantiation; -} - -declare class BabelNodeDeclareClass extends BabelNode { - type: "DeclareClass"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTypeParameterDeclaration; - body: BabelNodeObjectTypeAnnotation; - mixins?: Array; -} - -declare class BabelNodeDeclareFunction extends BabelNode { - type: "DeclareFunction"; - id: BabelNodeIdentifier; - predicate?: BabelNodeDeclaredPredicate; -} - -declare class BabelNodeDeclareInterface extends BabelNode { - type: "DeclareInterface"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTypeParameterDeclaration; - body: BabelNodeObjectTypeAnnotation; - mixins?: Array; -} - -declare class BabelNodeDeclareModule extends BabelNode { - type: "DeclareModule"; - id: BabelNodeIdentifier | BabelNodeStringLiteral; - body: BabelNodeBlockStatement; - kind?: "CommonJS" | "ES"; -} - -declare class BabelNodeDeclareModuleExports extends BabelNode { - type: "DeclareModuleExports"; - typeAnnotation: BabelNodeTypeAnnotation; -} - -declare class BabelNodeDeclareTypeAlias extends BabelNode { - type: "DeclareTypeAlias"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTypeParameterDeclaration; - right: BabelNodeFlowType; -} - -declare class BabelNodeDeclareOpaqueType extends BabelNode { - type: "DeclareOpaqueType"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTypeParameterDeclaration; - supertype?: BabelNodeFlowType; - impltype?: BabelNodeFlowType; -} - -declare class BabelNodeDeclareVariable extends BabelNode { - type: "DeclareVariable"; - id: BabelNodeIdentifier; -} - -declare class BabelNodeDeclareExportDeclaration extends BabelNode { - type: "DeclareExportDeclaration"; - declaration?: BabelNodeFlow; - specifiers?: Array; - source?: BabelNodeStringLiteral; -} - -declare class BabelNodeDeclareExportAllDeclaration extends BabelNode { - type: "DeclareExportAllDeclaration"; - source: BabelNodeStringLiteral; - exportKind?: "type" | "value"; -} - -declare class BabelNodeDeclaredPredicate extends BabelNode { - type: "DeclaredPredicate"; - value: BabelNodeFlow; -} - -declare class BabelNodeExistsTypeAnnotation extends BabelNode { - type: "ExistsTypeAnnotation"; -} - -declare class BabelNodeFunctionTypeAnnotation extends BabelNode { - type: "FunctionTypeAnnotation"; - typeParameters?: BabelNodeTypeParameterDeclaration; - params: Array; - rest?: BabelNodeFunctionTypeParam; - returnType: BabelNodeFlowType; -} - -declare class BabelNodeFunctionTypeParam extends BabelNode { - type: "FunctionTypeParam"; - name?: BabelNodeIdentifier; - typeAnnotation: BabelNodeFlowType; - optional?: boolean; -} - -declare class BabelNodeGenericTypeAnnotation extends BabelNode { - type: "GenericTypeAnnotation"; - id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier; - typeParameters?: BabelNodeTypeParameterInstantiation; -} - -declare class BabelNodeInferredPredicate extends BabelNode { - type: "InferredPredicate"; -} - -declare class BabelNodeInterfaceExtends extends BabelNode { - type: "InterfaceExtends"; - id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier; - typeParameters?: BabelNodeTypeParameterInstantiation; -} - -declare class BabelNodeInterfaceDeclaration extends BabelNode { - type: "InterfaceDeclaration"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTypeParameterDeclaration; - body: BabelNodeObjectTypeAnnotation; - mixins?: Array; -} - -declare class BabelNodeInterfaceTypeAnnotation extends BabelNode { - type: "InterfaceTypeAnnotation"; - body: BabelNodeObjectTypeAnnotation; -} - -declare class BabelNodeIntersectionTypeAnnotation extends BabelNode { - type: "IntersectionTypeAnnotation"; - types: Array; -} - -declare class BabelNodeMixedTypeAnnotation extends BabelNode { - type: "MixedTypeAnnotation"; -} - -declare class BabelNodeEmptyTypeAnnotation extends BabelNode { - type: "EmptyTypeAnnotation"; -} - -declare class BabelNodeNullableTypeAnnotation extends BabelNode { - type: "NullableTypeAnnotation"; - typeAnnotation: BabelNodeFlowType; -} - -declare class BabelNodeNumberLiteralTypeAnnotation extends BabelNode { - type: "NumberLiteralTypeAnnotation"; - value: number; -} - -declare class BabelNodeNumberTypeAnnotation extends BabelNode { - type: "NumberTypeAnnotation"; -} - -declare class BabelNodeObjectTypeAnnotation extends BabelNode { - type: "ObjectTypeAnnotation"; - properties: Array; - indexers?: Array; - callProperties?: Array; - internalSlots?: Array; - exact?: boolean; - inexact?: boolean; -} - -declare class BabelNodeObjectTypeInternalSlot extends BabelNode { - type: "ObjectTypeInternalSlot"; - id: BabelNodeIdentifier; - value: BabelNodeFlowType; - optional: boolean; - method: boolean; -} - -declare class BabelNodeObjectTypeCallProperty extends BabelNode { - type: "ObjectTypeCallProperty"; - value: BabelNodeFlowType; -} - -declare class BabelNodeObjectTypeIndexer extends BabelNode { - type: "ObjectTypeIndexer"; - id?: BabelNodeIdentifier; - key: BabelNodeFlowType; - value: BabelNodeFlowType; - variance?: BabelNodeVariance; -} - -declare class BabelNodeObjectTypeProperty extends BabelNode { - type: "ObjectTypeProperty"; - key: BabelNodeIdentifier | BabelNodeStringLiteral; - value: BabelNodeFlowType; - variance?: BabelNodeVariance; - kind: "init" | "get" | "set"; - method: boolean; - optional: boolean; - proto: boolean; -} - -declare class BabelNodeObjectTypeSpreadProperty extends BabelNode { - type: "ObjectTypeSpreadProperty"; - argument: BabelNodeFlowType; -} - -declare class BabelNodeOpaqueType extends BabelNode { - type: "OpaqueType"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTypeParameterDeclaration; - supertype?: BabelNodeFlowType; - impltype: BabelNodeFlowType; -} - -declare class BabelNodeQualifiedTypeIdentifier extends BabelNode { - type: "QualifiedTypeIdentifier"; - id: BabelNodeIdentifier; - qualification: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier; -} - -declare class BabelNodeStringLiteralTypeAnnotation extends BabelNode { - type: "StringLiteralTypeAnnotation"; - value: string; -} - -declare class BabelNodeStringTypeAnnotation extends BabelNode { - type: "StringTypeAnnotation"; -} - -declare class BabelNodeSymbolTypeAnnotation extends BabelNode { - type: "SymbolTypeAnnotation"; -} - -declare class BabelNodeThisTypeAnnotation extends BabelNode { - type: "ThisTypeAnnotation"; -} - -declare class BabelNodeTupleTypeAnnotation extends BabelNode { - type: "TupleTypeAnnotation"; - types: Array; -} - -declare class BabelNodeTypeofTypeAnnotation extends BabelNode { - type: "TypeofTypeAnnotation"; - argument: BabelNodeFlowType; -} - -declare class BabelNodeTypeAlias extends BabelNode { - type: "TypeAlias"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTypeParameterDeclaration; - right: BabelNodeFlowType; -} - -declare class BabelNodeTypeAnnotation extends BabelNode { - type: "TypeAnnotation"; - typeAnnotation: BabelNodeFlowType; -} - -declare class BabelNodeTypeCastExpression extends BabelNode { - type: "TypeCastExpression"; - expression: BabelNodeExpression; - typeAnnotation: BabelNodeTypeAnnotation; -} - -declare class BabelNodeTypeParameter extends BabelNode { - type: "TypeParameter"; - bound?: BabelNodeTypeAnnotation; - variance?: BabelNodeVariance; - name: string; -} - -declare class BabelNodeTypeParameterDeclaration extends BabelNode { - type: "TypeParameterDeclaration"; - params: Array; -} - -declare class BabelNodeTypeParameterInstantiation extends BabelNode { - type: "TypeParameterInstantiation"; - params: Array; -} - -declare class BabelNodeUnionTypeAnnotation extends BabelNode { - type: "UnionTypeAnnotation"; - types: Array; -} - -declare class BabelNodeVariance extends BabelNode { - type: "Variance"; - kind: "minus" | "plus"; -} - -declare class BabelNodeVoidTypeAnnotation extends BabelNode { - type: "VoidTypeAnnotation"; -} - -declare class BabelNodeEnumDeclaration extends BabelNode { - type: "EnumDeclaration"; - id: BabelNodeIdentifier; - body: BabelNodeEnumBooleanBody | BabelNodeEnumNumberBody | BabelNodeEnumStringBody | BabelNodeEnumSymbolBody; -} - -declare class BabelNodeEnumBooleanBody extends BabelNode { - type: "EnumBooleanBody"; - members: Array; - explicitType: boolean; - hasUnknownMembers: boolean; -} - -declare class BabelNodeEnumNumberBody extends BabelNode { - type: "EnumNumberBody"; - members: Array; - explicitType: boolean; - hasUnknownMembers: boolean; -} - -declare class BabelNodeEnumStringBody extends BabelNode { - type: "EnumStringBody"; - members: Array; - explicitType: boolean; - hasUnknownMembers: boolean; -} - -declare class BabelNodeEnumSymbolBody extends BabelNode { - type: "EnumSymbolBody"; - members: Array; - hasUnknownMembers: boolean; -} - -declare class BabelNodeEnumBooleanMember extends BabelNode { - type: "EnumBooleanMember"; - id: BabelNodeIdentifier; - init: BabelNodeBooleanLiteral; -} - -declare class BabelNodeEnumNumberMember extends BabelNode { - type: "EnumNumberMember"; - id: BabelNodeIdentifier; - init: BabelNodeNumericLiteral; -} - -declare class BabelNodeEnumStringMember extends BabelNode { - type: "EnumStringMember"; - id: BabelNodeIdentifier; - init: BabelNodeStringLiteral; -} - -declare class BabelNodeEnumDefaultedMember extends BabelNode { - type: "EnumDefaultedMember"; - id: BabelNodeIdentifier; -} - -declare class BabelNodeIndexedAccessType extends BabelNode { - type: "IndexedAccessType"; - objectType: BabelNodeFlowType; - indexType: BabelNodeFlowType; -} - -declare class BabelNodeOptionalIndexedAccessType extends BabelNode { - type: "OptionalIndexedAccessType"; - objectType: BabelNodeFlowType; - indexType: BabelNodeFlowType; - optional: boolean; -} - -declare class BabelNodeJSXAttribute extends BabelNode { - type: "JSXAttribute"; - name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName; - value?: BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer; -} - -declare class BabelNodeJSXClosingElement extends BabelNode { - type: "JSXClosingElement"; - name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName; -} - -declare class BabelNodeJSXElement extends BabelNode { - type: "JSXElement"; - openingElement: BabelNodeJSXOpeningElement; - closingElement?: BabelNodeJSXClosingElement; - children: Array; - selfClosing?: boolean; -} - -declare class BabelNodeJSXEmptyExpression extends BabelNode { - type: "JSXEmptyExpression"; -} - -declare class BabelNodeJSXExpressionContainer extends BabelNode { - type: "JSXExpressionContainer"; - expression: BabelNodeExpression | BabelNodeJSXEmptyExpression; -} - -declare class BabelNodeJSXSpreadChild extends BabelNode { - type: "JSXSpreadChild"; - expression: BabelNodeExpression; -} - -declare class BabelNodeJSXIdentifier extends BabelNode { - type: "JSXIdentifier"; - name: string; -} - -declare class BabelNodeJSXMemberExpression extends BabelNode { - type: "JSXMemberExpression"; - object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier; - property: BabelNodeJSXIdentifier; -} - -declare class BabelNodeJSXNamespacedName extends BabelNode { - type: "JSXNamespacedName"; - namespace: BabelNodeJSXIdentifier; - name: BabelNodeJSXIdentifier; -} - -declare class BabelNodeJSXOpeningElement extends BabelNode { - type: "JSXOpeningElement"; - name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName; - attributes: Array; - selfClosing?: boolean; - typeParameters?: BabelNodeTypeParameterInstantiation | BabelNodeTSTypeParameterInstantiation; -} - -declare class BabelNodeJSXSpreadAttribute extends BabelNode { - type: "JSXSpreadAttribute"; - argument: BabelNodeExpression; -} - -declare class BabelNodeJSXText extends BabelNode { - type: "JSXText"; - value: string; -} - -declare class BabelNodeJSXFragment extends BabelNode { - type: "JSXFragment"; - openingFragment: BabelNodeJSXOpeningFragment; - closingFragment: BabelNodeJSXClosingFragment; - children: Array; -} - -declare class BabelNodeJSXOpeningFragment extends BabelNode { - type: "JSXOpeningFragment"; -} - -declare class BabelNodeJSXClosingFragment extends BabelNode { - type: "JSXClosingFragment"; -} - -declare class BabelNodeNoop extends BabelNode { - type: "Noop"; -} - -declare class BabelNodePlaceholder extends BabelNode { - type: "Placeholder"; - expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern"; - name: BabelNodeIdentifier; -} - -declare class BabelNodeV8IntrinsicIdentifier extends BabelNode { - type: "V8IntrinsicIdentifier"; - name: string; -} - -declare class BabelNodeArgumentPlaceholder extends BabelNode { - type: "ArgumentPlaceholder"; -} - -declare class BabelNodeBindExpression extends BabelNode { - type: "BindExpression"; - object: BabelNodeExpression; - callee: BabelNodeExpression; -} - -declare class BabelNodeImportAttribute extends BabelNode { - type: "ImportAttribute"; - key: BabelNodeIdentifier | BabelNodeStringLiteral; - value: BabelNodeStringLiteral; -} - -declare class BabelNodeDecorator extends BabelNode { - type: "Decorator"; - expression: BabelNodeExpression; -} - -declare class BabelNodeDoExpression extends BabelNode { - type: "DoExpression"; - body: BabelNodeBlockStatement; - async?: boolean; -} - -declare class BabelNodeExportDefaultSpecifier extends BabelNode { - type: "ExportDefaultSpecifier"; - exported: BabelNodeIdentifier; -} - -declare class BabelNodeRecordExpression extends BabelNode { - type: "RecordExpression"; - properties: Array; -} - -declare class BabelNodeTupleExpression extends BabelNode { - type: "TupleExpression"; - elements?: Array; -} - -declare class BabelNodeDecimalLiteral extends BabelNode { - type: "DecimalLiteral"; - value: string; -} - -declare class BabelNodeStaticBlock extends BabelNode { - type: "StaticBlock"; - body: Array; -} - -declare class BabelNodeModuleExpression extends BabelNode { - type: "ModuleExpression"; - body: BabelNodeProgram; -} - -declare class BabelNodeTopicReference extends BabelNode { - type: "TopicReference"; -} - -declare class BabelNodePipelineTopicExpression extends BabelNode { - type: "PipelineTopicExpression"; - expression: BabelNodeExpression; -} - -declare class BabelNodePipelineBareFunction extends BabelNode { - type: "PipelineBareFunction"; - callee: BabelNodeExpression; -} - -declare class BabelNodePipelinePrimaryTopicReference extends BabelNode { - type: "PipelinePrimaryTopicReference"; -} - -declare class BabelNodeTSParameterProperty extends BabelNode { - type: "TSParameterProperty"; - parameter: BabelNodeIdentifier | BabelNodeAssignmentPattern; - accessibility?: "public" | "private" | "protected"; - decorators?: Array; - override?: boolean; - readonly?: boolean; -} - -declare class BabelNodeTSDeclareFunction extends BabelNode { - type: "TSDeclareFunction"; - id?: BabelNodeIdentifier; - typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; - params: Array; - returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop; - async?: boolean; - declare?: boolean; - generator?: boolean; -} - -declare class BabelNodeTSDeclareMethod extends BabelNode { - type: "TSDeclareMethod"; - decorators?: Array; - key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression; - typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop; - params: Array; - returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop; - abstract?: boolean; - access?: "public" | "private" | "protected"; - accessibility?: "public" | "private" | "protected"; - async?: boolean; - computed?: boolean; - generator?: boolean; - kind?: "get" | "set" | "method" | "constructor"; - optional?: boolean; - override?: boolean; -} - -declare class BabelNodeTSQualifiedName extends BabelNode { - type: "TSQualifiedName"; - left: BabelNodeTSEntityName; - right: BabelNodeIdentifier; -} - -declare class BabelNodeTSCallSignatureDeclaration extends BabelNode { - type: "TSCallSignatureDeclaration"; - typeParameters?: BabelNodeTSTypeParameterDeclaration; - parameters: Array; - typeAnnotation?: BabelNodeTSTypeAnnotation; -} - -declare class BabelNodeTSConstructSignatureDeclaration extends BabelNode { - type: "TSConstructSignatureDeclaration"; - typeParameters?: BabelNodeTSTypeParameterDeclaration; - parameters: Array; - typeAnnotation?: BabelNodeTSTypeAnnotation; -} - -declare class BabelNodeTSPropertySignature extends BabelNode { - type: "TSPropertySignature"; - key: BabelNodeExpression; - typeAnnotation?: BabelNodeTSTypeAnnotation; - initializer?: BabelNodeExpression; - computed?: boolean; - kind: "get" | "set"; - optional?: boolean; - readonly?: boolean; -} - -declare class BabelNodeTSMethodSignature extends BabelNode { - type: "TSMethodSignature"; - key: BabelNodeExpression; - typeParameters?: BabelNodeTSTypeParameterDeclaration; - parameters: Array; - typeAnnotation?: BabelNodeTSTypeAnnotation; - computed?: boolean; - kind: "method" | "get" | "set"; - optional?: boolean; -} - -declare class BabelNodeTSIndexSignature extends BabelNode { - type: "TSIndexSignature"; - parameters: Array; - typeAnnotation?: BabelNodeTSTypeAnnotation; - readonly?: boolean; -} - -declare class BabelNodeTSAnyKeyword extends BabelNode { - type: "TSAnyKeyword"; -} - -declare class BabelNodeTSBooleanKeyword extends BabelNode { - type: "TSBooleanKeyword"; -} - -declare class BabelNodeTSBigIntKeyword extends BabelNode { - type: "TSBigIntKeyword"; -} - -declare class BabelNodeTSIntrinsicKeyword extends BabelNode { - type: "TSIntrinsicKeyword"; -} - -declare class BabelNodeTSNeverKeyword extends BabelNode { - type: "TSNeverKeyword"; -} - -declare class BabelNodeTSNullKeyword extends BabelNode { - type: "TSNullKeyword"; -} - -declare class BabelNodeTSNumberKeyword extends BabelNode { - type: "TSNumberKeyword"; -} - -declare class BabelNodeTSObjectKeyword extends BabelNode { - type: "TSObjectKeyword"; -} - -declare class BabelNodeTSStringKeyword extends BabelNode { - type: "TSStringKeyword"; -} - -declare class BabelNodeTSSymbolKeyword extends BabelNode { - type: "TSSymbolKeyword"; -} - -declare class BabelNodeTSUndefinedKeyword extends BabelNode { - type: "TSUndefinedKeyword"; -} - -declare class BabelNodeTSUnknownKeyword extends BabelNode { - type: "TSUnknownKeyword"; -} - -declare class BabelNodeTSVoidKeyword extends BabelNode { - type: "TSVoidKeyword"; -} - -declare class BabelNodeTSThisType extends BabelNode { - type: "TSThisType"; -} - -declare class BabelNodeTSFunctionType extends BabelNode { - type: "TSFunctionType"; - typeParameters?: BabelNodeTSTypeParameterDeclaration; - parameters: Array; - typeAnnotation?: BabelNodeTSTypeAnnotation; -} - -declare class BabelNodeTSConstructorType extends BabelNode { - type: "TSConstructorType"; - typeParameters?: BabelNodeTSTypeParameterDeclaration; - parameters: Array; - typeAnnotation?: BabelNodeTSTypeAnnotation; - abstract?: boolean; -} - -declare class BabelNodeTSTypeReference extends BabelNode { - type: "TSTypeReference"; - typeName: BabelNodeTSEntityName; - typeParameters?: BabelNodeTSTypeParameterInstantiation; -} - -declare class BabelNodeTSTypePredicate extends BabelNode { - type: "TSTypePredicate"; - parameterName: BabelNodeIdentifier | BabelNodeTSThisType; - typeAnnotation?: BabelNodeTSTypeAnnotation; - asserts?: boolean; -} - -declare class BabelNodeTSTypeQuery extends BabelNode { - type: "TSTypeQuery"; - exprName: BabelNodeTSEntityName | BabelNodeTSImportType; -} - -declare class BabelNodeTSTypeLiteral extends BabelNode { - type: "TSTypeLiteral"; - members: Array; -} - -declare class BabelNodeTSArrayType extends BabelNode { - type: "TSArrayType"; - elementType: BabelNodeTSType; -} - -declare class BabelNodeTSTupleType extends BabelNode { - type: "TSTupleType"; - elementTypes: Array; -} - -declare class BabelNodeTSOptionalType extends BabelNode { - type: "TSOptionalType"; - typeAnnotation: BabelNodeTSType; -} - -declare class BabelNodeTSRestType extends BabelNode { - type: "TSRestType"; - typeAnnotation: BabelNodeTSType; -} - -declare class BabelNodeTSNamedTupleMember extends BabelNode { - type: "TSNamedTupleMember"; - label: BabelNodeIdentifier; - elementType: BabelNodeTSType; - optional?: boolean; -} - -declare class BabelNodeTSUnionType extends BabelNode { - type: "TSUnionType"; - types: Array; -} - -declare class BabelNodeTSIntersectionType extends BabelNode { - type: "TSIntersectionType"; - types: Array; -} - -declare class BabelNodeTSConditionalType extends BabelNode { - type: "TSConditionalType"; - checkType: BabelNodeTSType; - extendsType: BabelNodeTSType; - trueType: BabelNodeTSType; - falseType: BabelNodeTSType; -} - -declare class BabelNodeTSInferType extends BabelNode { - type: "TSInferType"; - typeParameter: BabelNodeTSTypeParameter; -} - -declare class BabelNodeTSParenthesizedType extends BabelNode { - type: "TSParenthesizedType"; - typeAnnotation: BabelNodeTSType; -} - -declare class BabelNodeTSTypeOperator extends BabelNode { - type: "TSTypeOperator"; - typeAnnotation: BabelNodeTSType; - operator: string; -} - -declare class BabelNodeTSIndexedAccessType extends BabelNode { - type: "TSIndexedAccessType"; - objectType: BabelNodeTSType; - indexType: BabelNodeTSType; -} - -declare class BabelNodeTSMappedType extends BabelNode { - type: "TSMappedType"; - typeParameter: BabelNodeTSTypeParameter; - typeAnnotation?: BabelNodeTSType; - nameType?: BabelNodeTSType; - optional?: boolean; - readonly?: boolean; -} - -declare class BabelNodeTSLiteralType extends BabelNode { - type: "TSLiteralType"; - literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral | BabelNodeBigIntLiteral | BabelNodeUnaryExpression; -} - -declare class BabelNodeTSExpressionWithTypeArguments extends BabelNode { - type: "TSExpressionWithTypeArguments"; - expression: BabelNodeTSEntityName; - typeParameters?: BabelNodeTSTypeParameterInstantiation; -} - -declare class BabelNodeTSInterfaceDeclaration extends BabelNode { - type: "TSInterfaceDeclaration"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTSTypeParameterDeclaration; - body: BabelNodeTSInterfaceBody; - declare?: boolean; -} - -declare class BabelNodeTSInterfaceBody extends BabelNode { - type: "TSInterfaceBody"; - body: Array; -} - -declare class BabelNodeTSTypeAliasDeclaration extends BabelNode { - type: "TSTypeAliasDeclaration"; - id: BabelNodeIdentifier; - typeParameters?: BabelNodeTSTypeParameterDeclaration; - typeAnnotation: BabelNodeTSType; - declare?: boolean; -} - -declare class BabelNodeTSAsExpression extends BabelNode { - type: "TSAsExpression"; - expression: BabelNodeExpression; - typeAnnotation: BabelNodeTSType; -} - -declare class BabelNodeTSTypeAssertion extends BabelNode { - type: "TSTypeAssertion"; - typeAnnotation: BabelNodeTSType; - expression: BabelNodeExpression; -} - -declare class BabelNodeTSEnumDeclaration extends BabelNode { - type: "TSEnumDeclaration"; - id: BabelNodeIdentifier; - members: Array; - declare?: boolean; - initializer?: BabelNodeExpression; -} - -declare class BabelNodeTSEnumMember extends BabelNode { - type: "TSEnumMember"; - id: BabelNodeIdentifier | BabelNodeStringLiteral; - initializer?: BabelNodeExpression; -} - -declare class BabelNodeTSModuleDeclaration extends BabelNode { - type: "TSModuleDeclaration"; - id: BabelNodeIdentifier | BabelNodeStringLiteral; - body: BabelNodeTSModuleBlock | BabelNodeTSModuleDeclaration; - declare?: boolean; - global?: boolean; -} - -declare class BabelNodeTSModuleBlock extends BabelNode { - type: "TSModuleBlock"; - body: Array; -} - -declare class BabelNodeTSImportType extends BabelNode { - type: "TSImportType"; - argument: BabelNodeStringLiteral; - qualifier?: BabelNodeTSEntityName; - typeParameters?: BabelNodeTSTypeParameterInstantiation; -} - -declare class BabelNodeTSImportEqualsDeclaration extends BabelNode { - type: "TSImportEqualsDeclaration"; - id: BabelNodeIdentifier; - moduleReference: BabelNodeTSEntityName | BabelNodeTSExternalModuleReference; - importKind?: "type" | "value"; - isExport: boolean; -} - -declare class BabelNodeTSExternalModuleReference extends BabelNode { - type: "TSExternalModuleReference"; - expression: BabelNodeStringLiteral; -} - -declare class BabelNodeTSNonNullExpression extends BabelNode { - type: "TSNonNullExpression"; - expression: BabelNodeExpression; -} - -declare class BabelNodeTSExportAssignment extends BabelNode { - type: "TSExportAssignment"; - expression: BabelNodeExpression; -} - -declare class BabelNodeTSNamespaceExportDeclaration extends BabelNode { - type: "TSNamespaceExportDeclaration"; - id: BabelNodeIdentifier; -} - -declare class BabelNodeTSTypeAnnotation extends BabelNode { - type: "TSTypeAnnotation"; - typeAnnotation: BabelNodeTSType; -} - -declare class BabelNodeTSTypeParameterInstantiation extends BabelNode { - type: "TSTypeParameterInstantiation"; - params: Array; -} - -declare class BabelNodeTSTypeParameterDeclaration extends BabelNode { - type: "TSTypeParameterDeclaration"; - params: Array; -} - -declare class BabelNodeTSTypeParameter extends BabelNode { - type: "TSTypeParameter"; - constraint?: BabelNodeTSType; - name: string; -} - -type BabelNodeExpression = BabelNodeArrayExpression | BabelNodeAssignmentExpression | BabelNodeBinaryExpression | BabelNodeCallExpression | BabelNodeConditionalExpression | BabelNodeFunctionExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeLogicalExpression | BabelNodeMemberExpression | BabelNodeNewExpression | BabelNodeObjectExpression | BabelNodeSequenceExpression | BabelNodeParenthesizedExpression | BabelNodeThisExpression | BabelNodeUnaryExpression | BabelNodeUpdateExpression | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeMetaProperty | BabelNodeSuper | BabelNodeTaggedTemplateExpression | BabelNodeTemplateLiteral | BabelNodeYieldExpression | BabelNodeAwaitExpression | BabelNodeImport | BabelNodeBigIntLiteral | BabelNodeOptionalMemberExpression | BabelNodeOptionalCallExpression | BabelNodeTypeCastExpression | BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeBindExpression | BabelNodeDoExpression | BabelNodeRecordExpression | BabelNodeTupleExpression | BabelNodeDecimalLiteral | BabelNodeModuleExpression | BabelNodeTopicReference | BabelNodePipelineTopicExpression | BabelNodePipelineBareFunction | BabelNodePipelinePrimaryTopicReference | BabelNodeTSAsExpression | BabelNodeTSTypeAssertion | BabelNodeTSNonNullExpression; -type BabelNodeBinary = BabelNodeBinaryExpression | BabelNodeLogicalExpression; -type BabelNodeScopable = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeClassDeclaration | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeStaticBlock | BabelNodeTSModuleBlock; -type BabelNodeBlockParent = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeClassPrivateMethod | BabelNodeStaticBlock | BabelNodeTSModuleBlock; -type BabelNodeBlock = BabelNodeBlockStatement | BabelNodeProgram | BabelNodeTSModuleBlock; -type BabelNodeStatement = BabelNodeBlockStatement | BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeDebuggerStatement | BabelNodeDoWhileStatement | BabelNodeEmptyStatement | BabelNodeExpressionStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeIfStatement | BabelNodeLabeledStatement | BabelNodeReturnStatement | BabelNodeSwitchStatement | BabelNodeThrowStatement | BabelNodeTryStatement | BabelNodeVariableDeclaration | BabelNodeWhileStatement | BabelNodeWithStatement | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeForOfStatement | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeEnumDeclaration | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration | BabelNodeTSImportEqualsDeclaration | BabelNodeTSExportAssignment | BabelNodeTSNamespaceExportDeclaration; -type BabelNodeTerminatorless = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement | BabelNodeYieldExpression | BabelNodeAwaitExpression; -type BabelNodeCompletionStatement = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement; -type BabelNodeConditional = BabelNodeConditionalExpression | BabelNodeIfStatement; -type BabelNodeLoop = BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeWhileStatement | BabelNodeForOfStatement; -type BabelNodeWhile = BabelNodeDoWhileStatement | BabelNodeWhileStatement; -type BabelNodeExpressionWrapper = BabelNodeExpressionStatement | BabelNodeParenthesizedExpression | BabelNodeTypeCastExpression; -type BabelNodeFor = BabelNodeForInStatement | BabelNodeForStatement | BabelNodeForOfStatement; -type BabelNodeForXStatement = BabelNodeForInStatement | BabelNodeForOfStatement; -type BabelNodeFunction = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod | BabelNodeClassPrivateMethod; -type BabelNodeFunctionParent = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod | BabelNodeClassPrivateMethod; -type BabelNodePureish = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeArrowFunctionExpression | BabelNodeBigIntLiteral | BabelNodeDecimalLiteral; -type BabelNodeDeclaration = BabelNodeFunctionDeclaration | BabelNodeVariableDeclaration | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias | BabelNodeEnumDeclaration | BabelNodeTSDeclareFunction | BabelNodeTSInterfaceDeclaration | BabelNodeTSTypeAliasDeclaration | BabelNodeTSEnumDeclaration | BabelNodeTSModuleDeclaration; -type BabelNodePatternLike = BabelNodeIdentifier | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern; -type BabelNodeLVal = BabelNodeIdentifier | BabelNodeMemberExpression | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern | BabelNodeTSParameterProperty; -type BabelNodeTSEntityName = BabelNodeIdentifier | BabelNodeTSQualifiedName; -type BabelNodeLiteral = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeTemplateLiteral | BabelNodeBigIntLiteral | BabelNodeDecimalLiteral; -type BabelNodeImmutable = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeBigIntLiteral | BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXOpeningElement | BabelNodeJSXText | BabelNodeJSXFragment | BabelNodeJSXOpeningFragment | BabelNodeJSXClosingFragment | BabelNodeDecimalLiteral; -type BabelNodeUserWhitespacable = BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeObjectTypeInternalSlot | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty; -type BabelNodeMethod = BabelNodeObjectMethod | BabelNodeClassMethod | BabelNodeClassPrivateMethod; -type BabelNodeObjectMember = BabelNodeObjectMethod | BabelNodeObjectProperty; -type BabelNodeProperty = BabelNodeObjectProperty | BabelNodeClassProperty | BabelNodeClassPrivateProperty; -type BabelNodeUnaryLike = BabelNodeUnaryExpression | BabelNodeSpreadElement; -type BabelNodePattern = BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern; -type BabelNodeClass = BabelNodeClassExpression | BabelNodeClassDeclaration; -type BabelNodeModuleDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration; -type BabelNodeExportDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration; -type BabelNodeModuleSpecifier = BabelNodeExportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier | BabelNodeImportSpecifier | BabelNodeExportNamespaceSpecifier | BabelNodeExportDefaultSpecifier; -type BabelNodePrivate = BabelNodeClassPrivateProperty | BabelNodeClassPrivateMethod | BabelNodePrivateName; -type BabelNodeFlow = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeClassImplements | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeDeclaredPredicate | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeFunctionTypeParam | BabelNodeGenericTypeAnnotation | BabelNodeInferredPredicate | BabelNodeInterfaceExtends | BabelNodeInterfaceDeclaration | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeObjectTypeInternalSlot | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeObjectTypeSpreadProperty | BabelNodeOpaqueType | BabelNodeQualifiedTypeIdentifier | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeSymbolTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeTypeAlias | BabelNodeTypeAnnotation | BabelNodeTypeCastExpression | BabelNodeTypeParameter | BabelNodeTypeParameterDeclaration | BabelNodeTypeParameterInstantiation | BabelNodeUnionTypeAnnotation | BabelNodeVariance | BabelNodeVoidTypeAnnotation | BabelNodeIndexedAccessType | BabelNodeOptionalIndexedAccessType; -type BabelNodeFlowType = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeExistsTypeAnnotation | BabelNodeFunctionTypeAnnotation | BabelNodeGenericTypeAnnotation | BabelNodeInterfaceTypeAnnotation | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumberLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeObjectTypeAnnotation | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeSymbolTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeUnionTypeAnnotation | BabelNodeVoidTypeAnnotation | BabelNodeIndexedAccessType | BabelNodeOptionalIndexedAccessType; -type BabelNodeFlowBaseAnnotation = BabelNodeAnyTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeSymbolTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeVoidTypeAnnotation; -type BabelNodeFlowDeclaration = BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareOpaqueType | BabelNodeDeclareVariable | BabelNodeDeclareExportDeclaration | BabelNodeDeclareExportAllDeclaration | BabelNodeInterfaceDeclaration | BabelNodeOpaqueType | BabelNodeTypeAlias; -type BabelNodeFlowPredicate = BabelNodeDeclaredPredicate | BabelNodeInferredPredicate; -type BabelNodeEnumBody = BabelNodeEnumBooleanBody | BabelNodeEnumNumberBody | BabelNodeEnumStringBody | BabelNodeEnumSymbolBody; -type BabelNodeEnumMember = BabelNodeEnumBooleanMember | BabelNodeEnumNumberMember | BabelNodeEnumStringMember | BabelNodeEnumDefaultedMember; -type BabelNodeJSX = BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXEmptyExpression | BabelNodeJSXExpressionContainer | BabelNodeJSXSpreadChild | BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName | BabelNodeJSXOpeningElement | BabelNodeJSXSpreadAttribute | BabelNodeJSXText | BabelNodeJSXFragment | BabelNodeJSXOpeningFragment | BabelNodeJSXClosingFragment; -type BabelNodeTSTypeElement = BabelNodeTSCallSignatureDeclaration | BabelNodeTSConstructSignatureDeclaration | BabelNodeTSPropertySignature | BabelNodeTSMethodSignature | BabelNodeTSIndexSignature; -type BabelNodeTSType = BabelNodeTSAnyKeyword | BabelNodeTSBooleanKeyword | BabelNodeTSBigIntKeyword | BabelNodeTSIntrinsicKeyword | BabelNodeTSNeverKeyword | BabelNodeTSNullKeyword | BabelNodeTSNumberKeyword | BabelNodeTSObjectKeyword | BabelNodeTSStringKeyword | BabelNodeTSSymbolKeyword | BabelNodeTSUndefinedKeyword | BabelNodeTSUnknownKeyword | BabelNodeTSVoidKeyword | BabelNodeTSThisType | BabelNodeTSFunctionType | BabelNodeTSConstructorType | BabelNodeTSTypeReference | BabelNodeTSTypePredicate | BabelNodeTSTypeQuery | BabelNodeTSTypeLiteral | BabelNodeTSArrayType | BabelNodeTSTupleType | BabelNodeTSOptionalType | BabelNodeTSRestType | BabelNodeTSUnionType | BabelNodeTSIntersectionType | BabelNodeTSConditionalType | BabelNodeTSInferType | BabelNodeTSParenthesizedType | BabelNodeTSTypeOperator | BabelNodeTSIndexedAccessType | BabelNodeTSMappedType | BabelNodeTSLiteralType | BabelNodeTSExpressionWithTypeArguments | BabelNodeTSImportType; -type BabelNodeTSBaseType = BabelNodeTSAnyKeyword | BabelNodeTSBooleanKeyword | BabelNodeTSBigIntKeyword | BabelNodeTSIntrinsicKeyword | BabelNodeTSNeverKeyword | BabelNodeTSNullKeyword | BabelNodeTSNumberKeyword | BabelNodeTSObjectKeyword | BabelNodeTSStringKeyword | BabelNodeTSSymbolKeyword | BabelNodeTSUndefinedKeyword | BabelNodeTSUnknownKeyword | BabelNodeTSVoidKeyword | BabelNodeTSThisType | BabelNodeTSLiteralType; - -declare module "@babel/types" { - declare export function arrayExpression(elements?: Array): BabelNodeArrayExpression; - declare export function assignmentExpression(operator: string, left: BabelNodeLVal, right: BabelNodeExpression): BabelNodeAssignmentExpression; - declare export function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left: BabelNodeExpression | BabelNodePrivateName, right: BabelNodeExpression): BabelNodeBinaryExpression; - declare export function interpreterDirective(value: string): BabelNodeInterpreterDirective; - declare export function directive(value: BabelNodeDirectiveLiteral): BabelNodeDirective; - declare export function directiveLiteral(value: string): BabelNodeDirectiveLiteral; - declare export function blockStatement(body: Array, directives?: Array): BabelNodeBlockStatement; - declare export function breakStatement(label?: BabelNodeIdentifier): BabelNodeBreakStatement; - declare export function callExpression(callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier, _arguments: Array): BabelNodeCallExpression; - declare export function catchClause(param?: BabelNodeIdentifier | BabelNodeArrayPattern | BabelNodeObjectPattern, body: BabelNodeBlockStatement): BabelNodeCatchClause; - declare export function conditionalExpression(test: BabelNodeExpression, consequent: BabelNodeExpression, alternate: BabelNodeExpression): BabelNodeConditionalExpression; - declare export function continueStatement(label?: BabelNodeIdentifier): BabelNodeContinueStatement; - declare export function debuggerStatement(): BabelNodeDebuggerStatement; - declare export function doWhileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeDoWhileStatement; - declare export function emptyStatement(): BabelNodeEmptyStatement; - declare export function expressionStatement(expression: BabelNodeExpression): BabelNodeExpressionStatement; - declare export function file(program: BabelNodeProgram, comments?: Array, tokens?: Array): BabelNodeFile; - declare export function forInStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForInStatement; - declare export function forStatement(init?: BabelNodeVariableDeclaration | BabelNodeExpression, test?: BabelNodeExpression, update?: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForStatement; - declare export function functionDeclaration(id?: BabelNodeIdentifier, params: Array, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean): BabelNodeFunctionDeclaration; - declare export function functionExpression(id?: BabelNodeIdentifier, params: Array, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean): BabelNodeFunctionExpression; - declare export function identifier(name: string): BabelNodeIdentifier; - declare export function ifStatement(test: BabelNodeExpression, consequent: BabelNodeStatement, alternate?: BabelNodeStatement): BabelNodeIfStatement; - declare export function labeledStatement(label: BabelNodeIdentifier, body: BabelNodeStatement): BabelNodeLabeledStatement; - declare export function stringLiteral(value: string): BabelNodeStringLiteral; - declare export function numericLiteral(value: number): BabelNodeNumericLiteral; - declare export function nullLiteral(): BabelNodeNullLiteral; - declare export function booleanLiteral(value: boolean): BabelNodeBooleanLiteral; - declare export function regExpLiteral(pattern: string, flags?: string): BabelNodeRegExpLiteral; - declare export function logicalExpression(operator: "||" | "&&" | "??", left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeLogicalExpression; - declare export function memberExpression(object: BabelNodeExpression, property: BabelNodeExpression | BabelNodeIdentifier | BabelNodePrivateName, computed?: boolean, optional?: true | false): BabelNodeMemberExpression; - declare export function newExpression(callee: BabelNodeExpression | BabelNodeV8IntrinsicIdentifier, _arguments: Array): BabelNodeNewExpression; - declare export function program(body: Array, directives?: Array, sourceType?: "script" | "module", interpreter?: BabelNodeInterpreterDirective): BabelNodeProgram; - declare export function objectExpression(properties: Array): BabelNodeObjectExpression; - declare export function objectMethod(kind?: "method" | "get" | "set", key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral, params: Array, body: BabelNodeBlockStatement, computed?: boolean, generator?: boolean, async?: boolean): BabelNodeObjectMethod; - declare export function objectProperty(key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral, value: BabelNodeExpression | BabelNodePatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array): BabelNodeObjectProperty; - declare export function restElement(argument: BabelNodeLVal): BabelNodeRestElement; - declare export function returnStatement(argument?: BabelNodeExpression): BabelNodeReturnStatement; - declare export function sequenceExpression(expressions: Array): BabelNodeSequenceExpression; - declare export function parenthesizedExpression(expression: BabelNodeExpression): BabelNodeParenthesizedExpression; - declare export function switchCase(test?: BabelNodeExpression, consequent: Array): BabelNodeSwitchCase; - declare export function switchStatement(discriminant: BabelNodeExpression, cases: Array): BabelNodeSwitchStatement; - declare export function thisExpression(): BabelNodeThisExpression; - declare export function throwStatement(argument: BabelNodeExpression): BabelNodeThrowStatement; - declare export function tryStatement(block: BabelNodeBlockStatement, handler?: BabelNodeCatchClause, finalizer?: BabelNodeBlockStatement): BabelNodeTryStatement; - declare export function unaryExpression(operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof", argument: BabelNodeExpression, prefix?: boolean): BabelNodeUnaryExpression; - declare export function updateExpression(operator: "++" | "--", argument: BabelNodeExpression, prefix?: boolean): BabelNodeUpdateExpression; - declare export function variableDeclaration(kind: "var" | "let" | "const", declarations: Array): BabelNodeVariableDeclaration; - declare export function variableDeclarator(id: BabelNodeLVal, init?: BabelNodeExpression): BabelNodeVariableDeclarator; - declare export function whileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWhileStatement; - declare export function withStatement(object: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWithStatement; - declare export function assignmentPattern(left: BabelNodeIdentifier | BabelNodeObjectPattern | BabelNodeArrayPattern | BabelNodeMemberExpression, right: BabelNodeExpression): BabelNodeAssignmentPattern; - declare export function arrayPattern(elements: Array): BabelNodeArrayPattern; - declare export function arrowFunctionExpression(params: Array, body: BabelNodeBlockStatement | BabelNodeExpression, async?: boolean): BabelNodeArrowFunctionExpression; - declare export function classBody(body: Array): BabelNodeClassBody; - declare export function classExpression(id?: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array): BabelNodeClassExpression; - declare export function classDeclaration(id: BabelNodeIdentifier, superClass?: BabelNodeExpression, body: BabelNodeClassBody, decorators?: Array): BabelNodeClassDeclaration; - declare export function exportAllDeclaration(source: BabelNodeStringLiteral): BabelNodeExportAllDeclaration; - declare export function exportDefaultDeclaration(declaration: BabelNodeFunctionDeclaration | BabelNodeTSDeclareFunction | BabelNodeClassDeclaration | BabelNodeExpression): BabelNodeExportDefaultDeclaration; - declare export function exportNamedDeclaration(declaration?: BabelNodeDeclaration, specifiers?: Array, source?: BabelNodeStringLiteral): BabelNodeExportNamedDeclaration; - declare export function exportSpecifier(local: BabelNodeIdentifier, exported: BabelNodeIdentifier | BabelNodeStringLiteral): BabelNodeExportSpecifier; - declare export function forOfStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement, _await?: boolean): BabelNodeForOfStatement; - declare export function importDeclaration(specifiers: Array, source: BabelNodeStringLiteral): BabelNodeImportDeclaration; - declare export function importDefaultSpecifier(local: BabelNodeIdentifier): BabelNodeImportDefaultSpecifier; - declare export function importNamespaceSpecifier(local: BabelNodeIdentifier): BabelNodeImportNamespaceSpecifier; - declare export function importSpecifier(local: BabelNodeIdentifier, imported: BabelNodeIdentifier | BabelNodeStringLiteral): BabelNodeImportSpecifier; - declare export function metaProperty(meta: BabelNodeIdentifier, property: BabelNodeIdentifier): BabelNodeMetaProperty; - declare export function classMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, params: Array, body: BabelNodeBlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): BabelNodeClassMethod; - declare export function objectPattern(properties: Array): BabelNodeObjectPattern; - declare export function spreadElement(argument: BabelNodeExpression): BabelNodeSpreadElement; - declare function _super(): BabelNodeSuper; - declare export { _super as super } - declare export function taggedTemplateExpression(tag: BabelNodeExpression, quasi: BabelNodeTemplateLiteral): BabelNodeTaggedTemplateExpression; - declare export function templateElement(value: { raw: string, cooked?: string }, tail?: boolean): BabelNodeTemplateElement; - declare export function templateLiteral(quasis: Array, expressions: Array): BabelNodeTemplateLiteral; - declare export function yieldExpression(argument?: BabelNodeExpression, delegate?: boolean): BabelNodeYieldExpression; - declare export function awaitExpression(argument: BabelNodeExpression): BabelNodeAwaitExpression; - declare function _import(): BabelNodeImport; - declare export { _import as import } - declare export function bigIntLiteral(value: string): BabelNodeBigIntLiteral; - declare export function exportNamespaceSpecifier(exported: BabelNodeIdentifier): BabelNodeExportNamespaceSpecifier; - declare export function optionalMemberExpression(object: BabelNodeExpression, property: BabelNodeExpression | BabelNodeIdentifier, computed?: boolean, optional: boolean): BabelNodeOptionalMemberExpression; - declare export function optionalCallExpression(callee: BabelNodeExpression, _arguments: Array, optional: boolean): BabelNodeOptionalCallExpression; - declare export function classProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, value?: BabelNodeExpression, typeAnnotation?: BabelNodeTypeAnnotation | BabelNodeTSTypeAnnotation | BabelNodeNoop, decorators?: Array, computed?: boolean, _static?: boolean): BabelNodeClassProperty; - declare export function classPrivateProperty(key: BabelNodePrivateName, value?: BabelNodeExpression, decorators?: Array, _static: any): BabelNodeClassPrivateProperty; - declare export function classPrivateMethod(kind?: "get" | "set" | "method" | "constructor", key: BabelNodePrivateName, params: Array, body: BabelNodeBlockStatement, _static?: boolean): BabelNodeClassPrivateMethod; - declare export function privateName(id: BabelNodeIdentifier): BabelNodePrivateName; - declare export function anyTypeAnnotation(): BabelNodeAnyTypeAnnotation; - declare export function arrayTypeAnnotation(elementType: BabelNodeFlowType): BabelNodeArrayTypeAnnotation; - declare export function booleanTypeAnnotation(): BabelNodeBooleanTypeAnnotation; - declare export function booleanLiteralTypeAnnotation(value: boolean): BabelNodeBooleanLiteralTypeAnnotation; - declare export function nullLiteralTypeAnnotation(): BabelNodeNullLiteralTypeAnnotation; - declare export function classImplements(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeClassImplements; - declare export function declareClass(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation): BabelNodeDeclareClass; - declare export function declareFunction(id: BabelNodeIdentifier): BabelNodeDeclareFunction; - declare export function declareInterface(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation): BabelNodeDeclareInterface; - declare export function declareModule(id: BabelNodeIdentifier | BabelNodeStringLiteral, body: BabelNodeBlockStatement, kind?: "CommonJS" | "ES"): BabelNodeDeclareModule; - declare export function declareModuleExports(typeAnnotation: BabelNodeTypeAnnotation): BabelNodeDeclareModuleExports; - declare export function declareTypeAlias(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, right: BabelNodeFlowType): BabelNodeDeclareTypeAlias; - declare export function declareOpaqueType(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, supertype?: BabelNodeFlowType): BabelNodeDeclareOpaqueType; - declare export function declareVariable(id: BabelNodeIdentifier): BabelNodeDeclareVariable; - declare export function declareExportDeclaration(declaration?: BabelNodeFlow, specifiers?: Array, source?: BabelNodeStringLiteral): BabelNodeDeclareExportDeclaration; - declare export function declareExportAllDeclaration(source: BabelNodeStringLiteral): BabelNodeDeclareExportAllDeclaration; - declare export function declaredPredicate(value: BabelNodeFlow): BabelNodeDeclaredPredicate; - declare export function existsTypeAnnotation(): BabelNodeExistsTypeAnnotation; - declare export function functionTypeAnnotation(typeParameters?: BabelNodeTypeParameterDeclaration, params: Array, rest?: BabelNodeFunctionTypeParam, returnType: BabelNodeFlowType): BabelNodeFunctionTypeAnnotation; - declare export function functionTypeParam(name?: BabelNodeIdentifier, typeAnnotation: BabelNodeFlowType): BabelNodeFunctionTypeParam; - declare export function genericTypeAnnotation(id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeGenericTypeAnnotation; - declare export function inferredPredicate(): BabelNodeInferredPredicate; - declare export function interfaceExtends(id: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier, typeParameters?: BabelNodeTypeParameterInstantiation): BabelNodeInterfaceExtends; - declare export function interfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, _extends?: Array, body: BabelNodeObjectTypeAnnotation): BabelNodeInterfaceDeclaration; - declare export function interfaceTypeAnnotation(_extends?: Array, body: BabelNodeObjectTypeAnnotation): BabelNodeInterfaceTypeAnnotation; - declare export function intersectionTypeAnnotation(types: Array): BabelNodeIntersectionTypeAnnotation; - declare export function mixedTypeAnnotation(): BabelNodeMixedTypeAnnotation; - declare export function emptyTypeAnnotation(): BabelNodeEmptyTypeAnnotation; - declare export function nullableTypeAnnotation(typeAnnotation: BabelNodeFlowType): BabelNodeNullableTypeAnnotation; - declare export function numberLiteralTypeAnnotation(value: number): BabelNodeNumberLiteralTypeAnnotation; - declare export function numberTypeAnnotation(): BabelNodeNumberTypeAnnotation; - declare export function objectTypeAnnotation(properties: Array, indexers?: Array, callProperties?: Array, internalSlots?: Array, exact?: boolean): BabelNodeObjectTypeAnnotation; - declare export function objectTypeInternalSlot(id: BabelNodeIdentifier, value: BabelNodeFlowType, optional: boolean, _static: boolean, method: boolean): BabelNodeObjectTypeInternalSlot; - declare export function objectTypeCallProperty(value: BabelNodeFlowType): BabelNodeObjectTypeCallProperty; - declare export function objectTypeIndexer(id?: BabelNodeIdentifier, key: BabelNodeFlowType, value: BabelNodeFlowType, variance?: BabelNodeVariance): BabelNodeObjectTypeIndexer; - declare export function objectTypeProperty(key: BabelNodeIdentifier | BabelNodeStringLiteral, value: BabelNodeFlowType, variance?: BabelNodeVariance): BabelNodeObjectTypeProperty; - declare export function objectTypeSpreadProperty(argument: BabelNodeFlowType): BabelNodeObjectTypeSpreadProperty; - declare export function opaqueType(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, supertype?: BabelNodeFlowType, impltype: BabelNodeFlowType): BabelNodeOpaqueType; - declare export function qualifiedTypeIdentifier(id: BabelNodeIdentifier, qualification: BabelNodeIdentifier | BabelNodeQualifiedTypeIdentifier): BabelNodeQualifiedTypeIdentifier; - declare export function stringLiteralTypeAnnotation(value: string): BabelNodeStringLiteralTypeAnnotation; - declare export function stringTypeAnnotation(): BabelNodeStringTypeAnnotation; - declare export function symbolTypeAnnotation(): BabelNodeSymbolTypeAnnotation; - declare export function thisTypeAnnotation(): BabelNodeThisTypeAnnotation; - declare export function tupleTypeAnnotation(types: Array): BabelNodeTupleTypeAnnotation; - declare export function typeofTypeAnnotation(argument: BabelNodeFlowType): BabelNodeTypeofTypeAnnotation; - declare export function typeAlias(id: BabelNodeIdentifier, typeParameters?: BabelNodeTypeParameterDeclaration, right: BabelNodeFlowType): BabelNodeTypeAlias; - declare export function typeAnnotation(typeAnnotation: BabelNodeFlowType): BabelNodeTypeAnnotation; - declare export function typeCastExpression(expression: BabelNodeExpression, typeAnnotation: BabelNodeTypeAnnotation): BabelNodeTypeCastExpression; - declare export function typeParameter(bound?: BabelNodeTypeAnnotation, _default?: BabelNodeFlowType, variance?: BabelNodeVariance): BabelNodeTypeParameter; - declare export function typeParameterDeclaration(params: Array): BabelNodeTypeParameterDeclaration; - declare export function typeParameterInstantiation(params: Array): BabelNodeTypeParameterInstantiation; - declare export function unionTypeAnnotation(types: Array): BabelNodeUnionTypeAnnotation; - declare export function variance(kind: "minus" | "plus"): BabelNodeVariance; - declare export function voidTypeAnnotation(): BabelNodeVoidTypeAnnotation; - declare export function enumDeclaration(id: BabelNodeIdentifier, body: BabelNodeEnumBooleanBody | BabelNodeEnumNumberBody | BabelNodeEnumStringBody | BabelNodeEnumSymbolBody): BabelNodeEnumDeclaration; - declare export function enumBooleanBody(members: Array): BabelNodeEnumBooleanBody; - declare export function enumNumberBody(members: Array): BabelNodeEnumNumberBody; - declare export function enumStringBody(members: Array): BabelNodeEnumStringBody; - declare export function enumSymbolBody(members: Array): BabelNodeEnumSymbolBody; - declare export function enumBooleanMember(id: BabelNodeIdentifier): BabelNodeEnumBooleanMember; - declare export function enumNumberMember(id: BabelNodeIdentifier, init: BabelNodeNumericLiteral): BabelNodeEnumNumberMember; - declare export function enumStringMember(id: BabelNodeIdentifier, init: BabelNodeStringLiteral): BabelNodeEnumStringMember; - declare export function enumDefaultedMember(id: BabelNodeIdentifier): BabelNodeEnumDefaultedMember; - declare export function indexedAccessType(objectType: BabelNodeFlowType, indexType: BabelNodeFlowType): BabelNodeIndexedAccessType; - declare export function optionalIndexedAccessType(objectType: BabelNodeFlowType, indexType: BabelNodeFlowType): BabelNodeOptionalIndexedAccessType; - declare export function jsxAttribute(name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName, value?: BabelNodeJSXElement | BabelNodeJSXFragment | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer): BabelNodeJSXAttribute; - declare export function jsxClosingElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName): BabelNodeJSXClosingElement; - declare export function jsxElement(openingElement: BabelNodeJSXOpeningElement, closingElement?: BabelNodeJSXClosingElement, children: Array, selfClosing?: boolean): BabelNodeJSXElement; - declare export function jsxEmptyExpression(): BabelNodeJSXEmptyExpression; - declare export function jsxExpressionContainer(expression: BabelNodeExpression | BabelNodeJSXEmptyExpression): BabelNodeJSXExpressionContainer; - declare export function jsxSpreadChild(expression: BabelNodeExpression): BabelNodeJSXSpreadChild; - declare export function jsxIdentifier(name: string): BabelNodeJSXIdentifier; - declare export function jsxMemberExpression(object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier, property: BabelNodeJSXIdentifier): BabelNodeJSXMemberExpression; - declare export function jsxNamespacedName(namespace: BabelNodeJSXIdentifier, name: BabelNodeJSXIdentifier): BabelNodeJSXNamespacedName; - declare export function jsxOpeningElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName, attributes: Array, selfClosing?: boolean): BabelNodeJSXOpeningElement; - declare export function jsxSpreadAttribute(argument: BabelNodeExpression): BabelNodeJSXSpreadAttribute; - declare export function jsxText(value: string): BabelNodeJSXText; - declare export function jsxFragment(openingFragment: BabelNodeJSXOpeningFragment, closingFragment: BabelNodeJSXClosingFragment, children: Array): BabelNodeJSXFragment; - declare export function jsxOpeningFragment(): BabelNodeJSXOpeningFragment; - declare export function jsxClosingFragment(): BabelNodeJSXClosingFragment; - declare export function noop(): BabelNodeNoop; - declare export function placeholder(expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern", name: BabelNodeIdentifier): BabelNodePlaceholder; - declare export function v8IntrinsicIdentifier(name: string): BabelNodeV8IntrinsicIdentifier; - declare export function argumentPlaceholder(): BabelNodeArgumentPlaceholder; - declare export function bindExpression(object: BabelNodeExpression, callee: BabelNodeExpression): BabelNodeBindExpression; - declare export function importAttribute(key: BabelNodeIdentifier | BabelNodeStringLiteral, value: BabelNodeStringLiteral): BabelNodeImportAttribute; - declare export function decorator(expression: BabelNodeExpression): BabelNodeDecorator; - declare export function doExpression(body: BabelNodeBlockStatement, async?: boolean): BabelNodeDoExpression; - declare export function exportDefaultSpecifier(exported: BabelNodeIdentifier): BabelNodeExportDefaultSpecifier; - declare export function recordExpression(properties: Array): BabelNodeRecordExpression; - declare export function tupleExpression(elements?: Array): BabelNodeTupleExpression; - declare export function decimalLiteral(value: string): BabelNodeDecimalLiteral; - declare export function staticBlock(body: Array): BabelNodeStaticBlock; - declare export function moduleExpression(body: BabelNodeProgram): BabelNodeModuleExpression; - declare export function topicReference(): BabelNodeTopicReference; - declare export function pipelineTopicExpression(expression: BabelNodeExpression): BabelNodePipelineTopicExpression; - declare export function pipelineBareFunction(callee: BabelNodeExpression): BabelNodePipelineBareFunction; - declare export function pipelinePrimaryTopicReference(): BabelNodePipelinePrimaryTopicReference; - declare export function tsParameterProperty(parameter: BabelNodeIdentifier | BabelNodeAssignmentPattern): BabelNodeTSParameterProperty; - declare export function tsDeclareFunction(id?: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeTSDeclareFunction; - declare export function tsDeclareMethod(decorators?: Array, key: BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration | BabelNodeNoop, params: Array, returnType?: BabelNodeTSTypeAnnotation | BabelNodeNoop): BabelNodeTSDeclareMethod; - declare export function tsQualifiedName(left: BabelNodeTSEntityName, right: BabelNodeIdentifier): BabelNodeTSQualifiedName; - declare export function tsCallSignatureDeclaration(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSCallSignatureDeclaration; - declare export function tsConstructSignatureDeclaration(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSConstructSignatureDeclaration; - declare export function tsPropertySignature(key: BabelNodeExpression, typeAnnotation?: BabelNodeTSTypeAnnotation, initializer?: BabelNodeExpression): BabelNodeTSPropertySignature; - declare export function tsMethodSignature(key: BabelNodeExpression, typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSMethodSignature; - declare export function tsIndexSignature(parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSIndexSignature; - declare export function tsAnyKeyword(): BabelNodeTSAnyKeyword; - declare export function tsBooleanKeyword(): BabelNodeTSBooleanKeyword; - declare export function tsBigIntKeyword(): BabelNodeTSBigIntKeyword; - declare export function tsIntrinsicKeyword(): BabelNodeTSIntrinsicKeyword; - declare export function tsNeverKeyword(): BabelNodeTSNeverKeyword; - declare export function tsNullKeyword(): BabelNodeTSNullKeyword; - declare export function tsNumberKeyword(): BabelNodeTSNumberKeyword; - declare export function tsObjectKeyword(): BabelNodeTSObjectKeyword; - declare export function tsStringKeyword(): BabelNodeTSStringKeyword; - declare export function tsSymbolKeyword(): BabelNodeTSSymbolKeyword; - declare export function tsUndefinedKeyword(): BabelNodeTSUndefinedKeyword; - declare export function tsUnknownKeyword(): BabelNodeTSUnknownKeyword; - declare export function tsVoidKeyword(): BabelNodeTSVoidKeyword; - declare export function tsThisType(): BabelNodeTSThisType; - declare export function tsFunctionType(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSFunctionType; - declare export function tsConstructorType(typeParameters?: BabelNodeTSTypeParameterDeclaration, parameters: Array, typeAnnotation?: BabelNodeTSTypeAnnotation): BabelNodeTSConstructorType; - declare export function tsTypeReference(typeName: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSTypeReference; - declare export function tsTypePredicate(parameterName: BabelNodeIdentifier | BabelNodeTSThisType, typeAnnotation?: BabelNodeTSTypeAnnotation, asserts?: boolean): BabelNodeTSTypePredicate; - declare export function tsTypeQuery(exprName: BabelNodeTSEntityName | BabelNodeTSImportType): BabelNodeTSTypeQuery; - declare export function tsTypeLiteral(members: Array): BabelNodeTSTypeLiteral; - declare export function tsArrayType(elementType: BabelNodeTSType): BabelNodeTSArrayType; - declare export function tsTupleType(elementTypes: Array): BabelNodeTSTupleType; - declare export function tsOptionalType(typeAnnotation: BabelNodeTSType): BabelNodeTSOptionalType; - declare export function tsRestType(typeAnnotation: BabelNodeTSType): BabelNodeTSRestType; - declare export function tsNamedTupleMember(label: BabelNodeIdentifier, elementType: BabelNodeTSType, optional?: boolean): BabelNodeTSNamedTupleMember; - declare export function tsUnionType(types: Array): BabelNodeTSUnionType; - declare export function tsIntersectionType(types: Array): BabelNodeTSIntersectionType; - declare export function tsConditionalType(checkType: BabelNodeTSType, extendsType: BabelNodeTSType, trueType: BabelNodeTSType, falseType: BabelNodeTSType): BabelNodeTSConditionalType; - declare export function tsInferType(typeParameter: BabelNodeTSTypeParameter): BabelNodeTSInferType; - declare export function tsParenthesizedType(typeAnnotation: BabelNodeTSType): BabelNodeTSParenthesizedType; - declare export function tsTypeOperator(typeAnnotation: BabelNodeTSType): BabelNodeTSTypeOperator; - declare export function tsIndexedAccessType(objectType: BabelNodeTSType, indexType: BabelNodeTSType): BabelNodeTSIndexedAccessType; - declare export function tsMappedType(typeParameter: BabelNodeTSTypeParameter, typeAnnotation?: BabelNodeTSType, nameType?: BabelNodeTSType): BabelNodeTSMappedType; - declare export function tsLiteralType(literal: BabelNodeNumericLiteral | BabelNodeStringLiteral | BabelNodeBooleanLiteral | BabelNodeBigIntLiteral | BabelNodeUnaryExpression): BabelNodeTSLiteralType; - declare export function tsExpressionWithTypeArguments(expression: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSExpressionWithTypeArguments; - declare export function tsInterfaceDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, _extends?: Array, body: BabelNodeTSInterfaceBody): BabelNodeTSInterfaceDeclaration; - declare export function tsInterfaceBody(body: Array): BabelNodeTSInterfaceBody; - declare export function tsTypeAliasDeclaration(id: BabelNodeIdentifier, typeParameters?: BabelNodeTSTypeParameterDeclaration, typeAnnotation: BabelNodeTSType): BabelNodeTSTypeAliasDeclaration; - declare export function tsAsExpression(expression: BabelNodeExpression, typeAnnotation: BabelNodeTSType): BabelNodeTSAsExpression; - declare export function tsTypeAssertion(typeAnnotation: BabelNodeTSType, expression: BabelNodeExpression): BabelNodeTSTypeAssertion; - declare export function tsEnumDeclaration(id: BabelNodeIdentifier, members: Array): BabelNodeTSEnumDeclaration; - declare export function tsEnumMember(id: BabelNodeIdentifier | BabelNodeStringLiteral, initializer?: BabelNodeExpression): BabelNodeTSEnumMember; - declare export function tsModuleDeclaration(id: BabelNodeIdentifier | BabelNodeStringLiteral, body: BabelNodeTSModuleBlock | BabelNodeTSModuleDeclaration): BabelNodeTSModuleDeclaration; - declare export function tsModuleBlock(body: Array): BabelNodeTSModuleBlock; - declare export function tsImportType(argument: BabelNodeStringLiteral, qualifier?: BabelNodeTSEntityName, typeParameters?: BabelNodeTSTypeParameterInstantiation): BabelNodeTSImportType; - declare export function tsImportEqualsDeclaration(id: BabelNodeIdentifier, moduleReference: BabelNodeTSEntityName | BabelNodeTSExternalModuleReference): BabelNodeTSImportEqualsDeclaration; - declare export function tsExternalModuleReference(expression: BabelNodeStringLiteral): BabelNodeTSExternalModuleReference; - declare export function tsNonNullExpression(expression: BabelNodeExpression): BabelNodeTSNonNullExpression; - declare export function tsExportAssignment(expression: BabelNodeExpression): BabelNodeTSExportAssignment; - declare export function tsNamespaceExportDeclaration(id: BabelNodeIdentifier): BabelNodeTSNamespaceExportDeclaration; - declare export function tsTypeAnnotation(typeAnnotation: BabelNodeTSType): BabelNodeTSTypeAnnotation; - declare export function tsTypeParameterInstantiation(params: Array): BabelNodeTSTypeParameterInstantiation; - declare export function tsTypeParameterDeclaration(params: Array): BabelNodeTSTypeParameterDeclaration; - declare export function tsTypeParameter(constraint?: BabelNodeTSType, _default?: BabelNodeTSType, name: string): BabelNodeTSTypeParameter; - declare export function isArrayExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayExpression) - declare export function assertArrayExpression(node: ?Object, opts?: ?Object): void - declare export function isAssignmentExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAssignmentExpression) - declare export function assertAssignmentExpression(node: ?Object, opts?: ?Object): void - declare export function isBinaryExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBinaryExpression) - declare export function assertBinaryExpression(node: ?Object, opts?: ?Object): void - declare export function isInterpreterDirective(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterpreterDirective) - declare export function assertInterpreterDirective(node: ?Object, opts?: ?Object): void - declare export function isDirective(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDirective) - declare export function assertDirective(node: ?Object, opts?: ?Object): void - declare export function isDirectiveLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDirectiveLiteral) - declare export function assertDirectiveLiteral(node: ?Object, opts?: ?Object): void - declare export function isBlockStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBlockStatement) - declare export function assertBlockStatement(node: ?Object, opts?: ?Object): void - declare export function isBreakStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBreakStatement) - declare export function assertBreakStatement(node: ?Object, opts?: ?Object): void - declare export function isCallExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeCallExpression) - declare export function assertCallExpression(node: ?Object, opts?: ?Object): void - declare export function isCatchClause(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeCatchClause) - declare export function assertCatchClause(node: ?Object, opts?: ?Object): void - declare export function isConditionalExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeConditionalExpression) - declare export function assertConditionalExpression(node: ?Object, opts?: ?Object): void - declare export function isContinueStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeContinueStatement) - declare export function assertContinueStatement(node: ?Object, opts?: ?Object): void - declare export function isDebuggerStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDebuggerStatement) - declare export function assertDebuggerStatement(node: ?Object, opts?: ?Object): void - declare export function isDoWhileStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDoWhileStatement) - declare export function assertDoWhileStatement(node: ?Object, opts?: ?Object): void - declare export function isEmptyStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEmptyStatement) - declare export function assertEmptyStatement(node: ?Object, opts?: ?Object): void - declare export function isExpressionStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExpressionStatement) - declare export function assertExpressionStatement(node: ?Object, opts?: ?Object): void - declare export function isFile(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFile) - declare export function assertFile(node: ?Object, opts?: ?Object): void - declare export function isForInStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForInStatement) - declare export function assertForInStatement(node: ?Object, opts?: ?Object): void - declare export function isForStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForStatement) - declare export function assertForStatement(node: ?Object, opts?: ?Object): void - declare export function isFunctionDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionDeclaration) - declare export function assertFunctionDeclaration(node: ?Object, opts?: ?Object): void - declare export function isFunctionExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionExpression) - declare export function assertFunctionExpression(node: ?Object, opts?: ?Object): void - declare export function isIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIdentifier) - declare export function assertIdentifier(node: ?Object, opts?: ?Object): void - declare export function isIfStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIfStatement) - declare export function assertIfStatement(node: ?Object, opts?: ?Object): void - declare export function isLabeledStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeLabeledStatement) - declare export function assertLabeledStatement(node: ?Object, opts?: ?Object): void - declare export function isStringLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringLiteral) - declare export function assertStringLiteral(node: ?Object, opts?: ?Object): void - declare export function isNumericLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumericLiteral) - declare export function assertNumericLiteral(node: ?Object, opts?: ?Object): void - declare export function isNullLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullLiteral) - declare export function assertNullLiteral(node: ?Object, opts?: ?Object): void - declare export function isBooleanLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanLiteral) - declare export function assertBooleanLiteral(node: ?Object, opts?: ?Object): void - declare export function isRegExpLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRegExpLiteral) - declare export function assertRegExpLiteral(node: ?Object, opts?: ?Object): void - declare export function isLogicalExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeLogicalExpression) - declare export function assertLogicalExpression(node: ?Object, opts?: ?Object): void - declare export function isMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMemberExpression) - declare export function assertMemberExpression(node: ?Object, opts?: ?Object): void - declare export function isNewExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNewExpression) - declare export function assertNewExpression(node: ?Object, opts?: ?Object): void - declare export function isProgram(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeProgram) - declare export function assertProgram(node: ?Object, opts?: ?Object): void - declare export function isObjectExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectExpression) - declare export function assertObjectExpression(node: ?Object, opts?: ?Object): void - declare export function isObjectMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectMethod) - declare export function assertObjectMethod(node: ?Object, opts?: ?Object): void - declare export function isObjectProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectProperty) - declare export function assertObjectProperty(node: ?Object, opts?: ?Object): void - declare export function isRestElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRestElement) - declare export function assertRestElement(node: ?Object, opts?: ?Object): void - declare export function isReturnStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeReturnStatement) - declare export function assertReturnStatement(node: ?Object, opts?: ?Object): void - declare export function isSequenceExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSequenceExpression) - declare export function assertSequenceExpression(node: ?Object, opts?: ?Object): void - declare export function isParenthesizedExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeParenthesizedExpression) - declare export function assertParenthesizedExpression(node: ?Object, opts?: ?Object): void - declare export function isSwitchCase(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSwitchCase) - declare export function assertSwitchCase(node: ?Object, opts?: ?Object): void - declare export function isSwitchStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSwitchStatement) - declare export function assertSwitchStatement(node: ?Object, opts?: ?Object): void - declare export function isThisExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThisExpression) - declare export function assertThisExpression(node: ?Object, opts?: ?Object): void - declare export function isThrowStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThrowStatement) - declare export function assertThrowStatement(node: ?Object, opts?: ?Object): void - declare export function isTryStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTryStatement) - declare export function assertTryStatement(node: ?Object, opts?: ?Object): void - declare export function isUnaryExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUnaryExpression) - declare export function assertUnaryExpression(node: ?Object, opts?: ?Object): void - declare export function isUpdateExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUpdateExpression) - declare export function assertUpdateExpression(node: ?Object, opts?: ?Object): void - declare export function isVariableDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariableDeclaration) - declare export function assertVariableDeclaration(node: ?Object, opts?: ?Object): void - declare export function isVariableDeclarator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariableDeclarator) - declare export function assertVariableDeclarator(node: ?Object, opts?: ?Object): void - declare export function isWhileStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeWhileStatement) - declare export function assertWhileStatement(node: ?Object, opts?: ?Object): void - declare export function isWithStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeWithStatement) - declare export function assertWithStatement(node: ?Object, opts?: ?Object): void - declare export function isAssignmentPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAssignmentPattern) - declare export function assertAssignmentPattern(node: ?Object, opts?: ?Object): void - declare export function isArrayPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayPattern) - declare export function assertArrayPattern(node: ?Object, opts?: ?Object): void - declare export function isArrowFunctionExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrowFunctionExpression) - declare export function assertArrowFunctionExpression(node: ?Object, opts?: ?Object): void - declare export function isClassBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassBody) - declare export function assertClassBody(node: ?Object, opts?: ?Object): void - declare export function isClassExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassExpression) - declare export function assertClassExpression(node: ?Object, opts?: ?Object): void - declare export function isClassDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassDeclaration) - declare export function assertClassDeclaration(node: ?Object, opts?: ?Object): void - declare export function isExportAllDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportAllDeclaration) - declare export function assertExportAllDeclaration(node: ?Object, opts?: ?Object): void - declare export function isExportDefaultDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportDefaultDeclaration) - declare export function assertExportDefaultDeclaration(node: ?Object, opts?: ?Object): void - declare export function isExportNamedDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportNamedDeclaration) - declare export function assertExportNamedDeclaration(node: ?Object, opts?: ?Object): void - declare export function isExportSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportSpecifier) - declare export function assertExportSpecifier(node: ?Object, opts?: ?Object): void - declare export function isForOfStatement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeForOfStatement) - declare export function assertForOfStatement(node: ?Object, opts?: ?Object): void - declare export function isImportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportDeclaration) - declare export function assertImportDeclaration(node: ?Object, opts?: ?Object): void - declare export function isImportDefaultSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportDefaultSpecifier) - declare export function assertImportDefaultSpecifier(node: ?Object, opts?: ?Object): void - declare export function isImportNamespaceSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportNamespaceSpecifier) - declare export function assertImportNamespaceSpecifier(node: ?Object, opts?: ?Object): void - declare export function isImportSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportSpecifier) - declare export function assertImportSpecifier(node: ?Object, opts?: ?Object): void - declare export function isMetaProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMetaProperty) - declare export function assertMetaProperty(node: ?Object, opts?: ?Object): void - declare export function isClassMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassMethod) - declare export function assertClassMethod(node: ?Object, opts?: ?Object): void - declare export function isObjectPattern(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectPattern) - declare export function assertObjectPattern(node: ?Object, opts?: ?Object): void - declare export function isSpreadElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSpreadElement) - declare export function assertSpreadElement(node: ?Object, opts?: ?Object): void - declare export function isSuper(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSuper) - declare export function assertSuper(node: ?Object, opts?: ?Object): void - declare export function isTaggedTemplateExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTaggedTemplateExpression) - declare export function assertTaggedTemplateExpression(node: ?Object, opts?: ?Object): void - declare export function isTemplateElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTemplateElement) - declare export function assertTemplateElement(node: ?Object, opts?: ?Object): void - declare export function isTemplateLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTemplateLiteral) - declare export function assertTemplateLiteral(node: ?Object, opts?: ?Object): void - declare export function isYieldExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeYieldExpression) - declare export function assertYieldExpression(node: ?Object, opts?: ?Object): void - declare export function isAwaitExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAwaitExpression) - declare export function assertAwaitExpression(node: ?Object, opts?: ?Object): void - declare export function isImport(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImport) - declare export function assertImport(node: ?Object, opts?: ?Object): void - declare export function isBigIntLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBigIntLiteral) - declare export function assertBigIntLiteral(node: ?Object, opts?: ?Object): void - declare export function isExportNamespaceSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportNamespaceSpecifier) - declare export function assertExportNamespaceSpecifier(node: ?Object, opts?: ?Object): void - declare export function isOptionalMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalMemberExpression) - declare export function assertOptionalMemberExpression(node: ?Object, opts?: ?Object): void - declare export function isOptionalCallExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalCallExpression) - declare export function assertOptionalCallExpression(node: ?Object, opts?: ?Object): void - declare export function isClassProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassProperty) - declare export function assertClassProperty(node: ?Object, opts?: ?Object): void - declare export function isClassPrivateProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassPrivateProperty) - declare export function assertClassPrivateProperty(node: ?Object, opts?: ?Object): void - declare export function isClassPrivateMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassPrivateMethod) - declare export function assertClassPrivateMethod(node: ?Object, opts?: ?Object): void - declare export function isPrivateName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePrivateName) - declare export function assertPrivateName(node: ?Object, opts?: ?Object): void - declare export function isAnyTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeAnyTypeAnnotation) - declare export function assertAnyTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isArrayTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArrayTypeAnnotation) - declare export function assertArrayTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isBooleanTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanTypeAnnotation) - declare export function assertBooleanTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isBooleanLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBooleanLiteralTypeAnnotation) - declare export function assertBooleanLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isNullLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullLiteralTypeAnnotation) - declare export function assertNullLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isClassImplements(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeClassImplements) - declare export function assertClassImplements(node: ?Object, opts?: ?Object): void - declare export function isDeclareClass(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareClass) - declare export function assertDeclareClass(node: ?Object, opts?: ?Object): void - declare export function isDeclareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareFunction) - declare export function assertDeclareFunction(node: ?Object, opts?: ?Object): void - declare export function isDeclareInterface(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareInterface) - declare export function assertDeclareInterface(node: ?Object, opts?: ?Object): void - declare export function isDeclareModule(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareModule) - declare export function assertDeclareModule(node: ?Object, opts?: ?Object): void - declare export function isDeclareModuleExports(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareModuleExports) - declare export function assertDeclareModuleExports(node: ?Object, opts?: ?Object): void - declare export function isDeclareTypeAlias(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareTypeAlias) - declare export function assertDeclareTypeAlias(node: ?Object, opts?: ?Object): void - declare export function isDeclareOpaqueType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareOpaqueType) - declare export function assertDeclareOpaqueType(node: ?Object, opts?: ?Object): void - declare export function isDeclareVariable(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareVariable) - declare export function assertDeclareVariable(node: ?Object, opts?: ?Object): void - declare export function isDeclareExportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareExportDeclaration) - declare export function assertDeclareExportDeclaration(node: ?Object, opts?: ?Object): void - declare export function isDeclareExportAllDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclareExportAllDeclaration) - declare export function assertDeclareExportAllDeclaration(node: ?Object, opts?: ?Object): void - declare export function isDeclaredPredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDeclaredPredicate) - declare export function assertDeclaredPredicate(node: ?Object, opts?: ?Object): void - declare export function isExistsTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExistsTypeAnnotation) - declare export function assertExistsTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isFunctionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionTypeAnnotation) - declare export function assertFunctionTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isFunctionTypeParam(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeFunctionTypeParam) - declare export function assertFunctionTypeParam(node: ?Object, opts?: ?Object): void - declare export function isGenericTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeGenericTypeAnnotation) - declare export function assertGenericTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isInferredPredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInferredPredicate) - declare export function assertInferredPredicate(node: ?Object, opts?: ?Object): void - declare export function isInterfaceExtends(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceExtends) - declare export function assertInterfaceExtends(node: ?Object, opts?: ?Object): void - declare export function isInterfaceDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceDeclaration) - declare export function assertInterfaceDeclaration(node: ?Object, opts?: ?Object): void - declare export function isInterfaceTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeInterfaceTypeAnnotation) - declare export function assertInterfaceTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isIntersectionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIntersectionTypeAnnotation) - declare export function assertIntersectionTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isMixedTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeMixedTypeAnnotation) - declare export function assertMixedTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isEmptyTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEmptyTypeAnnotation) - declare export function assertEmptyTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isNullableTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNullableTypeAnnotation) - declare export function assertNullableTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isNumberLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumberLiteralTypeAnnotation) - declare export function assertNumberLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isNumberTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumberTypeAnnotation) - declare export function assertNumberTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isObjectTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeAnnotation) - declare export function assertObjectTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isObjectTypeInternalSlot(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeInternalSlot) - declare export function assertObjectTypeInternalSlot(node: ?Object, opts?: ?Object): void - declare export function isObjectTypeCallProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeCallProperty) - declare export function assertObjectTypeCallProperty(node: ?Object, opts?: ?Object): void - declare export function isObjectTypeIndexer(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeIndexer) - declare export function assertObjectTypeIndexer(node: ?Object, opts?: ?Object): void - declare export function isObjectTypeProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeProperty) - declare export function assertObjectTypeProperty(node: ?Object, opts?: ?Object): void - declare export function isObjectTypeSpreadProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeObjectTypeSpreadProperty) - declare export function assertObjectTypeSpreadProperty(node: ?Object, opts?: ?Object): void - declare export function isOpaqueType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOpaqueType) - declare export function assertOpaqueType(node: ?Object, opts?: ?Object): void - declare export function isQualifiedTypeIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeQualifiedTypeIdentifier) - declare export function assertQualifiedTypeIdentifier(node: ?Object, opts?: ?Object): void - declare export function isStringLiteralTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringLiteralTypeAnnotation) - declare export function assertStringLiteralTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isStringTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStringTypeAnnotation) - declare export function assertStringTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isSymbolTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSymbolTypeAnnotation) - declare export function assertSymbolTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isThisTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeThisTypeAnnotation) - declare export function assertThisTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isTupleTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTupleTypeAnnotation) - declare export function assertTupleTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isTypeofTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeofTypeAnnotation) - declare export function assertTypeofTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isTypeAlias(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeAlias) - declare export function assertTypeAlias(node: ?Object, opts?: ?Object): void - declare export function isTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeAnnotation) - declare export function assertTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isTypeCastExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeCastExpression) - declare export function assertTypeCastExpression(node: ?Object, opts?: ?Object): void - declare export function isTypeParameter(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameter) - declare export function assertTypeParameter(node: ?Object, opts?: ?Object): void - declare export function isTypeParameterDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameterDeclaration) - declare export function assertTypeParameterDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTypeParameterInstantiation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTypeParameterInstantiation) - declare export function assertTypeParameterInstantiation(node: ?Object, opts?: ?Object): void - declare export function isUnionTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeUnionTypeAnnotation) - declare export function assertUnionTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isVariance(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVariance) - declare export function assertVariance(node: ?Object, opts?: ?Object): void - declare export function isVoidTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeVoidTypeAnnotation) - declare export function assertVoidTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isEnumDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumDeclaration) - declare export function assertEnumDeclaration(node: ?Object, opts?: ?Object): void - declare export function isEnumBooleanBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumBooleanBody) - declare export function assertEnumBooleanBody(node: ?Object, opts?: ?Object): void - declare export function isEnumNumberBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumNumberBody) - declare export function assertEnumNumberBody(node: ?Object, opts?: ?Object): void - declare export function isEnumStringBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumStringBody) - declare export function assertEnumStringBody(node: ?Object, opts?: ?Object): void - declare export function isEnumSymbolBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumSymbolBody) - declare export function assertEnumSymbolBody(node: ?Object, opts?: ?Object): void - declare export function isEnumBooleanMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumBooleanMember) - declare export function assertEnumBooleanMember(node: ?Object, opts?: ?Object): void - declare export function isEnumNumberMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumNumberMember) - declare export function assertEnumNumberMember(node: ?Object, opts?: ?Object): void - declare export function isEnumStringMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumStringMember) - declare export function assertEnumStringMember(node: ?Object, opts?: ?Object): void - declare export function isEnumDefaultedMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeEnumDefaultedMember) - declare export function assertEnumDefaultedMember(node: ?Object, opts?: ?Object): void - declare export function isIndexedAccessType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeIndexedAccessType) - declare export function assertIndexedAccessType(node: ?Object, opts?: ?Object): void - declare export function isOptionalIndexedAccessType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeOptionalIndexedAccessType) - declare export function assertOptionalIndexedAccessType(node: ?Object, opts?: ?Object): void - declare export function isJSXAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXAttribute) - declare export function assertJSXAttribute(node: ?Object, opts?: ?Object): void - declare export function isJSXClosingElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXClosingElement) - declare export function assertJSXClosingElement(node: ?Object, opts?: ?Object): void - declare export function isJSXElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXElement) - declare export function assertJSXElement(node: ?Object, opts?: ?Object): void - declare export function isJSXEmptyExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXEmptyExpression) - declare export function assertJSXEmptyExpression(node: ?Object, opts?: ?Object): void - declare export function isJSXExpressionContainer(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXExpressionContainer) - declare export function assertJSXExpressionContainer(node: ?Object, opts?: ?Object): void - declare export function isJSXSpreadChild(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXSpreadChild) - declare export function assertJSXSpreadChild(node: ?Object, opts?: ?Object): void - declare export function isJSXIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXIdentifier) - declare export function assertJSXIdentifier(node: ?Object, opts?: ?Object): void - declare export function isJSXMemberExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXMemberExpression) - declare export function assertJSXMemberExpression(node: ?Object, opts?: ?Object): void - declare export function isJSXNamespacedName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXNamespacedName) - declare export function assertJSXNamespacedName(node: ?Object, opts?: ?Object): void - declare export function isJSXOpeningElement(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXOpeningElement) - declare export function assertJSXOpeningElement(node: ?Object, opts?: ?Object): void - declare export function isJSXSpreadAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXSpreadAttribute) - declare export function assertJSXSpreadAttribute(node: ?Object, opts?: ?Object): void - declare export function isJSXText(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXText) - declare export function assertJSXText(node: ?Object, opts?: ?Object): void - declare export function isJSXFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXFragment) - declare export function assertJSXFragment(node: ?Object, opts?: ?Object): void - declare export function isJSXOpeningFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXOpeningFragment) - declare export function assertJSXOpeningFragment(node: ?Object, opts?: ?Object): void - declare export function isJSXClosingFragment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeJSXClosingFragment) - declare export function assertJSXClosingFragment(node: ?Object, opts?: ?Object): void - declare export function isNoop(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNoop) - declare export function assertNoop(node: ?Object, opts?: ?Object): void - declare export function isPlaceholder(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePlaceholder) - declare export function assertPlaceholder(node: ?Object, opts?: ?Object): void - declare export function isV8IntrinsicIdentifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeV8IntrinsicIdentifier) - declare export function assertV8IntrinsicIdentifier(node: ?Object, opts?: ?Object): void - declare export function isArgumentPlaceholder(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeArgumentPlaceholder) - declare export function assertArgumentPlaceholder(node: ?Object, opts?: ?Object): void - declare export function isBindExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeBindExpression) - declare export function assertBindExpression(node: ?Object, opts?: ?Object): void - declare export function isImportAttribute(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeImportAttribute) - declare export function assertImportAttribute(node: ?Object, opts?: ?Object): void - declare export function isDecorator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDecorator) - declare export function assertDecorator(node: ?Object, opts?: ?Object): void - declare export function isDoExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDoExpression) - declare export function assertDoExpression(node: ?Object, opts?: ?Object): void - declare export function isExportDefaultSpecifier(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeExportDefaultSpecifier) - declare export function assertExportDefaultSpecifier(node: ?Object, opts?: ?Object): void - declare export function isRecordExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRecordExpression) - declare export function assertRecordExpression(node: ?Object, opts?: ?Object): void - declare export function isTupleExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTupleExpression) - declare export function assertTupleExpression(node: ?Object, opts?: ?Object): void - declare export function isDecimalLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeDecimalLiteral) - declare export function assertDecimalLiteral(node: ?Object, opts?: ?Object): void - declare export function isStaticBlock(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeStaticBlock) - declare export function assertStaticBlock(node: ?Object, opts?: ?Object): void - declare export function isModuleExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeModuleExpression) - declare export function assertModuleExpression(node: ?Object, opts?: ?Object): void - declare export function isTopicReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTopicReference) - declare export function assertTopicReference(node: ?Object, opts?: ?Object): void - declare export function isPipelineTopicExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelineTopicExpression) - declare export function assertPipelineTopicExpression(node: ?Object, opts?: ?Object): void - declare export function isPipelineBareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelineBareFunction) - declare export function assertPipelineBareFunction(node: ?Object, opts?: ?Object): void - declare export function isPipelinePrimaryTopicReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodePipelinePrimaryTopicReference) - declare export function assertPipelinePrimaryTopicReference(node: ?Object, opts?: ?Object): void - declare export function isTSParameterProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSParameterProperty) - declare export function assertTSParameterProperty(node: ?Object, opts?: ?Object): void - declare export function isTSDeclareFunction(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSDeclareFunction) - declare export function assertTSDeclareFunction(node: ?Object, opts?: ?Object): void - declare export function isTSDeclareMethod(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSDeclareMethod) - declare export function assertTSDeclareMethod(node: ?Object, opts?: ?Object): void - declare export function isTSQualifiedName(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSQualifiedName) - declare export function assertTSQualifiedName(node: ?Object, opts?: ?Object): void - declare export function isTSCallSignatureDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSCallSignatureDeclaration) - declare export function assertTSCallSignatureDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTSConstructSignatureDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConstructSignatureDeclaration) - declare export function assertTSConstructSignatureDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTSPropertySignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSPropertySignature) - declare export function assertTSPropertySignature(node: ?Object, opts?: ?Object): void - declare export function isTSMethodSignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSMethodSignature) - declare export function assertTSMethodSignature(node: ?Object, opts?: ?Object): void - declare export function isTSIndexSignature(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIndexSignature) - declare export function assertTSIndexSignature(node: ?Object, opts?: ?Object): void - declare export function isTSAnyKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSAnyKeyword) - declare export function assertTSAnyKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSBooleanKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSBooleanKeyword) - declare export function assertTSBooleanKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSBigIntKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSBigIntKeyword) - declare export function assertTSBigIntKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSIntrinsicKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIntrinsicKeyword) - declare export function assertTSIntrinsicKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSNeverKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNeverKeyword) - declare export function assertTSNeverKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSNullKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNullKeyword) - declare export function assertTSNullKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSNumberKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNumberKeyword) - declare export function assertTSNumberKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSObjectKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSObjectKeyword) - declare export function assertTSObjectKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSStringKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSStringKeyword) - declare export function assertTSStringKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSSymbolKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSSymbolKeyword) - declare export function assertTSSymbolKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSUndefinedKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUndefinedKeyword) - declare export function assertTSUndefinedKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSUnknownKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUnknownKeyword) - declare export function assertTSUnknownKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSVoidKeyword(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSVoidKeyword) - declare export function assertTSVoidKeyword(node: ?Object, opts?: ?Object): void - declare export function isTSThisType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSThisType) - declare export function assertTSThisType(node: ?Object, opts?: ?Object): void - declare export function isTSFunctionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSFunctionType) - declare export function assertTSFunctionType(node: ?Object, opts?: ?Object): void - declare export function isTSConstructorType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConstructorType) - declare export function assertTSConstructorType(node: ?Object, opts?: ?Object): void - declare export function isTSTypeReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeReference) - declare export function assertTSTypeReference(node: ?Object, opts?: ?Object): void - declare export function isTSTypePredicate(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypePredicate) - declare export function assertTSTypePredicate(node: ?Object, opts?: ?Object): void - declare export function isTSTypeQuery(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeQuery) - declare export function assertTSTypeQuery(node: ?Object, opts?: ?Object): void - declare export function isTSTypeLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeLiteral) - declare export function assertTSTypeLiteral(node: ?Object, opts?: ?Object): void - declare export function isTSArrayType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSArrayType) - declare export function assertTSArrayType(node: ?Object, opts?: ?Object): void - declare export function isTSTupleType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTupleType) - declare export function assertTSTupleType(node: ?Object, opts?: ?Object): void - declare export function isTSOptionalType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSOptionalType) - declare export function assertTSOptionalType(node: ?Object, opts?: ?Object): void - declare export function isTSRestType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSRestType) - declare export function assertTSRestType(node: ?Object, opts?: ?Object): void - declare export function isTSNamedTupleMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNamedTupleMember) - declare export function assertTSNamedTupleMember(node: ?Object, opts?: ?Object): void - declare export function isTSUnionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSUnionType) - declare export function assertTSUnionType(node: ?Object, opts?: ?Object): void - declare export function isTSIntersectionType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIntersectionType) - declare export function assertTSIntersectionType(node: ?Object, opts?: ?Object): void - declare export function isTSConditionalType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSConditionalType) - declare export function assertTSConditionalType(node: ?Object, opts?: ?Object): void - declare export function isTSInferType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInferType) - declare export function assertTSInferType(node: ?Object, opts?: ?Object): void - declare export function isTSParenthesizedType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSParenthesizedType) - declare export function assertTSParenthesizedType(node: ?Object, opts?: ?Object): void - declare export function isTSTypeOperator(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeOperator) - declare export function assertTSTypeOperator(node: ?Object, opts?: ?Object): void - declare export function isTSIndexedAccessType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSIndexedAccessType) - declare export function assertTSIndexedAccessType(node: ?Object, opts?: ?Object): void - declare export function isTSMappedType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSMappedType) - declare export function assertTSMappedType(node: ?Object, opts?: ?Object): void - declare export function isTSLiteralType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSLiteralType) - declare export function assertTSLiteralType(node: ?Object, opts?: ?Object): void - declare export function isTSExpressionWithTypeArguments(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExpressionWithTypeArguments) - declare export function assertTSExpressionWithTypeArguments(node: ?Object, opts?: ?Object): void - declare export function isTSInterfaceDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInterfaceDeclaration) - declare export function assertTSInterfaceDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTSInterfaceBody(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSInterfaceBody) - declare export function assertTSInterfaceBody(node: ?Object, opts?: ?Object): void - declare export function isTSTypeAliasDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAliasDeclaration) - declare export function assertTSTypeAliasDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTSAsExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSAsExpression) - declare export function assertTSAsExpression(node: ?Object, opts?: ?Object): void - declare export function isTSTypeAssertion(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAssertion) - declare export function assertTSTypeAssertion(node: ?Object, opts?: ?Object): void - declare export function isTSEnumDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSEnumDeclaration) - declare export function assertTSEnumDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTSEnumMember(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSEnumMember) - declare export function assertTSEnumMember(node: ?Object, opts?: ?Object): void - declare export function isTSModuleDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSModuleDeclaration) - declare export function assertTSModuleDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTSModuleBlock(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSModuleBlock) - declare export function assertTSModuleBlock(node: ?Object, opts?: ?Object): void - declare export function isTSImportType(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSImportType) - declare export function assertTSImportType(node: ?Object, opts?: ?Object): void - declare export function isTSImportEqualsDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSImportEqualsDeclaration) - declare export function assertTSImportEqualsDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTSExternalModuleReference(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExternalModuleReference) - declare export function assertTSExternalModuleReference(node: ?Object, opts?: ?Object): void - declare export function isTSNonNullExpression(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNonNullExpression) - declare export function assertTSNonNullExpression(node: ?Object, opts?: ?Object): void - declare export function isTSExportAssignment(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSExportAssignment) - declare export function assertTSExportAssignment(node: ?Object, opts?: ?Object): void - declare export function isTSNamespaceExportDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSNamespaceExportDeclaration) - declare export function assertTSNamespaceExportDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTSTypeAnnotation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeAnnotation) - declare export function assertTSTypeAnnotation(node: ?Object, opts?: ?Object): void - declare export function isTSTypeParameterInstantiation(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameterInstantiation) - declare export function assertTSTypeParameterInstantiation(node: ?Object, opts?: ?Object): void - declare export function isTSTypeParameterDeclaration(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameterDeclaration) - declare export function assertTSTypeParameterDeclaration(node: ?Object, opts?: ?Object): void - declare export function isTSTypeParameter(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeTSTypeParameter) - declare export function assertTSTypeParameter(node: ?Object, opts?: ?Object): void - declare export function isExpression(node: ?Object, opts?: ?Object): boolean - declare export function assertExpression(node: ?Object, opts?: ?Object): void - declare export function isBinary(node: ?Object, opts?: ?Object): boolean - declare export function assertBinary(node: ?Object, opts?: ?Object): void - declare export function isScopable(node: ?Object, opts?: ?Object): boolean - declare export function assertScopable(node: ?Object, opts?: ?Object): void - declare export function isBlockParent(node: ?Object, opts?: ?Object): boolean - declare export function assertBlockParent(node: ?Object, opts?: ?Object): void - declare export function isBlock(node: ?Object, opts?: ?Object): boolean - declare export function assertBlock(node: ?Object, opts?: ?Object): void - declare export function isStatement(node: ?Object, opts?: ?Object): boolean - declare export function assertStatement(node: ?Object, opts?: ?Object): void - declare export function isTerminatorless(node: ?Object, opts?: ?Object): boolean - declare export function assertTerminatorless(node: ?Object, opts?: ?Object): void - declare export function isCompletionStatement(node: ?Object, opts?: ?Object): boolean - declare export function assertCompletionStatement(node: ?Object, opts?: ?Object): void - declare export function isConditional(node: ?Object, opts?: ?Object): boolean - declare export function assertConditional(node: ?Object, opts?: ?Object): void - declare export function isLoop(node: ?Object, opts?: ?Object): boolean - declare export function assertLoop(node: ?Object, opts?: ?Object): void - declare export function isWhile(node: ?Object, opts?: ?Object): boolean - declare export function assertWhile(node: ?Object, opts?: ?Object): void - declare export function isExpressionWrapper(node: ?Object, opts?: ?Object): boolean - declare export function assertExpressionWrapper(node: ?Object, opts?: ?Object): void - declare export function isFor(node: ?Object, opts?: ?Object): boolean - declare export function assertFor(node: ?Object, opts?: ?Object): void - declare export function isForXStatement(node: ?Object, opts?: ?Object): boolean - declare export function assertForXStatement(node: ?Object, opts?: ?Object): void - declare export function isFunction(node: ?Object, opts?: ?Object): boolean - declare export function assertFunction(node: ?Object, opts?: ?Object): void - declare export function isFunctionParent(node: ?Object, opts?: ?Object): boolean - declare export function assertFunctionParent(node: ?Object, opts?: ?Object): void - declare export function isPureish(node: ?Object, opts?: ?Object): boolean - declare export function assertPureish(node: ?Object, opts?: ?Object): void - declare export function isDeclaration(node: ?Object, opts?: ?Object): boolean - declare export function assertDeclaration(node: ?Object, opts?: ?Object): void - declare export function isPatternLike(node: ?Object, opts?: ?Object): boolean - declare export function assertPatternLike(node: ?Object, opts?: ?Object): void - declare export function isLVal(node: ?Object, opts?: ?Object): boolean - declare export function assertLVal(node: ?Object, opts?: ?Object): void - declare export function isTSEntityName(node: ?Object, opts?: ?Object): boolean - declare export function assertTSEntityName(node: ?Object, opts?: ?Object): void - declare export function isLiteral(node: ?Object, opts?: ?Object): boolean - declare export function assertLiteral(node: ?Object, opts?: ?Object): void - declare export function isImmutable(node: ?Object, opts?: ?Object): boolean - declare export function assertImmutable(node: ?Object, opts?: ?Object): void - declare export function isUserWhitespacable(node: ?Object, opts?: ?Object): boolean - declare export function assertUserWhitespacable(node: ?Object, opts?: ?Object): void - declare export function isMethod(node: ?Object, opts?: ?Object): boolean - declare export function assertMethod(node: ?Object, opts?: ?Object): void - declare export function isObjectMember(node: ?Object, opts?: ?Object): boolean - declare export function assertObjectMember(node: ?Object, opts?: ?Object): void - declare export function isProperty(node: ?Object, opts?: ?Object): boolean - declare export function assertProperty(node: ?Object, opts?: ?Object): void - declare export function isUnaryLike(node: ?Object, opts?: ?Object): boolean - declare export function assertUnaryLike(node: ?Object, opts?: ?Object): void - declare export function isPattern(node: ?Object, opts?: ?Object): boolean - declare export function assertPattern(node: ?Object, opts?: ?Object): void - declare export function isClass(node: ?Object, opts?: ?Object): boolean - declare export function assertClass(node: ?Object, opts?: ?Object): void - declare export function isModuleDeclaration(node: ?Object, opts?: ?Object): boolean - declare export function assertModuleDeclaration(node: ?Object, opts?: ?Object): void - declare export function isExportDeclaration(node: ?Object, opts?: ?Object): boolean - declare export function assertExportDeclaration(node: ?Object, opts?: ?Object): void - declare export function isModuleSpecifier(node: ?Object, opts?: ?Object): boolean - declare export function assertModuleSpecifier(node: ?Object, opts?: ?Object): void - declare export function isPrivate(node: ?Object, opts?: ?Object): boolean - declare export function assertPrivate(node: ?Object, opts?: ?Object): void - declare export function isFlow(node: ?Object, opts?: ?Object): boolean - declare export function assertFlow(node: ?Object, opts?: ?Object): void - declare export function isFlowType(node: ?Object, opts?: ?Object): boolean - declare export function assertFlowType(node: ?Object, opts?: ?Object): void - declare export function isFlowBaseAnnotation(node: ?Object, opts?: ?Object): boolean - declare export function assertFlowBaseAnnotation(node: ?Object, opts?: ?Object): void - declare export function isFlowDeclaration(node: ?Object, opts?: ?Object): boolean - declare export function assertFlowDeclaration(node: ?Object, opts?: ?Object): void - declare export function isFlowPredicate(node: ?Object, opts?: ?Object): boolean - declare export function assertFlowPredicate(node: ?Object, opts?: ?Object): void - declare export function isEnumBody(node: ?Object, opts?: ?Object): boolean - declare export function assertEnumBody(node: ?Object, opts?: ?Object): void - declare export function isEnumMember(node: ?Object, opts?: ?Object): boolean - declare export function assertEnumMember(node: ?Object, opts?: ?Object): void - declare export function isJSX(node: ?Object, opts?: ?Object): boolean - declare export function assertJSX(node: ?Object, opts?: ?Object): void - declare export function isTSTypeElement(node: ?Object, opts?: ?Object): boolean - declare export function assertTSTypeElement(node: ?Object, opts?: ?Object): void - declare export function isTSType(node: ?Object, opts?: ?Object): boolean - declare export function assertTSType(node: ?Object, opts?: ?Object): void - declare export function isTSBaseType(node: ?Object, opts?: ?Object): boolean - declare export function assertTSBaseType(node: ?Object, opts?: ?Object): void - declare export function isNumberLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeNumericLiteral) - declare export function assertNumberLiteral(node: ?Object, opts?: ?Object): void - declare export function isRegexLiteral(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRegExpLiteral) - declare export function assertRegexLiteral(node: ?Object, opts?: ?Object): void - declare export function isRestProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeRestElement) - declare export function assertRestProperty(node: ?Object, opts?: ?Object): void - declare export function isSpreadProperty(node: ?Object, opts?: ?Object): boolean %checks (node instanceof BabelNodeSpreadElement) - declare export function assertSpreadProperty(node: ?Object, opts?: ?Object): void - declare export var VISITOR_KEYS: { [type: string]: string[] } - declare export function assertNode(obj: any): void - declare export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): BabelNodeTypeAnnotation - declare export function createUnionTypeAnnotation(types: Array): BabelNodeUnionTypeAnnotation - declare export function createFlowUnionType(types: Array): BabelNodeUnionTypeAnnotation - declare export function buildChildren(node: { children: Array }): Array - declare export function clone(n: T): T; - declare export function cloneDeep(n: T): T; - declare export function cloneDeepWithoutLoc(n: T): T; - declare export function cloneNode(n: T, deep?: boolean, withoutLoc?: boolean): T; - declare export function cloneWithoutLoc(n: T): T; - declare type CommentTypeShorthand = 'leading' | 'inner' | 'trailing' - declare export function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T - declare export function addComments(node: T, type: CommentTypeShorthand, comments: Array): T - declare export function inheritInnerComments(node: BabelNode, parent: BabelNode): void - declare export function inheritLeadingComments(node: BabelNode, parent: BabelNode): void - declare export function inheritsComments(node: T, parent: BabelNode): void - declare export function inheritTrailingComments(node: BabelNode, parent: BabelNode): void - declare export function removeComments(node: T): T - declare export function ensureBlock(node: BabelNode, key: string): BabelNodeBlockStatement - declare export function toBindingIdentifierName(name?: ?string): string - declare export function toBlock(node: BabelNodeStatement | BabelNodeExpression, parent?: BabelNodeFunction | null): BabelNodeBlockStatement - declare export function toComputedKey(node: BabelNodeMethod | BabelNodeProperty, key?: BabelNodeExpression | BabelNodeIdentifier): BabelNodeExpression - declare export function toExpression(node: BabelNodeExpressionStatement | BabelNodeExpression | BabelNodeClass | BabelNodeFunction): BabelNodeExpression - declare export function toIdentifier(name?: ?string): string - declare export function toKeyAlias(node: BabelNodeMethod | BabelNodeProperty, key?: BabelNode): string - declare export function toStatement(node: BabelNodeStatement | BabelNodeClass | BabelNodeFunction | BabelNodeAssignmentExpression, ignore?: boolean): BabelNodeStatement | void - declare export function valueToNode(value: any): BabelNodeExpression - declare export function removeTypeDuplicates(types: Array): Array - declare export function appendToMemberExpression(member: BabelNodeMemberExpression, append: BabelNode, computed?: boolean): BabelNodeMemberExpression - declare export function inherits(child: T, parent: BabelNode | null | void): T - declare export function prependToMemberExpression(member: BabelNodeMemberExpression, prepend: BabelNodeExpression): BabelNodeMemberExpression - declare export function removeProperties(n: T, opts: ?{}): void; - declare export function removePropertiesDeep(n: T, opts: ?{}): T; - declare export var getBindingIdentifiers: { - (node: BabelNode, duplicates?: boolean, outerOnly?: boolean): { [key: string]: BabelNodeIdentifier | Array }, - keys: { [type: string]: string[] } - } - declare export function getOuterBindingIdentifiers(node: BabelNode, duplicates?: boolean): { [key: string]: BabelNodeIdentifier | Array } - declare type TraversalAncestors = Array<{ - node: BabelNode, - key: string, - index?: number, - }>; - declare type TraversalHandler = (BabelNode, TraversalAncestors, T) => void; - declare type TraversalHandlers = { - enter?: TraversalHandler, - exit?: TraversalHandler, - }; - declare export function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void; - declare export function traverseFast(n: BabelNode, h: TraversalHandler, state?: T): void; - declare export function shallowEqual(actual: Object, expected: Object): boolean - declare export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (?BabelNode) => boolean - declare export function is(type: string, n: BabelNode, opts: Object): boolean; - declare export function isBinding(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean - declare export function isBlockScoped(node: BabelNode): boolean - declare export function isImmutable(node: BabelNode): boolean - declare export function isLet(node: BabelNode): boolean - declare export function isNode(node: ?Object): boolean - declare export function isNodesEquivalent(a: any, b: any): boolean - declare export function isPlaceholderType(placeholderType: string, targetType: string): boolean - declare export function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean - declare export function isScope(node: BabelNode, parent: BabelNode): boolean - declare export function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean - declare export function isType(nodetype: ?string, targetType: string): boolean - declare export function isValidES3Identifier(name: string): boolean - declare export function isValidES3Identifier(name: string): boolean - declare export function isValidIdentifier(name: string): boolean - declare export function isVar(node: BabelNode): boolean - declare export function matchesPattern(node: ?BabelNode, match: string | Array, allowPartial?: boolean): boolean - declare export function validate(n: BabelNode, key: string, value: mixed): void; -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js deleted file mode 100644 index 6a0ac93c..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = appendToMemberExpression; - -var _generated = require("../builders/generated"); - -function appendToMemberExpression(member, append, computed = false) { - member.object = (0, _generated.memberExpression)(member.object, member.property, member.computed); - member.property = append; - member.computed = !!computed; - return member; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js deleted file mode 100644 index de9464d1..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removeTypeDuplicates; - -var _generated = require("../../validators/generated"); - -function getQualifiedName(node) { - return (0, _generated.isIdentifier)(node) ? node.name : `${node.id.name}.${getQualifiedName(node.qualification)}`; -} - -function removeTypeDuplicates(nodes) { - const generics = {}; - const bases = {}; - const typeGroups = new Set(); - const types = []; - - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if (!node) continue; - - if (types.indexOf(node) >= 0) { - continue; - } - - if ((0, _generated.isAnyTypeAnnotation)(node)) { - return [node]; - } - - if ((0, _generated.isFlowBaseAnnotation)(node)) { - bases[node.type] = node; - continue; - } - - if ((0, _generated.isUnionTypeAnnotation)(node)) { - if (!typeGroups.has(node.types)) { - nodes = nodes.concat(node.types); - typeGroups.add(node.types); - } - - continue; - } - - if ((0, _generated.isGenericTypeAnnotation)(node)) { - const name = getQualifiedName(node.id); - - if (generics[name]) { - let existing = generics[name]; - - if (existing.typeParameters) { - if (node.typeParameters) { - existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params)); - } - } else { - existing = node.typeParameters; - } - } else { - generics[name] = node; - } - - continue; - } - - types.push(node); - } - - for (const type of Object.keys(bases)) { - types.push(bases[type]); - } - - for (const name of Object.keys(generics)) { - types.push(generics[name]); - } - - return types; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/inherits.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/inherits.js deleted file mode 100644 index 8701897d..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/inherits.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inherits; - -var _constants = require("../constants"); - -var _inheritsComments = require("../comments/inheritsComments"); - -function inherits(child, parent) { - if (!child || !parent) return child; - - for (const key of _constants.INHERIT_KEYS.optional) { - if (child[key] == null) { - child[key] = parent[key]; - } - } - - for (const key of Object.keys(parent)) { - if (key[0] === "_" && key !== "__clone") child[key] = parent[key]; - } - - for (const key of _constants.INHERIT_KEYS.force) { - child[key] = parent[key]; - } - - (0, _inheritsComments.default)(child, parent); - return child; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js deleted file mode 100644 index ee6de0ec..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = prependToMemberExpression; - -var _generated = require("../builders/generated"); - -function prependToMemberExpression(member, prepend) { - member.object = (0, _generated.memberExpression)(prepend, member.object); - return member; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/removeProperties.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/removeProperties.js deleted file mode 100644 index f9cf8e60..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/removeProperties.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removeProperties; - -var _constants = require("../constants"); - -const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; - -const CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS); - -function removeProperties(node, opts = {}) { - const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; - - for (const key of map) { - if (node[key] != null) node[key] = undefined; - } - - for (const key of Object.keys(node)) { - if (key[0] === "_" && node[key] != null) node[key] = undefined; - } - - const symbols = Object.getOwnPropertySymbols(node); - - for (const sym of symbols) { - node[sym] = null; - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js deleted file mode 100644 index e36f7558..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removePropertiesDeep; - -var _traverseFast = require("../traverse/traverseFast"); - -var _removeProperties = require("./removeProperties"); - -function removePropertiesDeep(tree, opts) { - (0, _traverseFast.default)(tree, _removeProperties.default, opts); - return tree; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js deleted file mode 100644 index 25defea7..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = removeTypeDuplicates; - -var _generated = require("../../validators/generated"); - -function removeTypeDuplicates(nodes) { - const generics = {}; - const bases = {}; - const typeGroups = new Set(); - const types = []; - - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if (!node) continue; - - if (types.indexOf(node) >= 0) { - continue; - } - - if ((0, _generated.isTSAnyKeyword)(node)) { - return [node]; - } - - if ((0, _generated.isTSBaseType)(node)) { - bases[node.type] = node; - continue; - } - - if ((0, _generated.isTSUnionType)(node)) { - if (!typeGroups.has(node.types)) { - nodes.push(...node.types); - typeGroups.add(node.types); - } - - continue; - } - - types.push(node); - } - - for (const type of Object.keys(bases)) { - types.push(bases[type]); - } - - for (const name of Object.keys(generics)) { - types.push(generics[name]); - } - - return types; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js deleted file mode 100644 index 4daaf8bf..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getBindingIdentifiers; - -var _generated = require("../validators/generated"); - -function getBindingIdentifiers(node, duplicates, outerOnly) { - let search = [].concat(node); - const ids = Object.create(null); - - while (search.length) { - const id = search.shift(); - if (!id) continue; - const keys = getBindingIdentifiers.keys[id.type]; - - if ((0, _generated.isIdentifier)(id)) { - if (duplicates) { - const _ids = ids[id.name] = ids[id.name] || []; - - _ids.push(id); - } else { - ids[id.name] = id; - } - - continue; - } - - if ((0, _generated.isExportDeclaration)(id) && !(0, _generated.isExportAllDeclaration)(id)) { - if ((0, _generated.isDeclaration)(id.declaration)) { - search.push(id.declaration); - } - - continue; - } - - if (outerOnly) { - if ((0, _generated.isFunctionDeclaration)(id)) { - search.push(id.id); - continue; - } - - if ((0, _generated.isFunctionExpression)(id)) { - continue; - } - } - - if (keys) { - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - - if (id[key]) { - search = search.concat(id[key]); - } - } - } - } - - return ids; -} - -getBindingIdentifiers.keys = { - DeclareClass: ["id"], - DeclareFunction: ["id"], - DeclareModule: ["id"], - DeclareVariable: ["id"], - DeclareInterface: ["id"], - DeclareTypeAlias: ["id"], - DeclareOpaqueType: ["id"], - InterfaceDeclaration: ["id"], - TypeAlias: ["id"], - OpaqueType: ["id"], - CatchClause: ["param"], - LabeledStatement: ["label"], - UnaryExpression: ["argument"], - AssignmentExpression: ["left"], - ImportSpecifier: ["local"], - ImportNamespaceSpecifier: ["local"], - ImportDefaultSpecifier: ["local"], - ImportDeclaration: ["specifiers"], - ExportSpecifier: ["exported"], - ExportNamespaceSpecifier: ["exported"], - ExportDefaultSpecifier: ["exported"], - FunctionDeclaration: ["id", "params"], - FunctionExpression: ["id", "params"], - ArrowFunctionExpression: ["params"], - ObjectMethod: ["params"], - ClassMethod: ["params"], - ClassPrivateMethod: ["params"], - ForInStatement: ["left"], - ForOfStatement: ["left"], - ClassDeclaration: ["id"], - ClassExpression: ["id"], - RestElement: ["argument"], - UpdateExpression: ["argument"], - ObjectProperty: ["value"], - AssignmentPattern: ["left"], - ArrayPattern: ["elements"], - ObjectPattern: ["properties"], - VariableDeclaration: ["declarations"], - VariableDeclarator: ["id"] -}; \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js deleted file mode 100644 index c27cffe5..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _getBindingIdentifiers = require("./getBindingIdentifiers"); - -var _default = getOuterBindingIdentifiers; -exports.default = _default; - -function getOuterBindingIdentifiers(node, duplicates) { - return (0, _getBindingIdentifiers.default)(node, duplicates, true); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/traverse/traverse.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/traverse/traverse.js deleted file mode 100644 index 775aed1e..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/traverse/traverse.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = traverse; - -var _definitions = require("../definitions"); - -function traverse(node, handlers, state) { - if (typeof handlers === "function") { - handlers = { - enter: handlers - }; - } - - const { - enter, - exit - } = handlers; - traverseSimpleImpl(node, enter, exit, state, []); -} - -function traverseSimpleImpl(node, enter, exit, state, ancestors) { - const keys = _definitions.VISITOR_KEYS[node.type]; - if (!keys) return; - if (enter) enter(node, ancestors, state); - - for (const key of keys) { - const subNode = node[key]; - - if (Array.isArray(subNode)) { - for (let i = 0; i < subNode.length; i++) { - const child = subNode[i]; - if (!child) continue; - ancestors.push({ - node, - key, - index: i - }); - traverseSimpleImpl(child, enter, exit, state, ancestors); - ancestors.pop(); - } - } else if (subNode) { - ancestors.push({ - node, - key - }); - traverseSimpleImpl(subNode, enter, exit, state, ancestors); - ancestors.pop(); - } - } - - if (exit) exit(node, ancestors, state); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/traverse/traverseFast.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/traverse/traverseFast.js deleted file mode 100644 index f038dd83..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/traverse/traverseFast.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = traverseFast; - -var _definitions = require("../definitions"); - -function traverseFast(node, enter, opts) { - if (!node) return; - const keys = _definitions.VISITOR_KEYS[node.type]; - if (!keys) return; - opts = opts || {}; - enter(node, opts); - - for (const key of keys) { - const subNode = node[key]; - - if (Array.isArray(subNode)) { - for (const node of subNode) { - traverseFast(node, enter, opts); - } - } else { - traverseFast(subNode, enter, opts); - } - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/utils/inherit.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/utils/inherit.js deleted file mode 100644 index 35f33812..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/utils/inherit.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inherit; - -function inherit(key, child, parent) { - if (child && parent) { - child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean))); - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js deleted file mode 100644 index f0ca1336..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cleanJSXElementLiteralChild; - -var _generated = require("../../builders/generated"); - -function cleanJSXElementLiteralChild(child, args) { - const lines = child.value.split(/\r\n|\n|\r/); - let lastNonEmptyLine = 0; - - for (let i = 0; i < lines.length; i++) { - if (lines[i].match(/[^ \t]/)) { - lastNonEmptyLine = i; - } - } - - let str = ""; - - for (let i = 0; i < lines.length; i++) { - const line = lines[i]; - const isFirstLine = i === 0; - const isLastLine = i === lines.length - 1; - const isLastNonEmptyLine = i === lastNonEmptyLine; - let trimmedLine = line.replace(/\t/g, " "); - - if (!isFirstLine) { - trimmedLine = trimmedLine.replace(/^[ ]+/, ""); - } - - if (!isLastLine) { - trimmedLine = trimmedLine.replace(/[ ]+$/, ""); - } - - if (trimmedLine) { - if (!isLastNonEmptyLine) { - trimmedLine += " "; - } - - str += trimmedLine; - } - } - - if (str) args.push((0, _generated.stringLiteral)(str)); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/utils/shallowEqual.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/utils/shallowEqual.js deleted file mode 100644 index fae259e4..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/utils/shallowEqual.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = shallowEqual; - -function shallowEqual(actual, expected) { - const keys = Object.keys(expected); - - for (const key of keys) { - if (actual[key] !== expected[key]) { - return false; - } - } - - return true; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js deleted file mode 100644 index c0064968..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = buildMatchMemberExpression; - -var _matchesPattern = require("./matchesPattern"); - -function buildMatchMemberExpression(match, allowPartial) { - const parts = match.split("."); - return member => (0, _matchesPattern.default)(member, parts, allowPartial); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/generated/index.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/generated/index.js deleted file mode 100644 index 0d54c9bd..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/generated/index.js +++ /dev/null @@ -1,4731 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isArrayExpression = isArrayExpression; -exports.isAssignmentExpression = isAssignmentExpression; -exports.isBinaryExpression = isBinaryExpression; -exports.isInterpreterDirective = isInterpreterDirective; -exports.isDirective = isDirective; -exports.isDirectiveLiteral = isDirectiveLiteral; -exports.isBlockStatement = isBlockStatement; -exports.isBreakStatement = isBreakStatement; -exports.isCallExpression = isCallExpression; -exports.isCatchClause = isCatchClause; -exports.isConditionalExpression = isConditionalExpression; -exports.isContinueStatement = isContinueStatement; -exports.isDebuggerStatement = isDebuggerStatement; -exports.isDoWhileStatement = isDoWhileStatement; -exports.isEmptyStatement = isEmptyStatement; -exports.isExpressionStatement = isExpressionStatement; -exports.isFile = isFile; -exports.isForInStatement = isForInStatement; -exports.isForStatement = isForStatement; -exports.isFunctionDeclaration = isFunctionDeclaration; -exports.isFunctionExpression = isFunctionExpression; -exports.isIdentifier = isIdentifier; -exports.isIfStatement = isIfStatement; -exports.isLabeledStatement = isLabeledStatement; -exports.isStringLiteral = isStringLiteral; -exports.isNumericLiteral = isNumericLiteral; -exports.isNullLiteral = isNullLiteral; -exports.isBooleanLiteral = isBooleanLiteral; -exports.isRegExpLiteral = isRegExpLiteral; -exports.isLogicalExpression = isLogicalExpression; -exports.isMemberExpression = isMemberExpression; -exports.isNewExpression = isNewExpression; -exports.isProgram = isProgram; -exports.isObjectExpression = isObjectExpression; -exports.isObjectMethod = isObjectMethod; -exports.isObjectProperty = isObjectProperty; -exports.isRestElement = isRestElement; -exports.isReturnStatement = isReturnStatement; -exports.isSequenceExpression = isSequenceExpression; -exports.isParenthesizedExpression = isParenthesizedExpression; -exports.isSwitchCase = isSwitchCase; -exports.isSwitchStatement = isSwitchStatement; -exports.isThisExpression = isThisExpression; -exports.isThrowStatement = isThrowStatement; -exports.isTryStatement = isTryStatement; -exports.isUnaryExpression = isUnaryExpression; -exports.isUpdateExpression = isUpdateExpression; -exports.isVariableDeclaration = isVariableDeclaration; -exports.isVariableDeclarator = isVariableDeclarator; -exports.isWhileStatement = isWhileStatement; -exports.isWithStatement = isWithStatement; -exports.isAssignmentPattern = isAssignmentPattern; -exports.isArrayPattern = isArrayPattern; -exports.isArrowFunctionExpression = isArrowFunctionExpression; -exports.isClassBody = isClassBody; -exports.isClassExpression = isClassExpression; -exports.isClassDeclaration = isClassDeclaration; -exports.isExportAllDeclaration = isExportAllDeclaration; -exports.isExportDefaultDeclaration = isExportDefaultDeclaration; -exports.isExportNamedDeclaration = isExportNamedDeclaration; -exports.isExportSpecifier = isExportSpecifier; -exports.isForOfStatement = isForOfStatement; -exports.isImportDeclaration = isImportDeclaration; -exports.isImportDefaultSpecifier = isImportDefaultSpecifier; -exports.isImportNamespaceSpecifier = isImportNamespaceSpecifier; -exports.isImportSpecifier = isImportSpecifier; -exports.isMetaProperty = isMetaProperty; -exports.isClassMethod = isClassMethod; -exports.isObjectPattern = isObjectPattern; -exports.isSpreadElement = isSpreadElement; -exports.isSuper = isSuper; -exports.isTaggedTemplateExpression = isTaggedTemplateExpression; -exports.isTemplateElement = isTemplateElement; -exports.isTemplateLiteral = isTemplateLiteral; -exports.isYieldExpression = isYieldExpression; -exports.isAwaitExpression = isAwaitExpression; -exports.isImport = isImport; -exports.isBigIntLiteral = isBigIntLiteral; -exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier; -exports.isOptionalMemberExpression = isOptionalMemberExpression; -exports.isOptionalCallExpression = isOptionalCallExpression; -exports.isClassProperty = isClassProperty; -exports.isClassPrivateProperty = isClassPrivateProperty; -exports.isClassPrivateMethod = isClassPrivateMethod; -exports.isPrivateName = isPrivateName; -exports.isAnyTypeAnnotation = isAnyTypeAnnotation; -exports.isArrayTypeAnnotation = isArrayTypeAnnotation; -exports.isBooleanTypeAnnotation = isBooleanTypeAnnotation; -exports.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation; -exports.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation; -exports.isClassImplements = isClassImplements; -exports.isDeclareClass = isDeclareClass; -exports.isDeclareFunction = isDeclareFunction; -exports.isDeclareInterface = isDeclareInterface; -exports.isDeclareModule = isDeclareModule; -exports.isDeclareModuleExports = isDeclareModuleExports; -exports.isDeclareTypeAlias = isDeclareTypeAlias; -exports.isDeclareOpaqueType = isDeclareOpaqueType; -exports.isDeclareVariable = isDeclareVariable; -exports.isDeclareExportDeclaration = isDeclareExportDeclaration; -exports.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration; -exports.isDeclaredPredicate = isDeclaredPredicate; -exports.isExistsTypeAnnotation = isExistsTypeAnnotation; -exports.isFunctionTypeAnnotation = isFunctionTypeAnnotation; -exports.isFunctionTypeParam = isFunctionTypeParam; -exports.isGenericTypeAnnotation = isGenericTypeAnnotation; -exports.isInferredPredicate = isInferredPredicate; -exports.isInterfaceExtends = isInterfaceExtends; -exports.isInterfaceDeclaration = isInterfaceDeclaration; -exports.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation; -exports.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation; -exports.isMixedTypeAnnotation = isMixedTypeAnnotation; -exports.isEmptyTypeAnnotation = isEmptyTypeAnnotation; -exports.isNullableTypeAnnotation = isNullableTypeAnnotation; -exports.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation; -exports.isNumberTypeAnnotation = isNumberTypeAnnotation; -exports.isObjectTypeAnnotation = isObjectTypeAnnotation; -exports.isObjectTypeInternalSlot = isObjectTypeInternalSlot; -exports.isObjectTypeCallProperty = isObjectTypeCallProperty; -exports.isObjectTypeIndexer = isObjectTypeIndexer; -exports.isObjectTypeProperty = isObjectTypeProperty; -exports.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty; -exports.isOpaqueType = isOpaqueType; -exports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier; -exports.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation; -exports.isStringTypeAnnotation = isStringTypeAnnotation; -exports.isSymbolTypeAnnotation = isSymbolTypeAnnotation; -exports.isThisTypeAnnotation = isThisTypeAnnotation; -exports.isTupleTypeAnnotation = isTupleTypeAnnotation; -exports.isTypeofTypeAnnotation = isTypeofTypeAnnotation; -exports.isTypeAlias = isTypeAlias; -exports.isTypeAnnotation = isTypeAnnotation; -exports.isTypeCastExpression = isTypeCastExpression; -exports.isTypeParameter = isTypeParameter; -exports.isTypeParameterDeclaration = isTypeParameterDeclaration; -exports.isTypeParameterInstantiation = isTypeParameterInstantiation; -exports.isUnionTypeAnnotation = isUnionTypeAnnotation; -exports.isVariance = isVariance; -exports.isVoidTypeAnnotation = isVoidTypeAnnotation; -exports.isEnumDeclaration = isEnumDeclaration; -exports.isEnumBooleanBody = isEnumBooleanBody; -exports.isEnumNumberBody = isEnumNumberBody; -exports.isEnumStringBody = isEnumStringBody; -exports.isEnumSymbolBody = isEnumSymbolBody; -exports.isEnumBooleanMember = isEnumBooleanMember; -exports.isEnumNumberMember = isEnumNumberMember; -exports.isEnumStringMember = isEnumStringMember; -exports.isEnumDefaultedMember = isEnumDefaultedMember; -exports.isIndexedAccessType = isIndexedAccessType; -exports.isOptionalIndexedAccessType = isOptionalIndexedAccessType; -exports.isJSXAttribute = isJSXAttribute; -exports.isJSXClosingElement = isJSXClosingElement; -exports.isJSXElement = isJSXElement; -exports.isJSXEmptyExpression = isJSXEmptyExpression; -exports.isJSXExpressionContainer = isJSXExpressionContainer; -exports.isJSXSpreadChild = isJSXSpreadChild; -exports.isJSXIdentifier = isJSXIdentifier; -exports.isJSXMemberExpression = isJSXMemberExpression; -exports.isJSXNamespacedName = isJSXNamespacedName; -exports.isJSXOpeningElement = isJSXOpeningElement; -exports.isJSXSpreadAttribute = isJSXSpreadAttribute; -exports.isJSXText = isJSXText; -exports.isJSXFragment = isJSXFragment; -exports.isJSXOpeningFragment = isJSXOpeningFragment; -exports.isJSXClosingFragment = isJSXClosingFragment; -exports.isNoop = isNoop; -exports.isPlaceholder = isPlaceholder; -exports.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier; -exports.isArgumentPlaceholder = isArgumentPlaceholder; -exports.isBindExpression = isBindExpression; -exports.isImportAttribute = isImportAttribute; -exports.isDecorator = isDecorator; -exports.isDoExpression = isDoExpression; -exports.isExportDefaultSpecifier = isExportDefaultSpecifier; -exports.isRecordExpression = isRecordExpression; -exports.isTupleExpression = isTupleExpression; -exports.isDecimalLiteral = isDecimalLiteral; -exports.isStaticBlock = isStaticBlock; -exports.isModuleExpression = isModuleExpression; -exports.isTopicReference = isTopicReference; -exports.isPipelineTopicExpression = isPipelineTopicExpression; -exports.isPipelineBareFunction = isPipelineBareFunction; -exports.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference; -exports.isTSParameterProperty = isTSParameterProperty; -exports.isTSDeclareFunction = isTSDeclareFunction; -exports.isTSDeclareMethod = isTSDeclareMethod; -exports.isTSQualifiedName = isTSQualifiedName; -exports.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration; -exports.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration; -exports.isTSPropertySignature = isTSPropertySignature; -exports.isTSMethodSignature = isTSMethodSignature; -exports.isTSIndexSignature = isTSIndexSignature; -exports.isTSAnyKeyword = isTSAnyKeyword; -exports.isTSBooleanKeyword = isTSBooleanKeyword; -exports.isTSBigIntKeyword = isTSBigIntKeyword; -exports.isTSIntrinsicKeyword = isTSIntrinsicKeyword; -exports.isTSNeverKeyword = isTSNeverKeyword; -exports.isTSNullKeyword = isTSNullKeyword; -exports.isTSNumberKeyword = isTSNumberKeyword; -exports.isTSObjectKeyword = isTSObjectKeyword; -exports.isTSStringKeyword = isTSStringKeyword; -exports.isTSSymbolKeyword = isTSSymbolKeyword; -exports.isTSUndefinedKeyword = isTSUndefinedKeyword; -exports.isTSUnknownKeyword = isTSUnknownKeyword; -exports.isTSVoidKeyword = isTSVoidKeyword; -exports.isTSThisType = isTSThisType; -exports.isTSFunctionType = isTSFunctionType; -exports.isTSConstructorType = isTSConstructorType; -exports.isTSTypeReference = isTSTypeReference; -exports.isTSTypePredicate = isTSTypePredicate; -exports.isTSTypeQuery = isTSTypeQuery; -exports.isTSTypeLiteral = isTSTypeLiteral; -exports.isTSArrayType = isTSArrayType; -exports.isTSTupleType = isTSTupleType; -exports.isTSOptionalType = isTSOptionalType; -exports.isTSRestType = isTSRestType; -exports.isTSNamedTupleMember = isTSNamedTupleMember; -exports.isTSUnionType = isTSUnionType; -exports.isTSIntersectionType = isTSIntersectionType; -exports.isTSConditionalType = isTSConditionalType; -exports.isTSInferType = isTSInferType; -exports.isTSParenthesizedType = isTSParenthesizedType; -exports.isTSTypeOperator = isTSTypeOperator; -exports.isTSIndexedAccessType = isTSIndexedAccessType; -exports.isTSMappedType = isTSMappedType; -exports.isTSLiteralType = isTSLiteralType; -exports.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments; -exports.isTSInterfaceDeclaration = isTSInterfaceDeclaration; -exports.isTSInterfaceBody = isTSInterfaceBody; -exports.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration; -exports.isTSAsExpression = isTSAsExpression; -exports.isTSTypeAssertion = isTSTypeAssertion; -exports.isTSEnumDeclaration = isTSEnumDeclaration; -exports.isTSEnumMember = isTSEnumMember; -exports.isTSModuleDeclaration = isTSModuleDeclaration; -exports.isTSModuleBlock = isTSModuleBlock; -exports.isTSImportType = isTSImportType; -exports.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration; -exports.isTSExternalModuleReference = isTSExternalModuleReference; -exports.isTSNonNullExpression = isTSNonNullExpression; -exports.isTSExportAssignment = isTSExportAssignment; -exports.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration; -exports.isTSTypeAnnotation = isTSTypeAnnotation; -exports.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation; -exports.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration; -exports.isTSTypeParameter = isTSTypeParameter; -exports.isExpression = isExpression; -exports.isBinary = isBinary; -exports.isScopable = isScopable; -exports.isBlockParent = isBlockParent; -exports.isBlock = isBlock; -exports.isStatement = isStatement; -exports.isTerminatorless = isTerminatorless; -exports.isCompletionStatement = isCompletionStatement; -exports.isConditional = isConditional; -exports.isLoop = isLoop; -exports.isWhile = isWhile; -exports.isExpressionWrapper = isExpressionWrapper; -exports.isFor = isFor; -exports.isForXStatement = isForXStatement; -exports.isFunction = isFunction; -exports.isFunctionParent = isFunctionParent; -exports.isPureish = isPureish; -exports.isDeclaration = isDeclaration; -exports.isPatternLike = isPatternLike; -exports.isLVal = isLVal; -exports.isTSEntityName = isTSEntityName; -exports.isLiteral = isLiteral; -exports.isImmutable = isImmutable; -exports.isUserWhitespacable = isUserWhitespacable; -exports.isMethod = isMethod; -exports.isObjectMember = isObjectMember; -exports.isProperty = isProperty; -exports.isUnaryLike = isUnaryLike; -exports.isPattern = isPattern; -exports.isClass = isClass; -exports.isModuleDeclaration = isModuleDeclaration; -exports.isExportDeclaration = isExportDeclaration; -exports.isModuleSpecifier = isModuleSpecifier; -exports.isPrivate = isPrivate; -exports.isFlow = isFlow; -exports.isFlowType = isFlowType; -exports.isFlowBaseAnnotation = isFlowBaseAnnotation; -exports.isFlowDeclaration = isFlowDeclaration; -exports.isFlowPredicate = isFlowPredicate; -exports.isEnumBody = isEnumBody; -exports.isEnumMember = isEnumMember; -exports.isJSX = isJSX; -exports.isTSTypeElement = isTSTypeElement; -exports.isTSType = isTSType; -exports.isTSBaseType = isTSBaseType; -exports.isNumberLiteral = isNumberLiteral; -exports.isRegexLiteral = isRegexLiteral; -exports.isRestProperty = isRestProperty; -exports.isSpreadProperty = isSpreadProperty; - -var _shallowEqual = require("../../utils/shallowEqual"); - -function isArrayExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArrayExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isAssignmentExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "AssignmentExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBinaryExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BinaryExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInterpreterDirective(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InterpreterDirective") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDirective(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Directive") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDirectiveLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DirectiveLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBlockStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BlockStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBreakStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BreakStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isCallExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "CallExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isCatchClause(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "CatchClause") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isConditionalExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ConditionalExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isContinueStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ContinueStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDebuggerStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DebuggerStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDoWhileStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DoWhileStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEmptyStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EmptyStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExpressionStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExpressionStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFile(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "File") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isForInStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ForInStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isForStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ForStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FunctionDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FunctionExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isIdentifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Identifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isIfStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "IfStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLabeledStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "LabeledStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isStringLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "StringLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNumericLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NumericLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNullLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NullLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBooleanLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BooleanLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isRegExpLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "RegExpLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLogicalExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "LogicalExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isMemberExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "MemberExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNewExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NewExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isProgram(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Program") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectMethod") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isRestElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "RestElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isReturnStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ReturnStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSequenceExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SequenceExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isParenthesizedExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ParenthesizedExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSwitchCase(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SwitchCase") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSwitchStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SwitchStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isThisExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ThisExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isThrowStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ThrowStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTryStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TryStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUnaryExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "UnaryExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUpdateExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "UpdateExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isVariableDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "VariableDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isVariableDeclarator(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "VariableDeclarator") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isWhileStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "WhileStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isWithStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "WithStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isAssignmentPattern(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "AssignmentPattern") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isArrayPattern(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArrayPattern") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isArrowFunctionExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArrowFunctionExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassBody(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassBody") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportAllDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportAllDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportDefaultDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportDefaultDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportNamedDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportNamedDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isForOfStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ForOfStatement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImportDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ImportDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImportDefaultSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ImportDefaultSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImportNamespaceSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ImportNamespaceSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImportSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ImportSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isMetaProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "MetaProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassMethod") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectPattern(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectPattern") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSpreadElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SpreadElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSuper(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Super") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTaggedTemplateExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TaggedTemplateExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTemplateElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TemplateElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTemplateLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TemplateLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isYieldExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "YieldExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isAwaitExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "AwaitExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImport(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Import") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBigIntLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BigIntLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportNamespaceSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportNamespaceSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isOptionalMemberExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "OptionalMemberExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isOptionalCallExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "OptionalCallExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassPrivateProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassPrivateProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassPrivateMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassPrivateMethod") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPrivateName(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "PrivateName") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isAnyTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "AnyTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isArrayTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArrayTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBooleanTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BooleanTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBooleanLiteralTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BooleanLiteralTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNullLiteralTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NullLiteralTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClassImplements(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ClassImplements") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareClass(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareClass") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareFunction(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareFunction") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareInterface(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareInterface") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareModule(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareModule") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareModuleExports(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareModuleExports") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareTypeAlias(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareTypeAlias") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareOpaqueType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareOpaqueType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareVariable(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareVariable") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareExportDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareExportDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclareExportAllDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclareExportAllDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclaredPredicate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DeclaredPredicate") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExistsTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExistsTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FunctionTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionTypeParam(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "FunctionTypeParam") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isGenericTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "GenericTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInferredPredicate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InferredPredicate") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInterfaceExtends(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InterfaceExtends") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInterfaceDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InterfaceDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isInterfaceTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "InterfaceTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isIntersectionTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "IntersectionTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isMixedTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "MixedTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEmptyTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EmptyTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNullableTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NullableTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNumberLiteralTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NumberLiteralTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNumberTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NumberTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeInternalSlot(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeInternalSlot") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeCallProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeCallProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeIndexer(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeIndexer") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectTypeSpreadProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ObjectTypeSpreadProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isOpaqueType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "OpaqueType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isQualifiedTypeIdentifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "QualifiedTypeIdentifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isStringLiteralTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "StringLiteralTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isStringTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "StringTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSymbolTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SymbolTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isThisTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ThisTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTupleTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TupleTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeofTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeofTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeAlias(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeAlias") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeCastExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeCastExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeParameter(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeParameter") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeParameterDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeParameterDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTypeParameterInstantiation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TypeParameterInstantiation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUnionTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "UnionTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isVariance(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Variance") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isVoidTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "VoidTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EnumDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumBooleanBody(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EnumBooleanBody") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumNumberBody(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EnumNumberBody") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumStringBody(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EnumStringBody") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumSymbolBody(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EnumSymbolBody") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumBooleanMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EnumBooleanMember") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumNumberMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EnumNumberMember") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumStringMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EnumStringMember") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumDefaultedMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "EnumDefaultedMember") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isIndexedAccessType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "IndexedAccessType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isOptionalIndexedAccessType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "OptionalIndexedAccessType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXAttribute(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXAttribute") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXClosingElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXClosingElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXEmptyExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXEmptyExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXExpressionContainer(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXExpressionContainer") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXSpreadChild(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXSpreadChild") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXIdentifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXIdentifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXMemberExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXMemberExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXNamespacedName(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXNamespacedName") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXOpeningElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXOpeningElement") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXSpreadAttribute(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXSpreadAttribute") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXText(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXText") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXFragment(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXFragment") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXOpeningFragment(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXOpeningFragment") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSXClosingFragment(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "JSXClosingFragment") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNoop(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Noop") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPlaceholder(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Placeholder") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isV8IntrinsicIdentifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "V8IntrinsicIdentifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isArgumentPlaceholder(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ArgumentPlaceholder") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBindExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "BindExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImportAttribute(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ImportAttribute") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDecorator(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "Decorator") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDoExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DoExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportDefaultSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ExportDefaultSpecifier") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isRecordExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "RecordExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTupleExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TupleExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDecimalLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "DecimalLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isStaticBlock(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "StaticBlock") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isModuleExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "ModuleExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTopicReference(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TopicReference") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPipelineTopicExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "PipelineTopicExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPipelineBareFunction(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "PipelineBareFunction") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPipelinePrimaryTopicReference(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "PipelinePrimaryTopicReference") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSParameterProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSParameterProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSDeclareFunction(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSDeclareFunction") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSDeclareMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSDeclareMethod") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSQualifiedName(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSQualifiedName") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSCallSignatureDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSCallSignatureDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSConstructSignatureDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSConstructSignatureDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSPropertySignature(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSPropertySignature") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSMethodSignature(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSMethodSignature") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSIndexSignature(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSIndexSignature") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSAnyKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSAnyKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSBooleanKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSBooleanKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSBigIntKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSBigIntKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSIntrinsicKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSIntrinsicKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNeverKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNeverKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNullKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNullKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNumberKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNumberKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSObjectKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSObjectKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSStringKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSStringKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSSymbolKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSSymbolKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSUndefinedKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSUndefinedKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSUnknownKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSUnknownKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSVoidKeyword(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSVoidKeyword") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSThisType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSThisType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSFunctionType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSFunctionType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSConstructorType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSConstructorType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeReference(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeReference") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypePredicate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypePredicate") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeQuery(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeQuery") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSArrayType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSArrayType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTupleType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTupleType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSOptionalType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSOptionalType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSRestType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSRestType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNamedTupleMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNamedTupleMember") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSUnionType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSUnionType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSIntersectionType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSIntersectionType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSConditionalType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSConditionalType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSInferType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSInferType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSParenthesizedType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSParenthesizedType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeOperator(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeOperator") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSIndexedAccessType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSIndexedAccessType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSMappedType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSMappedType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSLiteralType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSLiteralType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSExpressionWithTypeArguments(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSExpressionWithTypeArguments") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSInterfaceDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSInterfaceDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSInterfaceBody(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSInterfaceBody") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeAliasDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeAliasDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSAsExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSAsExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeAssertion(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeAssertion") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSEnumDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSEnumDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSEnumMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSEnumMember") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSModuleDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSModuleDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSModuleBlock(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSModuleBlock") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSImportType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSImportType") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSImportEqualsDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSImportEqualsDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSExternalModuleReference(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSExternalModuleReference") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNonNullExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNonNullExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSExportAssignment(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSExportAssignment") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSNamespaceExportDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSNamespaceExportDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeAnnotation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeParameterInstantiation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeParameterInstantiation") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeParameterDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeParameterDeclaration") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeParameter(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "TSTypeParameter") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExpression(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType || "Import" === nodeType || "BigIntLiteral" === nodeType || "OptionalMemberExpression" === nodeType || "OptionalCallExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "BindExpression" === nodeType || "DoExpression" === nodeType || "RecordExpression" === nodeType || "TupleExpression" === nodeType || "DecimalLiteral" === nodeType || "ModuleExpression" === nodeType || "TopicReference" === nodeType || "PipelineTopicExpression" === nodeType || "PipelineBareFunction" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBinary(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("BinaryExpression" === nodeType || "LogicalExpression" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isScopable(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBlockParent(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isBlock(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTerminatorless(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isCompletionStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isConditional(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ConditionalExpression" === nodeType || "IfStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLoop(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isWhile(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("DoWhileStatement" === nodeType || "WhileStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExpressionWrapper(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFor(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isForXStatement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ForInStatement" === nodeType || "ForOfStatement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunction(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFunctionParent(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPureish(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPatternLike(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLVal(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSEntityName(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isLiteral(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isImmutable(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "BigIntLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUserWhitespacable(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isMethod(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isObjectMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isProperty(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isUnaryLike(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("UnaryExpression" === nodeType || "SpreadElement" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPattern(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isClass(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ClassExpression" === nodeType || "ClassDeclaration" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isModuleDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isExportDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isModuleSpecifier(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isPrivate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlow(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlowType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlowBaseAnnotation(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlowDeclaration(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isFlowPredicate(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumBody(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isEnumMember(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isJSX(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSTypeElement(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isTSBaseType(node, opts) { - if (!node) return false; - const nodeType = node.type; - - if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSLiteralType" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isNumberLiteral(node, opts) { - console.trace("The node type NumberLiteral has been renamed to NumericLiteral"); - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "NumberLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isRegexLiteral(node, opts) { - console.trace("The node type RegexLiteral has been renamed to RegExpLiteral"); - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "RegexLiteral") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isRestProperty(node, opts) { - console.trace("The node type RestProperty has been renamed to RestElement"); - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "RestProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} - -function isSpreadProperty(node, opts) { - console.trace("The node type SpreadProperty has been renamed to SpreadElement"); - if (!node) return false; - const nodeType = node.type; - - if (nodeType === "SpreadProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - - return false; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/is.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/is.js deleted file mode 100644 index 581979fa..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/is.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = is; - -var _shallowEqual = require("../utils/shallowEqual"); - -var _isType = require("./isType"); - -var _isPlaceholderType = require("./isPlaceholderType"); - -var _definitions = require("../definitions"); - -function is(type, node, opts) { - if (!node) return false; - const matches = (0, _isType.default)(node.type, type); - - if (!matches) { - if (!opts && node.type === "Placeholder" && type in _definitions.FLIPPED_ALIAS_KEYS) { - return (0, _isPlaceholderType.default)(node.expectedNode, type); - } - - return false; - } - - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isBinding.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isBinding.js deleted file mode 100644 index 74c86dd0..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isBinding.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isBinding; - -var _getBindingIdentifiers = require("../retrievers/getBindingIdentifiers"); - -function isBinding(node, parent, grandparent) { - if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") { - return false; - } - - const keys = _getBindingIdentifiers.default.keys[parent.type]; - - if (keys) { - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const val = parent[key]; - - if (Array.isArray(val)) { - if (val.indexOf(node) >= 0) return true; - } else { - if (val === node) return true; - } - } - } - - return false; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isBlockScoped.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isBlockScoped.js deleted file mode 100644 index 77ec1663..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isBlockScoped.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isBlockScoped; - -var _generated = require("./generated"); - -var _isLet = require("./isLet"); - -function isBlockScoped(node) { - return (0, _generated.isFunctionDeclaration)(node) || (0, _generated.isClassDeclaration)(node) || (0, _isLet.default)(node); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isImmutable.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isImmutable.js deleted file mode 100644 index 27754f65..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isImmutable.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isImmutable; - -var _isType = require("./isType"); - -var _generated = require("./generated"); - -function isImmutable(node) { - if ((0, _isType.default)(node.type, "Immutable")) return true; - - if ((0, _generated.isIdentifier)(node)) { - if (node.name === "undefined") { - return true; - } else { - return false; - } - } - - return false; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isLet.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isLet.js deleted file mode 100644 index 93d75628..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isLet.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isLet; - -var _generated = require("./generated"); - -var _constants = require("../constants"); - -function isLet(node) { - return (0, _generated.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isNode.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isNode.js deleted file mode 100644 index e88a47aa..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isNode.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isNode; - -var _definitions = require("../definitions"); - -function isNode(node) { - return !!(node && _definitions.VISITOR_KEYS[node.type]); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isNodesEquivalent.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isNodesEquivalent.js deleted file mode 100644 index f829834e..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isNodesEquivalent; - -var _definitions = require("../definitions"); - -function isNodesEquivalent(a, b) { - if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) { - return a === b; - } - - if (a.type !== b.type) { - return false; - } - - const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type); - const visitorKeys = _definitions.VISITOR_KEYS[a.type]; - - for (const field of fields) { - if (typeof a[field] !== typeof b[field]) { - return false; - } - - if (a[field] == null && b[field] == null) { - continue; - } else if (a[field] == null || b[field] == null) { - return false; - } - - if (Array.isArray(a[field])) { - if (!Array.isArray(b[field])) { - return false; - } - - if (a[field].length !== b[field].length) { - return false; - } - - for (let i = 0; i < a[field].length; i++) { - if (!isNodesEquivalent(a[field][i], b[field][i])) { - return false; - } - } - - continue; - } - - if (typeof a[field] === "object" && !(visitorKeys != null && visitorKeys.includes(field))) { - for (const key of Object.keys(a[field])) { - if (a[field][key] !== b[field][key]) { - return false; - } - } - - continue; - } - - if (!isNodesEquivalent(a[field], b[field])) { - return false; - } - } - - return true; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isPlaceholderType.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isPlaceholderType.js deleted file mode 100644 index e8271de0..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isPlaceholderType.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isPlaceholderType; - -var _definitions = require("../definitions"); - -function isPlaceholderType(placeholderType, targetType) { - if (placeholderType === targetType) return true; - const aliases = _definitions.PLACEHOLDERS_ALIAS[placeholderType]; - - if (aliases) { - for (const alias of aliases) { - if (targetType === alias) return true; - } - } - - return false; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isReferenced.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isReferenced.js deleted file mode 100644 index dc94a693..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isReferenced.js +++ /dev/null @@ -1,127 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isReferenced; - -function isReferenced(node, parent, grandparent) { - switch (parent.type) { - case "MemberExpression": - case "OptionalMemberExpression": - if (parent.property === node) { - return !!parent.computed; - } - - return parent.object === node; - - case "JSXMemberExpression": - return parent.object === node; - - case "VariableDeclarator": - return parent.init === node; - - case "ArrowFunctionExpression": - return parent.body === node; - - case "PrivateName": - return false; - - case "ClassMethod": - case "ClassPrivateMethod": - case "ObjectMethod": - if (parent.key === node) { - return !!parent.computed; - } - - return false; - - case "ObjectProperty": - if (parent.key === node) { - return !!parent.computed; - } - - return !grandparent || grandparent.type !== "ObjectPattern"; - - case "ClassProperty": - if (parent.key === node) { - return !!parent.computed; - } - - return true; - - case "ClassPrivateProperty": - return parent.key !== node; - - case "ClassDeclaration": - case "ClassExpression": - return parent.superClass === node; - - case "AssignmentExpression": - return parent.right === node; - - case "AssignmentPattern": - return parent.right === node; - - case "LabeledStatement": - return false; - - case "CatchClause": - return false; - - case "RestElement": - return false; - - case "BreakStatement": - case "ContinueStatement": - return false; - - case "FunctionDeclaration": - case "FunctionExpression": - return false; - - case "ExportNamespaceSpecifier": - case "ExportDefaultSpecifier": - return false; - - case "ExportSpecifier": - if (grandparent != null && grandparent.source) { - return false; - } - - return parent.local === node; - - case "ImportDefaultSpecifier": - case "ImportNamespaceSpecifier": - case "ImportSpecifier": - return false; - - case "ImportAttribute": - return false; - - case "JSXAttribute": - return false; - - case "ObjectPattern": - case "ArrayPattern": - return false; - - case "MetaProperty": - return false; - - case "ObjectTypeProperty": - return parent.key !== node; - - case "TSEnumMember": - return parent.id !== node; - - case "TSPropertySignature": - if (parent.key === node) { - return !!parent.computed; - } - - return true; - } - - return true; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isScope.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isScope.js deleted file mode 100644 index 0f82449c..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isScope.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isScope; - -var _generated = require("./generated"); - -function isScope(node, parent) { - if ((0, _generated.isBlockStatement)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) { - return false; - } - - if ((0, _generated.isPattern)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) { - return true; - } - - return (0, _generated.isScopable)(node); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isSpecifierDefault.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isSpecifierDefault.js deleted file mode 100644 index 25431cc2..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isSpecifierDefault; - -var _generated = require("./generated"); - -function isSpecifierDefault(specifier) { - return (0, _generated.isImportDefaultSpecifier)(specifier) || (0, _generated.isIdentifier)(specifier.imported || specifier.exported, { - name: "default" - }); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isType.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isType.js deleted file mode 100644 index 59d31dfb..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isType.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isType; - -var _definitions = require("../definitions"); - -function isType(nodeType, targetType) { - if (nodeType === targetType) return true; - if (_definitions.ALIAS_KEYS[targetType]) return false; - const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType]; - - if (aliases) { - if (aliases[0] === nodeType) return true; - - for (const alias of aliases) { - if (nodeType === alias) return true; - } - } - - return false; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isValidES3Identifier.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isValidES3Identifier.js deleted file mode 100644 index 5cef5664..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isValidES3Identifier; - -var _isValidIdentifier = require("./isValidIdentifier"); - -const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]); - -function isValidES3Identifier(name) { - return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isValidIdentifier.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isValidIdentifier.js deleted file mode 100644 index 3fa6f980..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isValidIdentifier.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isValidIdentifier; - -var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); - -function isValidIdentifier(name, reserved = true) { - if (typeof name !== "string") return false; - - if (reserved) { - if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name, true)) { - return false; - } - } - - return (0, _helperValidatorIdentifier.isIdentifierName)(name); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isVar.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isVar.js deleted file mode 100644 index a34801d1..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/isVar.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isVar; - -var _generated = require("./generated"); - -var _constants = require("../constants"); - -function isVar(node) { - return (0, _generated.isVariableDeclaration)(node, { - kind: "var" - }) && !node[_constants.BLOCK_SCOPED_SYMBOL]; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/matchesPattern.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/matchesPattern.js deleted file mode 100644 index d961f5a6..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/matchesPattern.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = matchesPattern; - -var _generated = require("./generated"); - -function matchesPattern(member, match, allowPartial) { - if (!(0, _generated.isMemberExpression)(member)) return false; - const parts = Array.isArray(match) ? match : match.split("."); - const nodes = []; - let node; - - for (node = member; (0, _generated.isMemberExpression)(node); node = node.object) { - nodes.push(node.property); - } - - nodes.push(node); - if (nodes.length < parts.length) return false; - if (!allowPartial && nodes.length > parts.length) return false; - - for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) { - const node = nodes[j]; - let value; - - if ((0, _generated.isIdentifier)(node)) { - value = node.name; - } else if ((0, _generated.isStringLiteral)(node)) { - value = node.value; - } else if ((0, _generated.isThisExpression)(node)) { - value = "this"; - } else { - return false; - } - - if (parts[i] !== value) return false; - } - - return true; -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/react/isCompatTag.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/react/isCompatTag.js deleted file mode 100644 index 57761c2b..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/react/isCompatTag.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isCompatTag; - -function isCompatTag(tagName) { - return !!tagName && /^[a-z]/.test(tagName); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/react/isReactComponent.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/react/isReactComponent.js deleted file mode 100644 index 0dd21025..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/react/isReactComponent.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _buildMatchMemberExpression = require("../buildMatchMemberExpression"); - -const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component"); -var _default = isReactComponent; -exports.default = _default; \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/validate.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/validate.js deleted file mode 100644 index f5a2bef5..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/lib/validators/validate.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = validate; -exports.validateField = validateField; -exports.validateChild = validateChild; - -var _definitions = require("../definitions"); - -function validate(node, key, val) { - if (!node) return; - const fields = _definitions.NODE_FIELDS[node.type]; - if (!fields) return; - const field = fields[key]; - validateField(node, key, val, field); - validateChild(node, key, val); -} - -function validateField(node, key, val, field) { - if (!(field != null && field.validate)) return; - if (field.optional && val == null) return; - field.validate(node, key, val); -} - -function validateChild(node, key, val) { - if (val == null) return; - const validate = _definitions.NODE_PARENT_VALIDATIONS[val.type]; - if (!validate) return; - validate(node, key, val); -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/package.json b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/package.json deleted file mode 100644 index 202d4baa..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@babel/types", - "version": "7.15.6", - "description": "Babel Types is a Lodash-esque utility library for AST nodes", - "author": "The Babel Team (https://babel.dev/team)", - "homepage": "https://babel.dev/docs/en/next/babel-types", - "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-types" - }, - "main": "./lib/index.js", - "types": "./lib/index-legacy.d.ts", - "typesVersions": { - ">=3.7": { - "lib/index-legacy.d.ts": [ - "lib/index.d.ts" - ] - } - }, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.9", - "to-fast-properties": "^2.0.0" - }, - "devDependencies": { - "@babel/generator": "7.15.4", - "@babel/parser": "7.15.6", - "chalk": "^4.1.0", - "glob": "^7.1.7" - }, - "engines": { - "node": ">=6.9.0" - } -} \ No newline at end of file diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/asserts.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/asserts.js deleted file mode 100644 index bdfd9485..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/asserts.js +++ /dev/null @@ -1,50 +0,0 @@ -import definitions from "../../lib/definitions/index.js"; - -function addAssertHelper(type) { - const result = - definitions.NODE_FIELDS[type] || definitions.FLIPPED_ALIAS_KEYS[type] - ? `node is t.${type}` - : "boolean"; - - return `export function assert${type}(node: object | null | undefined, opts?: object | null): asserts ${ - result === "boolean" ? "node" : result - } { - assert("${type}", node, opts) } - `; -} - -export default function generateAsserts() { - let output = `/* - * This file is auto-generated! Do not modify it directly. - * To re-generate run 'make build' - */ -import is from "../../validators/is"; -import type * as t from "../.."; - -function assert(type: string, node: any, opts?: any): void { - if (!is(type, node, opts)) { - throw new Error( - \`Expected type "\${type}" with option \${JSON.stringify(opts)}, \` + - \`but instead got "\${node.type}".\`, - ); - } -}\n\n`; - - Object.keys(definitions.VISITOR_KEYS).forEach(type => { - output += addAssertHelper(type); - }); - - Object.keys(definitions.FLIPPED_ALIAS_KEYS).forEach(type => { - output += addAssertHelper(type); - }); - - Object.keys(definitions.DEPRECATED_KEYS).forEach(type => { - const newType = definitions.DEPRECATED_KEYS[type]; - output += `export function assert${type}(node: any, opts: any): void { - console.trace("The node type ${type} has been renamed to ${newType}"); - assert("${type}", node, opts); -}\n`; - }); - - return output; -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/ast-types.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/ast-types.js deleted file mode 100644 index cd31918a..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/ast-types.js +++ /dev/null @@ -1,139 +0,0 @@ -import t from "../../lib/index.js"; -import stringifyValidator from "../utils/stringifyValidator.js"; - -export default function generateAstTypes() { - let code = `// NOTE: This file is autogenerated. Do not modify. -// See packages/babel-types/scripts/generators/ast-types.js for script used. - -interface BaseComment { - value: string; - start: number; - end: number; - loc: SourceLocation; - type: "CommentBlock" | "CommentLine"; -} - -export interface CommentBlock extends BaseComment { - type: "CommentBlock"; -} - -export interface CommentLine extends BaseComment { - type: "CommentLine"; -} - -export type Comment = CommentBlock | CommentLine; - -export interface SourceLocation { - start: { - line: number; - column: number; - }; - - end: { - line: number; - column: number; - }; -} - -interface BaseNode { - leadingComments: ReadonlyArray | null; - innerComments: ReadonlyArray | null; - trailingComments: ReadonlyArray | null; - start: number | null; - end: number | null; - loc: SourceLocation | null; - type: Node["type"]; - range?: [number, number]; - extra?: Record; -} - -export type CommentTypeShorthand = "leading" | "inner" | "trailing"; - -export type Node = ${t.TYPES.sort().join(" | ")};\n\n`; - - const deprecatedAlias = {}; - for (const type in t.DEPRECATED_KEYS) { - deprecatedAlias[t.DEPRECATED_KEYS[type]] = type; - } - for (const type in t.NODE_FIELDS) { - const fields = t.NODE_FIELDS[type]; - const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type); - const struct = []; - - fieldNames.forEach(fieldName => { - const field = fields[fieldName]; - // Future / annoying TODO: - // MemberExpression.property, ObjectProperty.key and ObjectMethod.key need special cases; either: - // - convert the declaration to chain() like ClassProperty.key and ClassMethod.key, - // - declare an alias type for valid keys, detect the case and reuse it here, - // - declare a disjoint union with, for example, ObjectPropertyBase, - // ObjectPropertyLiteralKey and ObjectPropertyComputedKey, and declare ObjectProperty - // as "ObjectPropertyBase & (ObjectPropertyLiteralKey | ObjectPropertyComputedKey)" - let typeAnnotation = stringifyValidator(field.validate, ""); - - if (isNullable(field) && !hasDefault(field)) { - typeAnnotation += " | null"; - } - - const alphaNumeric = /^\w+$/; - const optional = field.optional ? "?" : ""; - - if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) { - struct.push(`${fieldName}${optional}: ${typeAnnotation};`); - } else { - struct.push(`"${fieldName}"${optional}: ${typeAnnotation};`); - } - }); - - code += `export interface ${type} extends BaseNode { - type: "${type}"; - ${struct.join("\n ").trim()} -}\n\n`; - - if (deprecatedAlias[type]) { - code += `/** - * @deprecated Use \`${type}\` - */ -export interface ${deprecatedAlias[type]} extends BaseNode { - type: "${deprecatedAlias[type]}"; - ${struct.join("\n ").trim()} -}\n\n -`; - } - } - - for (const type in t.FLIPPED_ALIAS_KEYS) { - const types = t.FLIPPED_ALIAS_KEYS[type]; - code += `export type ${type} = ${types - .map(type => `${type}`) - .join(" | ")};\n`; - } - code += "\n"; - - code += "export interface Aliases {\n"; - for (const type in t.FLIPPED_ALIAS_KEYS) { - code += ` ${type}: ${type};\n`; - } - code += "}\n\n"; - - return code; -} - -function hasDefault(field) { - return field.default != null; -} - -function isNullable(field) { - return field.optional || hasDefault(field); -} - -function sortFieldNames(fields, type) { - return fields.sort((fieldA, fieldB) => { - const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }); -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/builders.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/builders.js deleted file mode 100644 index 3a30e605..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/builders.js +++ /dev/null @@ -1,163 +0,0 @@ -import t from "../../lib/index.js"; -import definitions from "../../lib/definitions/index.js"; -import formatBuilderName from "../utils/formatBuilderName.js"; -import lowerFirst from "../utils/lowerFirst.js"; -import stringifyValidator from "../utils/stringifyValidator.js"; - -function areAllRemainingFieldsNullable(fieldName, fieldNames, fields) { - const index = fieldNames.indexOf(fieldName); - return fieldNames.slice(index).every(_ => isNullable(fields[_])); -} - -function hasDefault(field) { - return field.default != null; -} - -function isNullable(field) { - return field.optional || hasDefault(field); -} - -function sortFieldNames(fields, type) { - return fields.sort((fieldA, fieldB) => { - const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }); -} - -function generateBuilderArgs(type) { - const fields = t.NODE_FIELDS[type]; - const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type); - const builderNames = t.BUILDER_KEYS[type]; - - const args = []; - - fieldNames.forEach(fieldName => { - const field = fields[fieldName]; - // Future / annoying TODO: - // MemberExpression.property, ObjectProperty.key and ObjectMethod.key need special cases; either: - // - convert the declaration to chain() like ClassProperty.key and ClassMethod.key, - // - declare an alias type for valid keys, detect the case and reuse it here, - // - declare a disjoint union with, for example, ObjectPropertyBase, - // ObjectPropertyLiteralKey and ObjectPropertyComputedKey, and declare ObjectProperty - // as "ObjectPropertyBase & (ObjectPropertyLiteralKey | ObjectPropertyComputedKey)" - let typeAnnotation = stringifyValidator(field.validate, "t."); - - if (isNullable(field) && !hasDefault(field)) { - typeAnnotation += " | null"; - } - - if (builderNames.includes(fieldName)) { - const bindingIdentifierName = t.toBindingIdentifierName(fieldName); - if (areAllRemainingFieldsNullable(fieldName, builderNames, fields)) { - args.push( - `${bindingIdentifierName}${ - isNullable(field) ? "?:" : ":" - } ${typeAnnotation}` - ); - } else { - args.push( - `${bindingIdentifierName}: ${typeAnnotation}${ - isNullable(field) ? " | undefined" : "" - }` - ); - } - } - }); - - return args; -} - -export default function generateBuilders(kind) { - return kind === "uppercase.js" - ? generateUppercaseBuilders() - : generateLowercaseBuilders(); -} - -function generateLowercaseBuilders() { - let output = `/* - * This file is auto-generated! Do not modify it directly. - * To re-generate run 'make build' - */ -import builder from "../builder"; -import type * as t from "../.."; - -/* eslint-disable @typescript-eslint/no-unused-vars */ - -`; - - const reservedNames = new Set(["super", "import"]); - Object.keys(definitions.BUILDER_KEYS).forEach(type => { - const defArgs = generateBuilderArgs(type); - const formatedBuilderName = formatBuilderName(type); - const formatedBuilderNameLocal = reservedNames.has(formatedBuilderName) - ? `_${formatedBuilderName}` - : formatedBuilderName; - output += `${ - formatedBuilderNameLocal === formatedBuilderName ? "export " : "" - }function ${formatedBuilderNameLocal}(${defArgs.join( - ", " - )}): t.${type} { return builder("${type}", ...arguments); }\n`; - if (formatedBuilderNameLocal !== formatedBuilderName) { - output += `export { ${formatedBuilderNameLocal} as ${formatedBuilderName} };\n`; - } - - // This is needed for backwards compatibility. - // It should be removed in the next major version. - // JSXIdentifier -> jSXIdentifier - if (/^[A-Z]{2}/.test(type)) { - output += `export { ${formatedBuilderNameLocal} as ${lowerFirst( - type - )} }\n`; - } - }); - - Object.keys(definitions.DEPRECATED_KEYS).forEach(type => { - const newType = definitions.DEPRECATED_KEYS[type]; - const formatedBuilderName = formatBuilderName(type); - output += `/** @deprecated */ -function ${type}(...args: Array): any { - console.trace("The node type ${type} has been renamed to ${newType}"); - return builder("${type}", ...args); -} -export { ${type} as ${formatedBuilderName} };\n`; - // This is needed for backwards compatibility. - // It should be removed in the next major version. - // JSXIdentifier -> jSXIdentifier - if (/^[A-Z]{2}/.test(type)) { - output += `export { ${type} as ${lowerFirst(type)} }\n`; - } - }); - - return output; -} - -function generateUppercaseBuilders() { - let output = `/* - * This file is auto-generated! Do not modify it directly. - * To re-generate run 'make build' - */ - -/** - * This file is written in JavaScript and not TypeScript because uppercase builders - * conflict with AST types. TypeScript reads the uppercase.d.ts file instead. - */ - - export {\n`; - - Object.keys(definitions.BUILDER_KEYS).forEach(type => { - const formatedBuilderName = formatBuilderName(type); - output += ` ${formatedBuilderName} as ${type},\n`; - }); - - Object.keys(definitions.DEPRECATED_KEYS).forEach(type => { - const formatedBuilderName = formatBuilderName(type); - output += ` ${formatedBuilderName} as ${type},\n`; - }); - - output += ` } from './index';\n`; - return output; -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/constants.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/constants.js deleted file mode 100644 index 68abdbd8..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/constants.js +++ /dev/null @@ -1,15 +0,0 @@ -import definitions from "../../lib/definitions/index.js"; - -export default function generateConstants() { - let output = `/* - * This file is auto-generated! Do not modify it directly. - * To re-generate run 'make build' - */ -import { FLIPPED_ALIAS_KEYS } from "../../definitions";\n\n`; - - Object.keys(definitions.FLIPPED_ALIAS_KEYS).forEach(type => { - output += `export const ${type.toUpperCase()}_TYPES = FLIPPED_ALIAS_KEYS["${type}"];\n`; - }); - - return output; -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/docs.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/docs.js deleted file mode 100644 index f7b82e56..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/docs.js +++ /dev/null @@ -1,277 +0,0 @@ -import util from "util"; -import stringifyValidator from "../utils/stringifyValidator.js"; -import toFunctionName from "../utils/toFunctionName.js"; - -import t from "../../lib/index.js"; - -const readme = [ - `--- -id: babel-types -title: @babel/types ---- - - -> This module contains methods for building ASTs manually and for checking the types of AST nodes. - -## Install - -\`\`\`sh -npm install --save-dev @babel/types -\`\`\` - -## API`, -]; - -const customTypes = { - ClassMethod: { - key: "if computed then `Expression` else `Identifier | Literal`", - }, - Identifier: { - name: "`string`", - }, - MemberExpression: { - property: "if computed then `Expression` else `Identifier`", - }, - ObjectMethod: { - key: "if computed then `Expression` else `Identifier | Literal`", - }, - ObjectProperty: { - key: "if computed then `Expression` else `Identifier | Literal`", - }, - ClassPrivateMethod: { - computed: "'false'", - }, - ClassPrivateProperty: { - computed: "'false'", - }, -}; -const APIHistory = { - ClassProperty: [["v7.6.0", "Supports `static`"]], -}; -function formatHistory(historyItems) { - const lines = historyItems.map( - item => "| `" + item[0] + "` | " + item[1] + " |" - ); - return [ - "

", - " History", - "| Version | Changes |", - "| --- | --- |", - ...lines, - "
", - ]; -} -function printAPIHistory(key, readme) { - if (APIHistory[key]) { - readme.push(""); - readme.push(...formatHistory(APIHistory[key])); - } -} -function printNodeFields(key, readme) { - if (Object.keys(t.NODE_FIELDS[key]).length > 0) { - readme.push(""); - readme.push("AST Node `" + key + "` shape:"); - Object.keys(t.NODE_FIELDS[key]) - .sort(function (fieldA, fieldB) { - const indexA = t.BUILDER_KEYS[key].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[key].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }) - .forEach(function (field) { - const defaultValue = t.NODE_FIELDS[key][field].default; - const fieldDescription = ["`" + field + "`"]; - const validator = t.NODE_FIELDS[key][field].validate; - if (customTypes[key] && customTypes[key][field]) { - fieldDescription.push(`: ${customTypes[key][field]}`); - } else if (validator) { - try { - fieldDescription.push( - ": `" + stringifyValidator(validator, "") + "`" - ); - } catch (ex) { - if (ex.code === "UNEXPECTED_VALIDATOR_TYPE") { - console.log( - "Unrecognised validator type for " + key + "." + field - ); - console.dir(ex.validator, { depth: 10, colors: true }); - } - } - } - if (defaultValue !== null || t.NODE_FIELDS[key][field].optional) { - fieldDescription.push( - " (default: `" + util.inspect(defaultValue) + "`" - ); - if (t.BUILDER_KEYS[key].indexOf(field) < 0) { - fieldDescription.push(", excluded from builder function"); - } - fieldDescription.push(")"); - } else { - fieldDescription.push(" (required)"); - } - readme.push("- " + fieldDescription.join("")); - }); - } -} - -function printAliasKeys(key, readme) { - if (t.ALIAS_KEYS[key] && t.ALIAS_KEYS[key].length) { - readme.push(""); - readme.push( - "Aliases: " + - t.ALIAS_KEYS[key] - .map(function (key) { - return "[`" + key + "`](#" + key.toLowerCase() + ")"; - }) - .join(", ") - ); - } -} -readme.push("### Node Builders"); -readme.push(""); -Object.keys(t.BUILDER_KEYS) - .sort() - .forEach(function (key) { - readme.push("#### " + toFunctionName(key)); - readme.push(""); - readme.push("```javascript"); - readme.push( - "t." + toFunctionName(key) + "(" + t.BUILDER_KEYS[key].join(", ") + ");" - ); - readme.push("```"); - printAPIHistory(key, readme); - readme.push(""); - readme.push( - "See also `t.is" + - key + - "(node, opts)` and `t.assert" + - key + - "(node, opts)`." - ); - - printNodeFields(key, readme); - printAliasKeys(key, readme); - - readme.push(""); - readme.push("---"); - readme.push(""); - }); - -function generateMapAliasToNodeTypes() { - const result = new Map(); - for (const nodeType of Object.keys(t.ALIAS_KEYS)) { - const aliases = t.ALIAS_KEYS[nodeType]; - if (!aliases) continue; - for (const alias of aliases) { - if (!result.has(alias)) { - result.set(alias, []); - } - const nodeTypes = result.get(alias); - nodeTypes.push(nodeType); - } - } - return result; -} -const aliasDescriptions = { - Binary: - "A cover of BinaryExpression and LogicalExpression, which share the same AST shape.", - Block: "Deprecated. Will be removed in Babel 8.", - BlockParent: - "A cover of AST nodes that start an execution context with new [LexicalEnvironment](https://tc39.es/ecma262/#table-additional-state-components-for-ecmascript-code-execution-contexts). In other words, they define the scope of `let` and `const` declarations.", - Class: - "A cover of ClassExpression and ClassDeclaration, which share the same AST shape.", - CompletionStatement: - "A statement that indicates the [completion records](https://tc39.es/ecma262/#sec-completion-record-specification-type). In other words, they define the control flow of the program, such as when should a loop break or an action throws critical errors.", - Conditional: - "A cover of ConditionalExpression and IfStatement, which share the same AST shape.", - Declaration: - "A cover of any [Declaration](https://tc39.es/ecma262/#prod-Declaration)s.", - EnumBody: "A cover of Flow enum bodies.", - EnumMember: "A cover of Flow enum membors.", - ExportDeclaration: - "A cover of any [ExportDeclaration](https://tc39.es/ecma262/#prod-ExportDeclaration)s.", - Expression: - "A cover of any [Expression](https://tc39.es/ecma262/#sec-ecmascript-language-expressions)s.", - ExpressionWrapper: - "A wrapper of expression that does not have runtime semantics.", - Flow: "A cover of AST nodes defined for Flow.", - FlowBaseAnnotation: "A cover of primary Flow type annotations.", - FlowDeclaration: "A cover of Flow declarations.", - FlowPredicate: "A cover of Flow predicates.", - FlowType: "A cover of Flow type annotations.", - For: "A cover of [ForStatement](https://tc39.es/ecma262/#sec-for-statement)s and [ForXStatement](#forxstatement)s.", - ForXStatement: - "A cover of [ForInStatements and ForOfStatements](https://tc39.es/ecma262/#sec-for-in-and-for-of-statements).", - Function: - "A cover of functions and [method](#method)s, the must have `body` and `params`. Note: `Function` is different to `FunctionParent`.", - FunctionParent: - "A cover of AST nodes that start an execution context with new [VariableEnvironment](https://tc39.es/ecma262/#table-additional-state-components-for-ecmascript-code-execution-contexts). In other words, they define the scope of `var` declarations. FunctionParent did not include `Program` since Babel 7.", - Immutable: - "A cover of immutable objects and JSX elements. An object is [immutable](https://tc39.es/ecma262/#immutable-prototype-exotic-object) if no other properties can be defined once created.", - JSX: "A cover of AST nodes defined for [JSX](https://facebook.github.io/jsx/).", - LVal: "A cover of left hand side expressions used in the `left` of assignment expressions and [ForXStatement](#forxstatement)s. ", - Literal: - "A cover of [Literal](https://tc39.es/ecma262/#sec-primary-expression-literals)s, [Regular Expression Literal](https://tc39.es/ecma262/#sec-primary-expression-regular-expression-literals)s and [Template Literal](https://tc39.es/ecma262/#sec-template-literals)s.", - Loop: "A cover of loop statements.", - Method: "A cover of object methods and class methods.", - ModuleDeclaration: - "A cover of ImportDeclaration and [ExportDeclaration](#exportdeclaration)", - ModuleSpecifier: - "A cover of import and export specifiers. Note: It is _not_ the [ModuleSpecifier](https://tc39.es/ecma262/#prod-ModuleSpecifier) defined in the spec.", - ObjectMember: - "A cover of [members](https://tc39.es/ecma262/#prod-PropertyDefinitionList) in an object literal.", - Pattern: - "A cover of [BindingPattern](https://tc39.es/ecma262/#prod-BindingPattern) except Identifiers.", - PatternLike: - "A cover of [BindingPattern](https://tc39.es/ecma262/#prod-BindingPattern)s. ", - Private: "A cover of private class elements and private identifiers.", - Property: "A cover of object properties and class properties.", - Pureish: - "A cover of AST nodes which do not have side-effects. In other words, there is no observable behaviour changes if they are evaluated more than once.", - Scopable: - "A cover of [FunctionParent](#functionparent) and [BlockParent](#blockparent).", - Statement: - "A cover of any [Statement](https://tc39.es/ecma262/#prod-Statement)s.", - TSBaseType: "A cover of primary TypeScript type annotations.", - TSEntityName: "A cover of ts entities.", - TSType: "A cover of TypeScript type annotations.", - TSTypeElement: "A cover of TypeScript type declarations.", - Terminatorless: - "A cover of AST nodes whose semantic will change when a line terminator is inserted between the operator and the operand.", - UnaryLike: "A cover of UnaryExpression and SpreadElement.", - UserWhitespacable: "Deprecated. Will be removed in Babel 8.", - While: - "A cover of DoWhileStatement and WhileStatement, which share the same AST shape.", -}; -const mapAliasToNodeTypes = generateMapAliasToNodeTypes(); -readme.push("### Aliases"); -readme.push(""); -for (const alias of [...mapAliasToNodeTypes.keys()].sort()) { - const nodeTypes = mapAliasToNodeTypes.get(alias); - nodeTypes.sort(); - if (!(alias in aliasDescriptions)) { - throw new Error( - 'Missing alias descriptions of "' + - alias + - ", which covers " + - nodeTypes.join(",") - ); - } - readme.push("#### " + alias); - readme.push(""); - readme.push(aliasDescriptions[alias]); - readme.push("```javascript"); - readme.push("t.is" + alias + "(node);"); - readme.push("```"); - readme.push(""); - readme.push("Covered nodes: "); - for (const nodeType of nodeTypes) { - readme.push("- [`" + nodeType + "`](#" + nodeType.toLowerCase() + ")"); - } - readme.push(""); -} - -process.stdout.write(readme.join("\n")); diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/flow.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/flow.js deleted file mode 100644 index 7fabcc67..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/flow.js +++ /dev/null @@ -1,260 +0,0 @@ -import t from "../../lib/index.js"; -import stringifyValidator from "../utils/stringifyValidator.js"; -import toFunctionName from "../utils/toFunctionName.js"; - -const NODE_PREFIX = "BabelNode"; - -let code = `// NOTE: This file is autogenerated. Do not modify. -// See packages/babel-types/scripts/generators/flow.js for script used. - -declare class ${NODE_PREFIX}Comment { - value: string; - start: number; - end: number; - loc: ${NODE_PREFIX}SourceLocation; -} - -declare class ${NODE_PREFIX}CommentBlock extends ${NODE_PREFIX}Comment { - type: "CommentBlock"; -} - -declare class ${NODE_PREFIX}CommentLine extends ${NODE_PREFIX}Comment { - type: "CommentLine"; -} - -declare class ${NODE_PREFIX}SourceLocation { - start: { - line: number; - column: number; - }; - - end: { - line: number; - column: number; - }; -} - -declare class ${NODE_PREFIX} { - leadingComments?: Array<${NODE_PREFIX}Comment>; - innerComments?: Array<${NODE_PREFIX}Comment>; - trailingComments?: Array<${NODE_PREFIX}Comment>; - start: ?number; - end: ?number; - loc: ?${NODE_PREFIX}SourceLocation; - extra?: { [string]: mixed }; -}\n\n`; - -// - -const lines = []; - -for (const type in t.NODE_FIELDS) { - const fields = t.NODE_FIELDS[type]; - - const struct = ['type: "' + type + '";']; - const args = []; - const builderNames = t.BUILDER_KEYS[type]; - - Object.keys(t.NODE_FIELDS[type]) - .sort((fieldA, fieldB) => { - const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }) - .forEach(fieldName => { - const field = fields[fieldName]; - - let suffix = ""; - if (field.optional || field.default != null) suffix += "?"; - - let typeAnnotation = "any"; - - const validate = field.validate; - if (validate) { - typeAnnotation = stringifyValidator(validate, NODE_PREFIX); - } - - if (typeAnnotation) { - suffix += ": " + typeAnnotation; - } - if (builderNames.includes(fieldName)) { - args.push(t.toBindingIdentifierName(fieldName) + suffix); - } - - if (t.isValidIdentifier(fieldName)) { - struct.push(fieldName + suffix + ";"); - } - }); - - code += `declare class ${NODE_PREFIX}${type} extends ${NODE_PREFIX} { - ${struct.join("\n ").trim()} -}\n\n`; - - // Flow chokes on super() and import() :/ - if (type !== "Super" && type !== "Import") { - lines.push( - `declare export function ${toFunctionName(type)}(${args.join( - ", " - )}): ${NODE_PREFIX}${type};` - ); - } else { - const functionName = toFunctionName(type); - lines.push( - `declare function _${functionName}(${args.join( - ", " - )}): ${NODE_PREFIX}${type};`, - `declare export { _${functionName} as ${functionName} }` - ); - } -} - -for (const typeName of t.TYPES) { - const isDeprecated = !!t.DEPRECATED_KEYS[typeName]; - const realName = isDeprecated ? t.DEPRECATED_KEYS[typeName] : typeName; - - let decl = `declare export function is${typeName}(node: ?Object, opts?: ?Object): boolean`; - if (t.NODE_FIELDS[realName]) { - decl += ` %checks (node instanceof ${NODE_PREFIX}${realName})`; - } - lines.push(decl); - - lines.push( - `declare export function assert${typeName}(node: ?Object, opts?: ?Object): void` - ); -} - -lines.push( - `declare export var VISITOR_KEYS: { [type: string]: string[] }`, - - // assert/ - `declare export function assertNode(obj: any): void`, - - // builders/ - // eslint-disable-next-line max-len - `declare export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): ${NODE_PREFIX}TypeAnnotation`, - // eslint-disable-next-line max-len - `declare export function createUnionTypeAnnotation(types: Array<${NODE_PREFIX}FlowType>): ${NODE_PREFIX}UnionTypeAnnotation`, - // eslint-disable-next-line max-len - `declare export function createFlowUnionType(types: Array<${NODE_PREFIX}FlowType>): ${NODE_PREFIX}UnionTypeAnnotation`, - // this smells like "internal API" - // eslint-disable-next-line max-len - `declare export function buildChildren(node: { children: Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment | ${NODE_PREFIX}JSXEmptyExpression> }): Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment>`, - - // clone/ - `declare export function clone(n: T): T;`, - `declare export function cloneDeep(n: T): T;`, - `declare export function cloneDeepWithoutLoc(n: T): T;`, - `declare export function cloneNode(n: T, deep?: boolean, withoutLoc?: boolean): T;`, - `declare export function cloneWithoutLoc(n: T): T;`, - - // comments/ - `declare type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`, - // eslint-disable-next-line max-len - `declare export function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`, - // eslint-disable-next-line max-len - `declare export function addComments(node: T, type: CommentTypeShorthand, comments: Array): T`, - `declare export function inheritInnerComments(node: BabelNode, parent: BabelNode): void`, - `declare export function inheritLeadingComments(node: BabelNode, parent: BabelNode): void`, - `declare export function inheritsComments(node: T, parent: BabelNode): void`, - `declare export function inheritTrailingComments(node: BabelNode, parent: BabelNode): void`, - `declare export function removeComments(node: T): T`, - - // converters/ - `declare export function ensureBlock(node: ${NODE_PREFIX}, key: string): ${NODE_PREFIX}BlockStatement`, - `declare export function toBindingIdentifierName(name?: ?string): string`, - // eslint-disable-next-line max-len - `declare export function toBlock(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Expression, parent?: ${NODE_PREFIX}Function | null): ${NODE_PREFIX}BlockStatement`, - // eslint-disable-next-line max-len - `declare export function toComputedKey(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}Expression | ${NODE_PREFIX}Identifier): ${NODE_PREFIX}Expression`, - // eslint-disable-next-line max-len - `declare export function toExpression(node: ${NODE_PREFIX}ExpressionStatement | ${NODE_PREFIX}Expression | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function): ${NODE_PREFIX}Expression`, - `declare export function toIdentifier(name?: ?string): string`, - // eslint-disable-next-line max-len - `declare export function toKeyAlias(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}): string`, - // toSequenceExpression relies on types that aren't declared in flow - // eslint-disable-next-line max-len - `declare export function toStatement(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function | ${NODE_PREFIX}AssignmentExpression, ignore?: boolean): ${NODE_PREFIX}Statement | void`, - `declare export function valueToNode(value: any): ${NODE_PREFIX}Expression`, - - // modifications/ - // eslint-disable-next-line max-len - `declare export function removeTypeDuplicates(types: Array<${NODE_PREFIX}FlowType>): Array<${NODE_PREFIX}FlowType>`, - // eslint-disable-next-line max-len - `declare export function appendToMemberExpression(member: ${NODE_PREFIX}MemberExpression, append: ${NODE_PREFIX}, computed?: boolean): ${NODE_PREFIX}MemberExpression`, - // eslint-disable-next-line max-len - `declare export function inherits(child: T, parent: ${NODE_PREFIX} | null | void): T`, - // eslint-disable-next-line max-len - `declare export function prependToMemberExpression(member: ${NODE_PREFIX}MemberExpression, prepend: ${NODE_PREFIX}Expression): ${NODE_PREFIX}MemberExpression`, - `declare export function removeProperties(n: T, opts: ?{}): void;`, - `declare export function removePropertiesDeep(n: T, opts: ?{}): T;`, - - // retrievers/ - // eslint-disable-next-line max-len - `declare export var getBindingIdentifiers: { - (node: ${NODE_PREFIX}, duplicates?: boolean, outerOnly?: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> }, - keys: { [type: string]: string[] } - }`, - // eslint-disable-next-line max-len - `declare export function getOuterBindingIdentifiers(node: BabelNode, duplicates?: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> }`, - - // traverse/ - `declare type TraversalAncestors = Array<{ - node: BabelNode, - key: string, - index?: number, - }>; - declare type TraversalHandler = (BabelNode, TraversalAncestors, T) => void; - declare type TraversalHandlers = { - enter?: TraversalHandler, - exit?: TraversalHandler, - };`.replace(/(^|\n) {2}/g, "$1"), - // eslint-disable-next-line - `declare export function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void;`, - `declare export function traverseFast(n: BabelNode, h: TraversalHandler, state?: T): void;`, - - // utils/ - // cleanJSXElementLiteralChild is not exported - // inherit is not exported - `declare export function shallowEqual(actual: Object, expected: Object): boolean`, - - // validators/ - // eslint-disable-next-line max-len - `declare export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (?BabelNode) => boolean`, - `declare export function is(type: string, n: BabelNode, opts: Object): boolean;`, - `declare export function isBinding(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, - `declare export function isBlockScoped(node: BabelNode): boolean`, - `declare export function isImmutable(node: BabelNode): boolean`, - `declare export function isLet(node: BabelNode): boolean`, - `declare export function isNode(node: ?Object): boolean`, - `declare export function isNodesEquivalent(a: any, b: any): boolean`, - `declare export function isPlaceholderType(placeholderType: string, targetType: string): boolean`, - `declare export function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, - `declare export function isScope(node: BabelNode, parent: BabelNode): boolean`, - `declare export function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean`, - `declare export function isType(nodetype: ?string, targetType: string): boolean`, - `declare export function isValidES3Identifier(name: string): boolean`, - `declare export function isValidES3Identifier(name: string): boolean`, - `declare export function isValidIdentifier(name: string): boolean`, - `declare export function isVar(node: BabelNode): boolean`, - // eslint-disable-next-line max-len - `declare export function matchesPattern(node: ?BabelNode, match: string | Array, allowPartial?: boolean): boolean`, - `declare export function validate(n: BabelNode, key: string, value: mixed): void;` -); - -for (const type in t.FLIPPED_ALIAS_KEYS) { - const types = t.FLIPPED_ALIAS_KEYS[type]; - code += `type ${NODE_PREFIX}${type} = ${types - .map(type => `${NODE_PREFIX}${type}`) - .join(" | ")};\n`; -} - -code += `\ndeclare module "@babel/types" { - ${lines.join("\n").replace(/\n/g, "\n ").trim()} -}\n`; - -// - -process.stdout.write(code); diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/typescript-legacy.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/typescript-legacy.js deleted file mode 100644 index 40da48f4..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/typescript-legacy.js +++ /dev/null @@ -1,369 +0,0 @@ -import t from "../../lib/index.js"; -import stringifyValidator from "../utils/stringifyValidator.js"; -import toFunctionName from "../utils/toFunctionName.js"; - -let code = `// NOTE: This file is autogenerated. Do not modify. -// See packages/babel-types/scripts/generators/typescript-legacy.js for script used. - -interface BaseComment { - value: string; - start: number; - end: number; - loc: SourceLocation; - type: "CommentBlock" | "CommentLine"; -} - -export interface CommentBlock extends BaseComment { - type: "CommentBlock"; -} - -export interface CommentLine extends BaseComment { - type: "CommentLine"; -} - -export type Comment = CommentBlock | CommentLine; - -export interface SourceLocation { - start: { - line: number; - column: number; - }; - - end: { - line: number; - column: number; - }; -} - -interface BaseNode { - leadingComments: ReadonlyArray | null; - innerComments: ReadonlyArray | null; - trailingComments: ReadonlyArray | null; - start: number | null; - end: number | null; - loc: SourceLocation | null; - type: Node["type"]; - extra?: Record; -} - -export type Node = ${t.TYPES.sort().join(" | ")};\n\n`; - -// - -const lines = []; - -for (const type in t.NODE_FIELDS) { - const fields = t.NODE_FIELDS[type]; - const fieldNames = sortFieldNames(Object.keys(t.NODE_FIELDS[type]), type); - const builderNames = t.BUILDER_KEYS[type]; - - const struct = ['type: "' + type + '";']; - const args = []; - - fieldNames.forEach(fieldName => { - const field = fields[fieldName]; - // Future / annoying TODO: - // MemberExpression.property, ObjectProperty.key and ObjectMethod.key need special cases; either: - // - convert the declaration to chain() like ClassProperty.key and ClassMethod.key, - // - declare an alias type for valid keys, detect the case and reuse it here, - // - declare a disjoint union with, for example, ObjectPropertyBase, - // ObjectPropertyLiteralKey and ObjectPropertyComputedKey, and declare ObjectProperty - // as "ObjectPropertyBase & (ObjectPropertyLiteralKey | ObjectPropertyComputedKey)" - let typeAnnotation = stringifyValidator(field.validate, ""); - - if (isNullable(field) && !hasDefault(field)) { - typeAnnotation += " | null"; - } - - if (builderNames.includes(fieldName)) { - if (areAllRemainingFieldsNullable(fieldName, builderNames, fields)) { - args.push( - `${t.toBindingIdentifierName(fieldName)}${ - isNullable(field) ? "?:" : ":" - } ${typeAnnotation}` - ); - } else { - args.push( - `${t.toBindingIdentifierName(fieldName)}: ${typeAnnotation}${ - isNullable(field) ? " | undefined" : "" - }` - ); - } - } - - const alphaNumeric = /^\w+$/; - - if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) { - struct.push(`${fieldName}: ${typeAnnotation};`); - } else { - struct.push(`"${fieldName}": ${typeAnnotation};`); - } - }); - - code += `export interface ${type} extends BaseNode { - ${struct.join("\n ").trim()} -}\n\n`; - - // super and import are reserved words in JavaScript - if (type !== "Super" && type !== "Import") { - lines.push( - `export function ${toFunctionName(type)}(${args.join(", ")}): ${type};` - ); - } else { - const functionName = toFunctionName(type); - lines.push( - `declare function _${functionName}(${args.join(", ")}): ${type};`, - `export { _${functionName} as ${functionName}}` - ); - } -} - -for (const typeName of t.TYPES) { - const isDeprecated = !!t.DEPRECATED_KEYS[typeName]; - const realName = isDeprecated ? t.DEPRECATED_KEYS[typeName] : typeName; - - const result = - t.NODE_FIELDS[realName] || t.FLIPPED_ALIAS_KEYS[realName] - ? `node is ${realName}` - : "boolean"; - - if (isDeprecated) { - lines.push(`/** @deprecated Use \`is${realName}\` */`); - } - lines.push( - `export function is${typeName}(node: object | null | undefined, opts?: object | null): ${result};` - ); - - if (isDeprecated) { - lines.push(`/** @deprecated Use \`assert${realName}\` */`); - } - lines.push( - `export function assert${typeName}(node: object | null | undefined, opts?: object | null): void;` - ); -} - -lines.push( - // assert/ - `export function assertNode(obj: any): void`, - - // builders/ - // eslint-disable-next-line max-len - `export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): StringTypeAnnotation | VoidTypeAnnotation | NumberTypeAnnotation | BooleanTypeAnnotation | GenericTypeAnnotation`, - `export function createUnionTypeAnnotation(types: [T]): T`, - `export function createFlowUnionType(types: [T]): T`, - // this probably misbehaves if there are 0 elements, and it's not a UnionTypeAnnotation if there's only 1 - // it is possible to require "2 or more" for this overload ([T, T, ...T[]]) but it requires typescript 3.0 - `export function createUnionTypeAnnotation(types: ReadonlyArray): UnionTypeAnnotation`, - `export function createFlowUnionType(types: ReadonlyArray): UnionTypeAnnotation`, - // this smells like "internal API" - // eslint-disable-next-line max-len - `export function buildChildren(node: { children: ReadonlyArray }): JSXElement['children']`, - - // clone/ - `export function clone(n: T): T;`, - `export function cloneDeep(n: T): T;`, - `export function cloneDeepWithoutLoc(n: T): T;`, - `export function cloneNode(n: T, deep?: boolean, withoutLoc?: boolean): T;`, - `export function cloneWithoutLoc(n: T): T;`, - - // comments/ - `export type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`, - // eslint-disable-next-line max-len - `export function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`, - // eslint-disable-next-line max-len - `export function addComments(node: T, type: CommentTypeShorthand, comments: ReadonlyArray): T`, - `export function inheritInnerComments(node: Node, parent: Node): void`, - `export function inheritLeadingComments(node: Node, parent: Node): void`, - `export function inheritsComments(node: T, parent: Node): void`, - `export function inheritTrailingComments(node: Node, parent: Node): void`, - `export function removeComments(node: T): T`, - - // converters/ - // eslint-disable-next-line max-len - `export function ensureBlock(node: Extract): BlockStatement`, - // too complex? - // eslint-disable-next-line max-len - `export function ensureBlock = 'body'>(node: Extract>, key: K): BlockStatement`, - // gatherSequenceExpressions is not exported - `export function toBindingIdentifierName(name: { toString(): string } | null | undefined): string`, - `export function toBlock(node: Statement | Expression, parent?: Function | null): BlockStatement`, - // it is possible for `node` to be an arbitrary object if `key` is always provided, - // but that doesn't look like intended API - // eslint-disable-next-line max-len - `export function toComputedKey>(node: T, key?: Expression | Identifier): Expression`, - `export function toExpression(node: Function): FunctionExpression`, - `export function toExpression(node: Class): ClassExpression`, - `export function toExpression(node: ExpressionStatement | Expression | Class | Function): Expression`, - `export function toIdentifier(name: { toString(): string } | null | undefined): string`, - `export function toKeyAlias(node: Method | Property, key?: Node): string`, - // NOTE: this actually uses Scope from @babel/traverse, but we can't add a dependency on its types, - // as they live in @types. Declare the structural subset that is required. - // eslint-disable-next-line max-len - `export function toSequenceExpression(nodes: ReadonlyArray, scope: { push(value: { id: LVal; kind: 'var'; init?: Expression}): void; buildUndefinedNode(): Node }): SequenceExpression | undefined`, - `export function toStatement(node: AssignmentExpression, ignore?: boolean): ExpressionStatement`, - `export function toStatement(node: Statement | AssignmentExpression, ignore?: boolean): Statement`, - `export function toStatement(node: Class, ignore: true): ClassDeclaration | undefined`, - `export function toStatement(node: Class, ignore?: boolean): ClassDeclaration`, - `export function toStatement(node: Function, ignore: true): FunctionDeclaration | undefined`, - `export function toStatement(node: Function, ignore?: boolean): FunctionDeclaration`, - // eslint-disable-next-line max-len - `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore: true): Statement | undefined`, - // eslint-disable-next-line max-len - `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore?: boolean): Statement`, - // eslint-disable-next-line max-len - `export function valueToNode(value: undefined): Identifier`, // (should this not be a UnaryExpression to avoid shadowing?) - `export function valueToNode(value: boolean): BooleanLiteral`, - `export function valueToNode(value: null): NullLiteral`, - `export function valueToNode(value: string): StringLiteral`, - // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression - `export function valueToNode(value: number): NumericLiteral | BinaryExpression | UnaryExpression`, - `export function valueToNode(value: RegExp): RegExpLiteral`, - // eslint-disable-next-line max-len - `export function valueToNode(value: ReadonlyArray): ArrayExpression`, - // this throws with objects that are not PlainObject according to lodash, - // or if there are non-valueToNode-able values - `export function valueToNode(value: object): ObjectExpression`, - // eslint-disable-next-line max-len - `export function valueToNode(value: undefined | boolean | null | string | number | RegExp | object): Expression`, - - // modifications/ - // eslint-disable-next-line max-len - `export function removeTypeDuplicates(types: ReadonlyArray): FlowType[]`, - // eslint-disable-next-line max-len - `export function appendToMemberExpression>(member: T, append: MemberExpression['property'], computed?: boolean): T`, - // eslint-disable-next-line max-len - `export function inherits(child: T, parent: Node | null | undefined): T`, - // eslint-disable-next-line max-len - `export function prependToMemberExpression>(member: T, prepend: MemberExpression['object']): T`, - `export function removeProperties( - n: Node, - opts?: { preserveComments: boolean } | null -): void;`, - `export function removePropertiesDeep( - n: T, - opts?: { preserveComments: boolean } | null -): T;`, - - // retrievers/ - // eslint-disable-next-line max-len - `export function getBindingIdentifiers(node: Node, duplicates: true, outerOnly?: boolean): Record>`, - // eslint-disable-next-line max-len - `export function getBindingIdentifiers(node: Node, duplicates?: false, outerOnly?: boolean): Record`, - // eslint-disable-next-line max-len - `export function getBindingIdentifiers(node: Node, duplicates: boolean, outerOnly?: boolean): Record>`, - // eslint-disable-next-line max-len - `export function getOuterBindingIdentifiers(node: Node, duplicates: true): Record>`, - `export function getOuterBindingIdentifiers(node: Node, duplicates?: false): Record`, - // eslint-disable-next-line max-len - `export function getOuterBindingIdentifiers(node: Node, duplicates: boolean): Record>`, - - // traverse/ - `export type TraversalAncestors = ReadonlyArray<{ - node: Node, - key: string, - index?: number, - }>; - export type TraversalHandler = ( - this: undefined, node: Node, parent: TraversalAncestors, type: T - ) => void; - export type TraversalHandlers = { - enter?: TraversalHandler, - exit?: TraversalHandler, - };`.replace(/(^|\n) {2}/g, "$1"), - // eslint-disable-next-line - `export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void;`, - `export function traverseFast(n: Node, h: TraversalHandler, state?: T): void;`, - - // utils/ - // cleanJSXElementLiteralChild is not exported - // inherit is not exported - `export function shallowEqual(actual: object, expected: T): actual is T`, - - // validators/ - // eslint-disable-next-line max-len - `export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (node: Node | null | undefined) => node is MemberExpression`, - // eslint-disable-next-line max-len - `export function is(type: T, n: Node | null | undefined, required?: undefined): n is Extract`, - // eslint-disable-next-line max-len - `export function is>(type: T, n: Node | null | undefined, required: Partial

): n is P`, - // eslint-disable-next-line max-len - `export function is

(type: string, n: Node | null | undefined, required: Partial

): n is P`, - `export function is(type: string, n: Node | null | undefined, required?: Partial): n is Node`, - `export function isBinding(node: Node, parent: Node, grandparent?: Node): boolean`, - // eslint-disable-next-line max-len - `export function isBlockScoped(node: Node): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration`, - `export function isImmutable(node: Node): node is Immutable`, - `export function isLet(node: Node): node is VariableDeclaration`, - `export function isNode(node: object | null | undefined): node is Node`, - `export function isNodesEquivalent>(a: T, b: any): b is T`, - `export function isNodesEquivalent(a: any, b: any): boolean`, - `export function isPlaceholderType(placeholderType: Node['type'], targetType: Node['type']): boolean`, - `export function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean`, - `export function isScope(node: Node, parent: Node): node is Scopable`, - `export function isSpecifierDefault(specifier: ModuleSpecifier): boolean`, - `export function isType(nodetype: string, targetType: T): nodetype is T`, - `export function isType(nodetype: string | null | undefined, targetType: string): boolean`, - `export function isValidES3Identifier(name: string): boolean`, - `export function isValidIdentifier(name: string): boolean`, - `export function isVar(node: Node): node is VariableDeclaration`, - // the MemberExpression implication is incidental, but it follows from the implementation - // eslint-disable-next-line max-len - `export function matchesPattern(node: Node | null | undefined, match: string | ReadonlyArray, allowPartial?: boolean): node is MemberExpression`, - // eslint-disable-next-line max-len - `export function validate(n: Node | null | undefined, key: K, value: T[K]): void;`, - `export function validate(n: Node, key: string, value: any): void;` -); - -for (const type in t.DEPRECATED_KEYS) { - code += `/** - * @deprecated Use \`${t.DEPRECATED_KEYS[type]}\` - */ -export type ${type} = ${t.DEPRECATED_KEYS[type]};\n -`; -} - -for (const type in t.FLIPPED_ALIAS_KEYS) { - const types = t.FLIPPED_ALIAS_KEYS[type]; - code += `export type ${type} = ${types - .map(type => `${type}`) - .join(" | ")};\n`; -} -code += "\n"; - -code += "export interface Aliases {\n"; -for (const type in t.FLIPPED_ALIAS_KEYS) { - code += ` ${type}: ${type};\n`; -} -code += "}\n\n"; - -code += lines.join("\n") + "\n"; - -// - -process.stdout.write(code); - -// - -function areAllRemainingFieldsNullable(fieldName, fieldNames, fields) { - const index = fieldNames.indexOf(fieldName); - return fieldNames.slice(index).every(_ => isNullable(fields[_])); -} - -function hasDefault(field) { - return field.default != null; -} - -function isNullable(field) { - return field.optional || hasDefault(field); -} - -function sortFieldNames(fields, type) { - return fields.sort((fieldA, fieldB) => { - const indexA = t.BUILDER_KEYS[type].indexOf(fieldA); - const indexB = t.BUILDER_KEYS[type].indexOf(fieldB); - if (indexA === indexB) return fieldA < fieldB ? -1 : 1; - if (indexA === -1) return 1; - if (indexB === -1) return -1; - return indexA - indexB; - }); -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/validators.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/validators.js deleted file mode 100644 index acd6da65..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/generators/validators.js +++ /dev/null @@ -1,87 +0,0 @@ -import definitions from "../../lib/definitions/index.js"; - -const has = Function.call.bind(Object.prototype.hasOwnProperty); - -function joinComparisons(leftArr, right) { - return ( - leftArr.map(JSON.stringify).join(` === ${right} || `) + ` === ${right}` - ); -} - -function addIsHelper(type, aliasKeys, deprecated) { - const targetType = JSON.stringify(type); - let aliasSource = ""; - if (aliasKeys) { - aliasSource = joinComparisons(aliasKeys, "nodeType"); - } - - let placeholderSource = ""; - const placeholderTypes = []; - if ( - definitions.PLACEHOLDERS.includes(type) && - has(definitions.FLIPPED_ALIAS_KEYS, type) - ) { - placeholderTypes.push(type); - } - if (has(definitions.PLACEHOLDERS_FLIPPED_ALIAS, type)) { - placeholderTypes.push(...definitions.PLACEHOLDERS_FLIPPED_ALIAS[type]); - } - if (placeholderTypes.length > 0) { - placeholderSource = - ' || nodeType === "Placeholder" && (' + - joinComparisons( - placeholderTypes, - "(node as t.Placeholder).expectedNode" - ) + - ")"; - } - - const result = - definitions.NODE_FIELDS[type] || definitions.FLIPPED_ALIAS_KEYS[type] - ? `node is t.${type}` - : "boolean"; - - return `export function is${type}(node: object | null | undefined, opts?: object | null): ${result} { - ${deprecated || ""} - if (!node) return false; - - const nodeType = (node as t.Node).type; - if (${ - aliasSource ? aliasSource : `nodeType === ${targetType}` - }${placeholderSource}) { - if (typeof opts === "undefined") { - return true; - } else { - return shallowEqual(node, opts); - } - } - - return false; - } - `; -} - -export default function generateValidators() { - let output = `/* - * This file is auto-generated! Do not modify it directly. - * To re-generate run 'make build' - */ -import shallowEqual from "../../utils/shallowEqual"; -import type * as t from "../..";\n\n`; - - Object.keys(definitions.VISITOR_KEYS).forEach(type => { - output += addIsHelper(type); - }); - - Object.keys(definitions.FLIPPED_ALIAS_KEYS).forEach(type => { - output += addIsHelper(type, definitions.FLIPPED_ALIAS_KEYS[type]); - }); - - Object.keys(definitions.DEPRECATED_KEYS).forEach(type => { - const newType = definitions.DEPRECATED_KEYS[type]; - const deprecated = `console.trace("The node type ${type} has been renamed to ${newType}");`; - output += addIsHelper(type, null, deprecated); - }); - - return output; -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/package.json b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/package.json deleted file mode 100644 index 5ffd9800..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/package.json +++ /dev/null @@ -1 +0,0 @@ -{ "type": "module" } diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/formatBuilderName.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/formatBuilderName.js deleted file mode 100644 index f00a3c4a..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/formatBuilderName.js +++ /dev/null @@ -1,8 +0,0 @@ -const toLowerCase = Function.call.bind("".toLowerCase); - -export default function formatBuilderName(type) { - // FunctionExpression -> functionExpression - // JSXIdentifier -> jsxIdentifier - // V8IntrinsicIdentifier -> v8IntrinsicIdentifier - return type.replace(/^([A-Z](?=[a-z0-9])|[A-Z]+(?=[A-Z]))/, toLowerCase); -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/lowerFirst.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/lowerFirst.js deleted file mode 100644 index 012f252a..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/lowerFirst.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function lowerFirst(string) { - return string[0].toLowerCase() + string.slice(1); -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/stringifyValidator.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/stringifyValidator.js deleted file mode 100644 index 4b8d29c1..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/stringifyValidator.js +++ /dev/null @@ -1,66 +0,0 @@ -export default function stringifyValidator(validator, nodePrefix) { - if (validator === undefined) { - return "any"; - } - - if (validator.each) { - return `Array<${stringifyValidator(validator.each, nodePrefix)}>`; - } - - if (validator.chainOf) { - return stringifyValidator(validator.chainOf[1], nodePrefix); - } - - if (validator.oneOf) { - return validator.oneOf.map(JSON.stringify).join(" | "); - } - - if (validator.oneOfNodeTypes) { - return validator.oneOfNodeTypes.map(_ => nodePrefix + _).join(" | "); - } - - if (validator.oneOfNodeOrValueTypes) { - return validator.oneOfNodeOrValueTypes - .map(_ => { - return isValueType(_) ? _ : nodePrefix + _; - }) - .join(" | "); - } - - if (validator.type) { - return validator.type; - } - - if (validator.shapeOf) { - return ( - "{ " + - Object.keys(validator.shapeOf) - .map(shapeKey => { - const propertyDefinition = validator.shapeOf[shapeKey]; - if (propertyDefinition.validate) { - const isOptional = - propertyDefinition.optional || propertyDefinition.default != null; - return ( - shapeKey + - (isOptional ? "?: " : ": ") + - stringifyValidator(propertyDefinition.validate) - ); - } - return null; - }) - .filter(Boolean) - .join(", ") + - " }" - ); - } - - return ["any"]; -} - -/** - * Heuristic to decide whether or not the given type is a value type (eg. "null") - * or a Node type (eg. "Expression"). - */ -function isValueType(type) { - return type.charAt(0).toLowerCase() === type.charAt(0); -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/toFunctionName.js b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/toFunctionName.js deleted file mode 100644 index 2b645780..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/node_modules/@babel/types/scripts/utils/toFunctionName.js +++ /dev/null @@ -1,4 +0,0 @@ -export default function toFunctionName(typeName) { - const _ = typeName.replace(/^TS/, "ts").replace(/^JSX/, "jsx"); - return _.slice(0, 1).toLowerCase() + _.slice(1); -} diff --git a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/package.json b/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/package.json deleted file mode 100644 index 648e8276..00000000 --- a/node_modules/jest-snapshot/node_modules/@babel/helper-get-function-arity/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@babel/helper-get-function-arity", - "version": "7.15.4", - "description": "Helper function to get function arity", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-helper-get-function-arity" - }, - "homepage": "https://babel.dev/docs/en/next/babel-helper-get-function-arity", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "dependencies": { - "@babel/types": "^7.15.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)" -} \ No newline at end of file diff --git a/package.json b/package.json index 5ed619f3..b01fec04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "action-check-pr-title", - "version": "3.0.0", + "version": "3.1.0", "description": "Github action to check Pull Request title based on JS Regexp", "main": "index.js", "repository": "git@github.com:Slashgear/action-check-pr-title.git",