diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/@babel/types/lib/validators/generated/index.js')
-rw-r--r-- | tools/node_modules/eslint/node_modules/@babel/types/lib/validators/generated/index.js | 4238 |
1 files changed, 1546 insertions, 2692 deletions
diff --git a/tools/node_modules/eslint/node_modules/@babel/types/lib/validators/generated/index.js b/tools/node_modules/eslint/node_modules/@babel/types/lib/validators/generated/index.js index 96ab47c10d..a3fbc60c68 100644 --- a/tools/node_modules/eslint/node_modules/@babel/types/lib/validators/generated/index.js +++ b/tools/node_modules/eslint/node_modules/@babel/types/lib/validators/generated/index.js @@ -310,3631 +310,2485 @@ var _shallowEqual = require("../../utils/shallowEqual"); var _deprecationWarning = require("../../utils/deprecationWarning"); 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; + if (node.type !== "ArrayExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "AssignmentExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "BinaryExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "InterpreterDirective") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "Directive") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DirectiveLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "BlockStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "BreakStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "CallExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "CatchClause") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ConditionalExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ContinueStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DebuggerStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DoWhileStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EmptyStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ExpressionStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "File") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ForInStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ForStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "FunctionDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "FunctionExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "Identifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "IfStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "LabeledStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "StringLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "NumericLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "NullLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "BooleanLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "RegExpLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "LogicalExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "MemberExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "NewExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "Program") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectMethod") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "RestElement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ReturnStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "SequenceExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ParenthesizedExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "SwitchCase") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "SwitchStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ThisExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ThrowStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TryStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "UnaryExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "UpdateExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "VariableDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "VariableDeclarator") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "WhileStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "WithStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "AssignmentPattern") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ArrayPattern") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ArrowFunctionExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ClassBody") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ClassExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ClassDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ExportAllDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ExportDefaultDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ExportNamedDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ExportSpecifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ForOfStatement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ImportDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ImportDefaultSpecifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ImportNamespaceSpecifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ImportSpecifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "MetaProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ClassMethod") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectPattern") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "SpreadElement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "Super") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TaggedTemplateExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TemplateElement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TemplateLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "YieldExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "AwaitExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "Import") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "BigIntLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ExportNamespaceSpecifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "OptionalMemberExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "OptionalCallExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ClassProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassAccessorProperty(node, opts) { if (!node) return false; - const nodeType = node.type; - if (nodeType === "ClassAccessorProperty") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - return false; + if (node.type !== "ClassAccessorProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ClassPrivateProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ClassPrivateMethod") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "PrivateName") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "StaticBlock") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "AnyTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ArrayTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "BooleanTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "BooleanLiteralTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "NullLiteralTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ClassImplements") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareClass") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareFunction") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareInterface") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareModule") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareModuleExports") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareTypeAlias") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareOpaqueType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareVariable") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareExportDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclareExportAllDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DeclaredPredicate") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ExistsTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "FunctionTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "FunctionTypeParam") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "GenericTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "InferredPredicate") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "InterfaceExtends") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "InterfaceDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "InterfaceTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "IntersectionTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "MixedTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EmptyTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "NullableTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "NumberLiteralTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "NumberTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectTypeInternalSlot") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectTypeCallProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectTypeIndexer") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectTypeProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ObjectTypeSpreadProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "OpaqueType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "QualifiedTypeIdentifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "StringLiteralTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "StringTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "SymbolTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ThisTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TupleTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TypeofTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TypeAlias") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TypeCastExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TypeParameter") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TypeParameterDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TypeParameterInstantiation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "UnionTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "Variance") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "VoidTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EnumDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EnumBooleanBody") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EnumNumberBody") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EnumStringBody") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EnumSymbolBody") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EnumBooleanMember") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EnumNumberMember") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EnumStringMember") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "EnumDefaultedMember") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "IndexedAccessType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "OptionalIndexedAccessType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXAttribute") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXClosingElement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXElement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXEmptyExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXExpressionContainer") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXSpreadChild") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXIdentifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXMemberExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXNamespacedName") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXOpeningElement") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXSpreadAttribute") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXText") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXFragment") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXOpeningFragment") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "JSXClosingFragment") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "Noop") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "Placeholder") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "V8IntrinsicIdentifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ArgumentPlaceholder") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "BindExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ImportAttribute") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "Decorator") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DoExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ExportDefaultSpecifier") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "RecordExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TupleExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "DecimalLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "ModuleExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TopicReference") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "PipelineTopicExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "PipelineBareFunction") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "PipelinePrimaryTopicReference") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSParameterProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSDeclareFunction") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSDeclareMethod") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSQualifiedName") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSCallSignatureDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSConstructSignatureDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSPropertySignature") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSMethodSignature") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSIndexSignature") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSAnyKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSBooleanKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSBigIntKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSIntrinsicKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSNeverKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSNullKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSNumberKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSObjectKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSStringKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSSymbolKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSUndefinedKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSUnknownKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSVoidKeyword") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSThisType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSFunctionType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSConstructorType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeReference") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypePredicate") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeQuery") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSArrayType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTupleType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSOptionalType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSRestType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSNamedTupleMember") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSUnionType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSIntersectionType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSConditionalType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSInferType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSParenthesizedType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeOperator") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSIndexedAccessType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSMappedType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSLiteralType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSExpressionWithTypeArguments") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSInterfaceDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSInterfaceBody") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeAliasDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSInstantiationExpression(node, opts) { if (!node) return false; - const nodeType = node.type; - if (nodeType === "TSInstantiationExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - return false; + if (node.type !== "TSInstantiationExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSAsExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSSatisfiesExpression(node, opts) { if (!node) return false; - const nodeType = node.type; - if (nodeType === "TSSatisfiesExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - return false; + if (node.type !== "TSSatisfiesExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeAssertion") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSEnumDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSEnumMember") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSModuleDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSModuleBlock") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSImportType") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSImportEqualsDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSExternalModuleReference") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSNonNullExpression") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSExportAssignment") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSNamespaceExportDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeAnnotation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeParameterInstantiation") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeParameterDeclaration") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + if (node.type !== "TSTypeParameter") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isStandardized(node, opts) { if (!node) return false; - const nodeType = node.type; - if ("ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "InterpreterDirective" === nodeType || "Directive" === nodeType || "DirectiveLiteral" === nodeType || "BlockStatement" === nodeType || "BreakStatement" === nodeType || "CallExpression" === nodeType || "CatchClause" === nodeType || "ConditionalExpression" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "File" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "Program" === nodeType || "ObjectExpression" === nodeType || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "RestElement" === nodeType || "ReturnStatement" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "SwitchCase" === nodeType || "SwitchStatement" === nodeType || "ThisExpression" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "VariableDeclaration" === nodeType || "VariableDeclarator" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassBody" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ExportSpecifier" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "MetaProperty" === nodeType || "ClassMethod" === nodeType || "ObjectPattern" === nodeType || "SpreadElement" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateElement" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType || "Import" === nodeType || "BigIntLiteral" === nodeType || "ExportNamespaceSpecifier" === nodeType || "OptionalMemberExpression" === nodeType || "OptionalCallExpression" === nodeType || "ClassProperty" === nodeType || "ClassAccessorProperty" === nodeType || "ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType || "StaticBlock" === nodeType || nodeType === "Placeholder" && ("Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode || "BlockStatement" === node.expectedNode || "ClassBody" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - return false; + switch (node.type) { + case "ArrayExpression": + case "AssignmentExpression": + case "BinaryExpression": + case "InterpreterDirective": + case "Directive": + case "DirectiveLiteral": + case "BlockStatement": + case "BreakStatement": + case "CallExpression": + case "CatchClause": + case "ConditionalExpression": + case "ContinueStatement": + case "DebuggerStatement": + case "DoWhileStatement": + case "EmptyStatement": + case "ExpressionStatement": + case "File": + case "ForInStatement": + case "ForStatement": + case "FunctionDeclaration": + case "FunctionExpression": + case "Identifier": + case "IfStatement": + case "LabeledStatement": + case "StringLiteral": + case "NumericLiteral": + case "NullLiteral": + case "BooleanLiteral": + case "RegExpLiteral": + case "LogicalExpression": + case "MemberExpression": + case "NewExpression": + case "Program": + case "ObjectExpression": + case "ObjectMethod": + case "ObjectProperty": + case "RestElement": + case "ReturnStatement": + case "SequenceExpression": + case "ParenthesizedExpression": + case "SwitchCase": + case "SwitchStatement": + case "ThisExpression": + case "ThrowStatement": + case "TryStatement": + case "UnaryExpression": + case "UpdateExpression": + case "VariableDeclaration": + case "VariableDeclarator": + case "WhileStatement": + case "WithStatement": + case "AssignmentPattern": + case "ArrayPattern": + case "ArrowFunctionExpression": + case "ClassBody": + case "ClassExpression": + case "ClassDeclaration": + case "ExportAllDeclaration": + case "ExportDefaultDeclaration": + case "ExportNamedDeclaration": + case "ExportSpecifier": + case "ForOfStatement": + case "ImportDeclaration": + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "ImportSpecifier": + case "MetaProperty": + case "ClassMethod": + case "ObjectPattern": + case "SpreadElement": + case "Super": + case "TaggedTemplateExpression": + case "TemplateElement": + case "TemplateLiteral": + case "YieldExpression": + case "AwaitExpression": + case "Import": + case "BigIntLiteral": + case "ExportNamespaceSpecifier": + case "OptionalMemberExpression": + case "OptionalCallExpression": + case "ClassProperty": + case "ClassAccessorProperty": + case "ClassPrivateProperty": + case "ClassPrivateMethod": + case "PrivateName": + case "StaticBlock": + break; + case "Placeholder": + switch (node.expectedNode) { + case "Identifier": + case "StringLiteral": + case "BlockStatement": + case "ClassBody": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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 || "TSInstantiationExpression" === nodeType || "TSAsExpression" === nodeType || "TSSatisfiesExpression" === 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; + switch (node.type) { + case "ArrayExpression": + case "AssignmentExpression": + case "BinaryExpression": + case "CallExpression": + case "ConditionalExpression": + case "FunctionExpression": + case "Identifier": + case "StringLiteral": + case "NumericLiteral": + case "NullLiteral": + case "BooleanLiteral": + case "RegExpLiteral": + case "LogicalExpression": + case "MemberExpression": + case "NewExpression": + case "ObjectExpression": + case "SequenceExpression": + case "ParenthesizedExpression": + case "ThisExpression": + case "UnaryExpression": + case "UpdateExpression": + case "ArrowFunctionExpression": + case "ClassExpression": + case "MetaProperty": + case "Super": + case "TaggedTemplateExpression": + case "TemplateLiteral": + case "YieldExpression": + case "AwaitExpression": + case "Import": + case "BigIntLiteral": + case "OptionalMemberExpression": + case "OptionalCallExpression": + case "TypeCastExpression": + case "JSXElement": + case "JSXFragment": + case "BindExpression": + case "DoExpression": + case "RecordExpression": + case "TupleExpression": + case "DecimalLiteral": + case "ModuleExpression": + case "TopicReference": + case "PipelineTopicExpression": + case "PipelineBareFunction": + case "PipelinePrimaryTopicReference": + case "TSInstantiationExpression": + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + case "TSNonNullExpression": + break; + case "Placeholder": + switch (node.expectedNode) { + case "Expression": + case "Identifier": + case "StringLiteral": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "BinaryExpression": + case "LogicalExpression": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "BlockStatement": + case "CatchClause": + case "DoWhileStatement": + case "ForInStatement": + case "ForStatement": + case "FunctionDeclaration": + case "FunctionExpression": + case "Program": + case "ObjectMethod": + case "SwitchStatement": + case "WhileStatement": + case "ArrowFunctionExpression": + case "ClassExpression": + case "ClassDeclaration": + case "ForOfStatement": + case "ClassMethod": + case "ClassPrivateMethod": + case "StaticBlock": + case "TSModuleBlock": + break; + case "Placeholder": + switch (node.expectedNode) { + case "BlockStatement": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "BlockStatement": + case "CatchClause": + case "DoWhileStatement": + case "ForInStatement": + case "ForStatement": + case "FunctionDeclaration": + case "FunctionExpression": + case "Program": + case "ObjectMethod": + case "SwitchStatement": + case "WhileStatement": + case "ArrowFunctionExpression": + case "ForOfStatement": + case "ClassMethod": + case "ClassPrivateMethod": + case "StaticBlock": + case "TSModuleBlock": + break; + case "Placeholder": + switch (node.expectedNode) { + case "BlockStatement": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "BlockStatement": + case "Program": + case "TSModuleBlock": + break; + case "Placeholder": + switch (node.expectedNode) { + case "BlockStatement": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "BlockStatement": + case "BreakStatement": + case "ContinueStatement": + case "DebuggerStatement": + case "DoWhileStatement": + case "EmptyStatement": + case "ExpressionStatement": + case "ForInStatement": + case "ForStatement": + case "FunctionDeclaration": + case "IfStatement": + case "LabeledStatement": + case "ReturnStatement": + case "SwitchStatement": + case "ThrowStatement": + case "TryStatement": + case "VariableDeclaration": + case "WhileStatement": + case "WithStatement": + case "ClassDeclaration": + case "ExportAllDeclaration": + case "ExportDefaultDeclaration": + case "ExportNamedDeclaration": + case "ForOfStatement": + case "ImportDeclaration": + case "DeclareClass": + case "DeclareFunction": + case "DeclareInterface": + case "DeclareModule": + case "DeclareModuleExports": + case "DeclareTypeAlias": + case "DeclareOpaqueType": + case "DeclareVariable": + case "DeclareExportDeclaration": + case "DeclareExportAllDeclaration": + case "InterfaceDeclaration": + case "OpaqueType": + case "TypeAlias": + case "EnumDeclaration": + case "TSDeclareFunction": + case "TSInterfaceDeclaration": + case "TSTypeAliasDeclaration": + case "TSEnumDeclaration": + case "TSModuleDeclaration": + case "TSImportEqualsDeclaration": + case "TSExportAssignment": + case "TSNamespaceExportDeclaration": + break; + case "Placeholder": + switch (node.expectedNode) { + case "Statement": + case "Declaration": + case "BlockStatement": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "BreakStatement": + case "ContinueStatement": + case "ReturnStatement": + case "ThrowStatement": + case "YieldExpression": + case "AwaitExpression": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "BreakStatement": + case "ContinueStatement": + case "ReturnStatement": + case "ThrowStatement": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ConditionalExpression": + case "IfStatement": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "DoWhileStatement": + case "ForInStatement": + case "ForStatement": + case "WhileStatement": + case "ForOfStatement": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "DoWhileStatement": + case "WhileStatement": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ExpressionStatement": + case "ParenthesizedExpression": + case "TypeCastExpression": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ForInStatement": + case "ForStatement": + case "ForOfStatement": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ForInStatement": + case "ForOfStatement": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "FunctionDeclaration": + case "FunctionExpression": + case "ObjectMethod": + case "ArrowFunctionExpression": + case "ClassMethod": + case "ClassPrivateMethod": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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 || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - return false; + switch (node.type) { + case "FunctionDeclaration": + case "FunctionExpression": + case "ObjectMethod": + case "ArrowFunctionExpression": + case "ClassMethod": + case "ClassPrivateMethod": + case "StaticBlock": + case "TSModuleBlock": + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "FunctionDeclaration": + case "FunctionExpression": + case "StringLiteral": + case "NumericLiteral": + case "NullLiteral": + case "BooleanLiteral": + case "RegExpLiteral": + case "ArrowFunctionExpression": + case "BigIntLiteral": + case "DecimalLiteral": + break; + case "Placeholder": + switch (node.expectedNode) { + case "StringLiteral": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "FunctionDeclaration": + case "VariableDeclaration": + case "ClassDeclaration": + case "ExportAllDeclaration": + case "ExportDefaultDeclaration": + case "ExportNamedDeclaration": + case "ImportDeclaration": + case "DeclareClass": + case "DeclareFunction": + case "DeclareInterface": + case "DeclareModule": + case "DeclareModuleExports": + case "DeclareTypeAlias": + case "DeclareOpaqueType": + case "DeclareVariable": + case "DeclareExportDeclaration": + case "DeclareExportAllDeclaration": + case "InterfaceDeclaration": + case "OpaqueType": + case "TypeAlias": + case "EnumDeclaration": + case "TSDeclareFunction": + case "TSInterfaceDeclaration": + case "TSTypeAliasDeclaration": + case "TSEnumDeclaration": + case "TSModuleDeclaration": + break; + case "Placeholder": + switch (node.expectedNode) { + case "Declaration": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } function isPatternLike(node, opts) { if (!node) return false; - const nodeType = node.type; - if ("Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSAsExpression" === nodeType || "TSSatisfiesExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - return false; + switch (node.type) { + case "Identifier": + case "RestElement": + case "AssignmentPattern": + case "ArrayPattern": + case "ObjectPattern": + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + case "TSNonNullExpression": + break; + case "Placeholder": + switch (node.expectedNode) { + case "Pattern": + case "Identifier": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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 || "TSAsExpression" === nodeType || "TSSatisfiesExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - return false; + switch (node.type) { + case "Identifier": + case "MemberExpression": + case "RestElement": + case "AssignmentPattern": + case "ArrayPattern": + case "ObjectPattern": + case "TSParameterProperty": + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + case "TSNonNullExpression": + break; + case "Placeholder": + switch (node.expectedNode) { + case "Pattern": + case "Identifier": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "Identifier": + case "TSQualifiedName": + break; + case "Placeholder": + switch (node.expectedNode) { + case "Identifier": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "StringLiteral": + case "NumericLiteral": + case "NullLiteral": + case "BooleanLiteral": + case "RegExpLiteral": + case "TemplateLiteral": + case "BigIntLiteral": + case "DecimalLiteral": + break; + case "Placeholder": + switch (node.expectedNode) { + case "StringLiteral": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "StringLiteral": + case "NumericLiteral": + case "NullLiteral": + case "BooleanLiteral": + case "BigIntLiteral": + case "JSXAttribute": + case "JSXClosingElement": + case "JSXElement": + case "JSXExpressionContainer": + case "JSXSpreadChild": + case "JSXOpeningElement": + case "JSXText": + case "JSXFragment": + case "JSXOpeningFragment": + case "JSXClosingFragment": + case "DecimalLiteral": + break; + case "Placeholder": + switch (node.expectedNode) { + case "StringLiteral": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ObjectMethod": + case "ObjectProperty": + case "ObjectTypeInternalSlot": + case "ObjectTypeCallProperty": + case "ObjectTypeIndexer": + case "ObjectTypeProperty": + case "ObjectTypeSpreadProperty": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ObjectMethod": + case "ClassMethod": + case "ClassPrivateMethod": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ObjectMethod": + case "ObjectProperty": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isProperty(node, opts) { if (!node) return false; - const nodeType = node.type; - if ("ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassAccessorProperty" === nodeType || "ClassPrivateProperty" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } + switch (node.type) { + case "ObjectProperty": + case "ClassProperty": + case "ClassAccessorProperty": + case "ClassPrivateProperty": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "UnaryExpression": + case "SpreadElement": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "AssignmentPattern": + case "ArrayPattern": + case "ObjectPattern": + break; + case "Placeholder": + switch (node.expectedNode) { + case "Pattern": + break; + default: + return false; + } + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ClassExpression": + case "ClassDeclaration": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isImportOrExportDeclaration(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); - } + switch (node.type) { + case "ExportAllDeclaration": + case "ExportDefaultDeclaration": + case "ExportNamedDeclaration": + case "ImportDeclaration": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ExportAllDeclaration": + case "ExportDefaultDeclaration": + case "ExportNamedDeclaration": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ExportSpecifier": + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "ImportSpecifier": + case "ExportNamespaceSpecifier": + case "ExportDefaultSpecifier": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isAccessor(node, opts) { if (!node) return false; - const nodeType = node.type; - if ("ClassAccessorProperty" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } + switch (node.type) { + case "ClassAccessorProperty": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "ClassPrivateProperty": + case "ClassPrivateMethod": + case "PrivateName": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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 || "EnumDeclaration" === nodeType || "EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType || "EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - return false; + switch (node.type) { + case "AnyTypeAnnotation": + case "ArrayTypeAnnotation": + case "BooleanTypeAnnotation": + case "BooleanLiteralTypeAnnotation": + case "NullLiteralTypeAnnotation": + case "ClassImplements": + case "DeclareClass": + case "DeclareFunction": + case "DeclareInterface": + case "DeclareModule": + case "DeclareModuleExports": + case "DeclareTypeAlias": + case "DeclareOpaqueType": + case "DeclareVariable": + case "DeclareExportDeclaration": + case "DeclareExportAllDeclaration": + case "DeclaredPredicate": + case "ExistsTypeAnnotation": + case "FunctionTypeAnnotation": + case "FunctionTypeParam": + case "GenericTypeAnnotation": + case "InferredPredicate": + case "InterfaceExtends": + case "InterfaceDeclaration": + case "InterfaceTypeAnnotation": + case "IntersectionTypeAnnotation": + case "MixedTypeAnnotation": + case "EmptyTypeAnnotation": + case "NullableTypeAnnotation": + case "NumberLiteralTypeAnnotation": + case "NumberTypeAnnotation": + case "ObjectTypeAnnotation": + case "ObjectTypeInternalSlot": + case "ObjectTypeCallProperty": + case "ObjectTypeIndexer": + case "ObjectTypeProperty": + case "ObjectTypeSpreadProperty": + case "OpaqueType": + case "QualifiedTypeIdentifier": + case "StringLiteralTypeAnnotation": + case "StringTypeAnnotation": + case "SymbolTypeAnnotation": + case "ThisTypeAnnotation": + case "TupleTypeAnnotation": + case "TypeofTypeAnnotation": + case "TypeAlias": + case "TypeAnnotation": + case "TypeCastExpression": + case "TypeParameter": + case "TypeParameterDeclaration": + case "TypeParameterInstantiation": + case "UnionTypeAnnotation": + case "Variance": + case "VoidTypeAnnotation": + case "EnumDeclaration": + case "EnumBooleanBody": + case "EnumNumberBody": + case "EnumStringBody": + case "EnumSymbolBody": + case "EnumBooleanMember": + case "EnumNumberMember": + case "EnumStringMember": + case "EnumDefaultedMember": + case "IndexedAccessType": + case "OptionalIndexedAccessType": + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "AnyTypeAnnotation": + case "ArrayTypeAnnotation": + case "BooleanTypeAnnotation": + case "BooleanLiteralTypeAnnotation": + case "NullLiteralTypeAnnotation": + case "ExistsTypeAnnotation": + case "FunctionTypeAnnotation": + case "GenericTypeAnnotation": + case "InterfaceTypeAnnotation": + case "IntersectionTypeAnnotation": + case "MixedTypeAnnotation": + case "EmptyTypeAnnotation": + case "NullableTypeAnnotation": + case "NumberLiteralTypeAnnotation": + case "NumberTypeAnnotation": + case "ObjectTypeAnnotation": + case "StringLiteralTypeAnnotation": + case "StringTypeAnnotation": + case "SymbolTypeAnnotation": + case "ThisTypeAnnotation": + case "TupleTypeAnnotation": + case "TypeofTypeAnnotation": + case "UnionTypeAnnotation": + case "VoidTypeAnnotation": + case "IndexedAccessType": + case "OptionalIndexedAccessType": + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "AnyTypeAnnotation": + case "BooleanTypeAnnotation": + case "NullLiteralTypeAnnotation": + case "MixedTypeAnnotation": + case "EmptyTypeAnnotation": + case "NumberTypeAnnotation": + case "StringTypeAnnotation": + case "SymbolTypeAnnotation": + case "ThisTypeAnnotation": + case "VoidTypeAnnotation": + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "DeclareClass": + case "DeclareFunction": + case "DeclareInterface": + case "DeclareModule": + case "DeclareModuleExports": + case "DeclareTypeAlias": + case "DeclareOpaqueType": + case "DeclareVariable": + case "DeclareExportDeclaration": + case "DeclareExportAllDeclaration": + case "InterfaceDeclaration": + case "OpaqueType": + case "TypeAlias": + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "DeclaredPredicate": + case "InferredPredicate": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "EnumBooleanBody": + case "EnumNumberBody": + case "EnumStringBody": + case "EnumSymbolBody": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "EnumBooleanMember": + case "EnumNumberMember": + case "EnumStringMember": + case "EnumDefaultedMember": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "JSXAttribute": + case "JSXClosingElement": + case "JSXElement": + case "JSXEmptyExpression": + case "JSXExpressionContainer": + case "JSXSpreadChild": + case "JSXIdentifier": + case "JSXMemberExpression": + case "JSXNamespacedName": + case "JSXOpeningElement": + case "JSXSpreadAttribute": + case "JSXText": + case "JSXFragment": + case "JSXOpeningFragment": + case "JSXClosingFragment": + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } function isMiscellaneous(node, opts) { if (!node) return false; - const nodeType = node.type; - if ("Noop" === nodeType || "Placeholder" === nodeType || "V8IntrinsicIdentifier" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } + switch (node.type) { + case "Noop": + case "Placeholder": + case "V8IntrinsicIdentifier": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isTypeScript(node, opts) { if (!node) return false; - const nodeType = node.type; - if ("TSParameterProperty" === nodeType || "TSDeclareFunction" === nodeType || "TSDeclareMethod" === nodeType || "TSQualifiedName" === nodeType || "TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType || "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 || "TSNamedTupleMember" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSInterfaceBody" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSInstantiationExpression" === nodeType || "TSAsExpression" === nodeType || "TSSatisfiesExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSEnumDeclaration" === nodeType || "TSEnumMember" === nodeType || "TSModuleDeclaration" === nodeType || "TSModuleBlock" === nodeType || "TSImportType" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExternalModuleReference" === nodeType || "TSNonNullExpression" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || "TSTypeAnnotation" === nodeType || "TSTypeParameterInstantiation" === nodeType || "TSTypeParameterDeclaration" === nodeType || "TSTypeParameter" === nodeType) { - if (typeof opts === "undefined") { - return true; - } else { - return (0, _shallowEqual.default)(node, opts); - } - } - return false; + switch (node.type) { + case "TSParameterProperty": + case "TSDeclareFunction": + case "TSDeclareMethod": + case "TSQualifiedName": + case "TSCallSignatureDeclaration": + case "TSConstructSignatureDeclaration": + case "TSPropertySignature": + case "TSMethodSignature": + case "TSIndexSignature": + case "TSAnyKeyword": + case "TSBooleanKeyword": + case "TSBigIntKeyword": + case "TSIntrinsicKeyword": + case "TSNeverKeyword": + case "TSNullKeyword": + case "TSNumberKeyword": + case "TSObjectKeyword": + case "TSStringKeyword": + case "TSSymbolKeyword": + case "TSUndefinedKeyword": + case "TSUnknownKeyword": + case "TSVoidKeyword": + case "TSThisType": + case "TSFunctionType": + case "TSConstructorType": + case "TSTypeReference": + case "TSTypePredicate": + case "TSTypeQuery": + case "TSTypeLiteral": + case "TSArrayType": + case "TSTupleType": + case "TSOptionalType": + case "TSRestType": + case "TSNamedTupleMember": + case "TSUnionType": + case "TSIntersectionType": + case "TSConditionalType": + case "TSInferType": + case "TSParenthesizedType": + case "TSTypeOperator": + case "TSIndexedAccessType": + case "TSMappedType": + case "TSLiteralType": + case "TSExpressionWithTypeArguments": + case "TSInterfaceDeclaration": + case "TSInterfaceBody": + case "TSTypeAliasDeclaration": + case "TSInstantiationExpression": + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + case "TSEnumDeclaration": + case "TSEnumMember": + case "TSModuleDeclaration": + case "TSModuleBlock": + case "TSImportType": + case "TSImportEqualsDeclaration": + case "TSExternalModuleReference": + case "TSNonNullExpression": + case "TSExportAssignment": + case "TSNamespaceExportDeclaration": + case "TSTypeAnnotation": + case "TSTypeParameterInstantiation": + case "TSTypeParameterDeclaration": + case "TSTypeParameter": + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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); - } + switch (node.type) { + case "TSCallSignatureDeclaration": + case "TSConstructSignatureDeclaration": + case "TSPropertySignature": + case "TSMethodSignature": + case "TSIndexSignature": + break; + default: + return false; } - return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "TSAnyKeyword": + case "TSBooleanKeyword": + case "TSBigIntKeyword": + case "TSIntrinsicKeyword": + case "TSNeverKeyword": + case "TSNullKeyword": + case "TSNumberKeyword": + case "TSObjectKeyword": + case "TSStringKeyword": + case "TSSymbolKeyword": + case "TSUndefinedKeyword": + case "TSUnknownKeyword": + case "TSVoidKeyword": + case "TSThisType": + case "TSFunctionType": + case "TSConstructorType": + case "TSTypeReference": + case "TSTypePredicate": + case "TSTypeQuery": + case "TSTypeLiteral": + case "TSArrayType": + case "TSTupleType": + case "TSOptionalType": + case "TSRestType": + case "TSUnionType": + case "TSIntersectionType": + case "TSConditionalType": + case "TSInferType": + case "TSParenthesizedType": + case "TSTypeOperator": + case "TSIndexedAccessType": + case "TSMappedType": + case "TSLiteralType": + case "TSExpressionWithTypeArguments": + case "TSImportType": + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } 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; + switch (node.type) { + case "TSAnyKeyword": + case "TSBooleanKeyword": + case "TSBigIntKeyword": + case "TSIntrinsicKeyword": + case "TSNeverKeyword": + case "TSNullKeyword": + case "TSNumberKeyword": + case "TSObjectKeyword": + case "TSStringKeyword": + case "TSSymbolKeyword": + case "TSUndefinedKeyword": + case "TSUnknownKeyword": + case "TSVoidKeyword": + case "TSThisType": + case "TSLiteralType": + break; + default: + return false; + } + return opts == null || (0, _shallowEqual.default)(node, opts); } function isNumberLiteral(node, opts) { (0, _deprecationWarning.default)("isNumberLiteral", "isNumericLiteral"); 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; + if (node.type !== "NumberLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isRegexLiteral(node, opts) { (0, _deprecationWarning.default)("isRegexLiteral", "isRegExpLiteral"); 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; + if (node.type !== "RegexLiteral") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isRestProperty(node, opts) { (0, _deprecationWarning.default)("isRestProperty", "isRestElement"); 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; + if (node.type !== "RestProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isSpreadProperty(node, opts) { (0, _deprecationWarning.default)("isSpreadProperty", "isSpreadElement"); 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; + if (node.type !== "SpreadProperty") return false; + return opts == null || (0, _shallowEqual.default)(node, opts); } function isModuleDeclaration(node, opts) { (0, _deprecationWarning.default)("isModuleDeclaration", "isImportOrExportDeclaration"); |