@babel/types
Advanced tools
Comparing version 7.0.0-beta.46 to 7.0.0-beta.47
@@ -14,5 +14,5 @@ "use strict"; | ||
if (!(0, _isNode.default)(node)) { | ||
var type = node && node.type || JSON.stringify(node); | ||
throw new TypeError("Not a valid node of type \"" + type + "\""); | ||
const type = node && node.type || JSON.stringify(node); | ||
throw new TypeError(`Not a valid node of type "${type}"`); | ||
} | ||
} |
@@ -268,2011 +268,1007 @@ "use strict"; | ||
if (!(0, _is.default)(type, node, opts)) { | ||
throw new Error("Expected type \"" + type + "\" with option " + JSON.stringify(opts) + ", but instead got \"" + node.type + "\"."); | ||
throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, but instead got "${node.type}".`); | ||
} | ||
} | ||
function assertArrayExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertArrayExpression(node, opts = {}) { | ||
assert("ArrayExpression", node, opts); | ||
} | ||
function assertAssignmentExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertAssignmentExpression(node, opts = {}) { | ||
assert("AssignmentExpression", node, opts); | ||
} | ||
function assertBinaryExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBinaryExpression(node, opts = {}) { | ||
assert("BinaryExpression", node, opts); | ||
} | ||
function assertDirective(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDirective(node, opts = {}) { | ||
assert("Directive", node, opts); | ||
} | ||
function assertDirectiveLiteral(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDirectiveLiteral(node, opts = {}) { | ||
assert("DirectiveLiteral", node, opts); | ||
} | ||
function assertBlockStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBlockStatement(node, opts = {}) { | ||
assert("BlockStatement", node, opts); | ||
} | ||
function assertBreakStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBreakStatement(node, opts = {}) { | ||
assert("BreakStatement", node, opts); | ||
} | ||
function assertCallExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertCallExpression(node, opts = {}) { | ||
assert("CallExpression", node, opts); | ||
} | ||
function assertCatchClause(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertCatchClause(node, opts = {}) { | ||
assert("CatchClause", node, opts); | ||
} | ||
function assertConditionalExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertConditionalExpression(node, opts = {}) { | ||
assert("ConditionalExpression", node, opts); | ||
} | ||
function assertContinueStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertContinueStatement(node, opts = {}) { | ||
assert("ContinueStatement", node, opts); | ||
} | ||
function assertDebuggerStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDebuggerStatement(node, opts = {}) { | ||
assert("DebuggerStatement", node, opts); | ||
} | ||
function assertDoWhileStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDoWhileStatement(node, opts = {}) { | ||
assert("DoWhileStatement", node, opts); | ||
} | ||
function assertEmptyStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertEmptyStatement(node, opts = {}) { | ||
assert("EmptyStatement", node, opts); | ||
} | ||
function assertExpressionStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExpressionStatement(node, opts = {}) { | ||
assert("ExpressionStatement", node, opts); | ||
} | ||
function assertFile(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFile(node, opts = {}) { | ||
assert("File", node, opts); | ||
} | ||
function assertForInStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertForInStatement(node, opts = {}) { | ||
assert("ForInStatement", node, opts); | ||
} | ||
function assertForStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertForStatement(node, opts = {}) { | ||
assert("ForStatement", node, opts); | ||
} | ||
function assertFunctionDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFunctionDeclaration(node, opts = {}) { | ||
assert("FunctionDeclaration", node, opts); | ||
} | ||
function assertFunctionExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFunctionExpression(node, opts = {}) { | ||
assert("FunctionExpression", node, opts); | ||
} | ||
function assertIdentifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertIdentifier(node, opts = {}) { | ||
assert("Identifier", node, opts); | ||
} | ||
function assertIfStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertIfStatement(node, opts = {}) { | ||
assert("IfStatement", node, opts); | ||
} | ||
function assertLabeledStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertLabeledStatement(node, opts = {}) { | ||
assert("LabeledStatement", node, opts); | ||
} | ||
function assertStringLiteral(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertStringLiteral(node, opts = {}) { | ||
assert("StringLiteral", node, opts); | ||
} | ||
function assertNumericLiteral(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertNumericLiteral(node, opts = {}) { | ||
assert("NumericLiteral", node, opts); | ||
} | ||
function assertNullLiteral(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertNullLiteral(node, opts = {}) { | ||
assert("NullLiteral", node, opts); | ||
} | ||
function assertBooleanLiteral(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBooleanLiteral(node, opts = {}) { | ||
assert("BooleanLiteral", node, opts); | ||
} | ||
function assertRegExpLiteral(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertRegExpLiteral(node, opts = {}) { | ||
assert("RegExpLiteral", node, opts); | ||
} | ||
function assertLogicalExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertLogicalExpression(node, opts = {}) { | ||
assert("LogicalExpression", node, opts); | ||
} | ||
function assertMemberExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertMemberExpression(node, opts = {}) { | ||
assert("MemberExpression", node, opts); | ||
} | ||
function assertNewExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertNewExpression(node, opts = {}) { | ||
assert("NewExpression", node, opts); | ||
} | ||
function assertProgram(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertProgram(node, opts = {}) { | ||
assert("Program", node, opts); | ||
} | ||
function assertObjectExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectExpression(node, opts = {}) { | ||
assert("ObjectExpression", node, opts); | ||
} | ||
function assertObjectMethod(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectMethod(node, opts = {}) { | ||
assert("ObjectMethod", node, opts); | ||
} | ||
function assertObjectProperty(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectProperty(node, opts = {}) { | ||
assert("ObjectProperty", node, opts); | ||
} | ||
function assertRestElement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertRestElement(node, opts = {}) { | ||
assert("RestElement", node, opts); | ||
} | ||
function assertReturnStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertReturnStatement(node, opts = {}) { | ||
assert("ReturnStatement", node, opts); | ||
} | ||
function assertSequenceExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertSequenceExpression(node, opts = {}) { | ||
assert("SequenceExpression", node, opts); | ||
} | ||
function assertSwitchCase(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertSwitchCase(node, opts = {}) { | ||
assert("SwitchCase", node, opts); | ||
} | ||
function assertSwitchStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertSwitchStatement(node, opts = {}) { | ||
assert("SwitchStatement", node, opts); | ||
} | ||
function assertThisExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertThisExpression(node, opts = {}) { | ||
assert("ThisExpression", node, opts); | ||
} | ||
function assertThrowStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertThrowStatement(node, opts = {}) { | ||
assert("ThrowStatement", node, opts); | ||
} | ||
function assertTryStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTryStatement(node, opts = {}) { | ||
assert("TryStatement", node, opts); | ||
} | ||
function assertUnaryExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertUnaryExpression(node, opts = {}) { | ||
assert("UnaryExpression", node, opts); | ||
} | ||
function assertUpdateExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertUpdateExpression(node, opts = {}) { | ||
assert("UpdateExpression", node, opts); | ||
} | ||
function assertVariableDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertVariableDeclaration(node, opts = {}) { | ||
assert("VariableDeclaration", node, opts); | ||
} | ||
function assertVariableDeclarator(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertVariableDeclarator(node, opts = {}) { | ||
assert("VariableDeclarator", node, opts); | ||
} | ||
function assertWhileStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertWhileStatement(node, opts = {}) { | ||
assert("WhileStatement", node, opts); | ||
} | ||
function assertWithStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertWithStatement(node, opts = {}) { | ||
assert("WithStatement", node, opts); | ||
} | ||
function assertAssignmentPattern(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertAssignmentPattern(node, opts = {}) { | ||
assert("AssignmentPattern", node, opts); | ||
} | ||
function assertArrayPattern(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertArrayPattern(node, opts = {}) { | ||
assert("ArrayPattern", node, opts); | ||
} | ||
function assertArrowFunctionExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertArrowFunctionExpression(node, opts = {}) { | ||
assert("ArrowFunctionExpression", node, opts); | ||
} | ||
function assertClassBody(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertClassBody(node, opts = {}) { | ||
assert("ClassBody", node, opts); | ||
} | ||
function assertClassDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertClassDeclaration(node, opts = {}) { | ||
assert("ClassDeclaration", node, opts); | ||
} | ||
function assertClassExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertClassExpression(node, opts = {}) { | ||
assert("ClassExpression", node, opts); | ||
} | ||
function assertExportAllDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExportAllDeclaration(node, opts = {}) { | ||
assert("ExportAllDeclaration", node, opts); | ||
} | ||
function assertExportDefaultDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExportDefaultDeclaration(node, opts = {}) { | ||
assert("ExportDefaultDeclaration", node, opts); | ||
} | ||
function assertExportNamedDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExportNamedDeclaration(node, opts = {}) { | ||
assert("ExportNamedDeclaration", node, opts); | ||
} | ||
function assertExportSpecifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExportSpecifier(node, opts = {}) { | ||
assert("ExportSpecifier", node, opts); | ||
} | ||
function assertForOfStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertForOfStatement(node, opts = {}) { | ||
assert("ForOfStatement", node, opts); | ||
} | ||
function assertImportDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertImportDeclaration(node, opts = {}) { | ||
assert("ImportDeclaration", node, opts); | ||
} | ||
function assertImportDefaultSpecifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertImportDefaultSpecifier(node, opts = {}) { | ||
assert("ImportDefaultSpecifier", node, opts); | ||
} | ||
function assertImportNamespaceSpecifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertImportNamespaceSpecifier(node, opts = {}) { | ||
assert("ImportNamespaceSpecifier", node, opts); | ||
} | ||
function assertImportSpecifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertImportSpecifier(node, opts = {}) { | ||
assert("ImportSpecifier", node, opts); | ||
} | ||
function assertMetaProperty(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertMetaProperty(node, opts = {}) { | ||
assert("MetaProperty", node, opts); | ||
} | ||
function assertClassMethod(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertClassMethod(node, opts = {}) { | ||
assert("ClassMethod", node, opts); | ||
} | ||
function assertObjectPattern(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectPattern(node, opts = {}) { | ||
assert("ObjectPattern", node, opts); | ||
} | ||
function assertSpreadElement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertSpreadElement(node, opts = {}) { | ||
assert("SpreadElement", node, opts); | ||
} | ||
function assertSuper(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertSuper(node, opts = {}) { | ||
assert("Super", node, opts); | ||
} | ||
function assertTaggedTemplateExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTaggedTemplateExpression(node, opts = {}) { | ||
assert("TaggedTemplateExpression", node, opts); | ||
} | ||
function assertTemplateElement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTemplateElement(node, opts = {}) { | ||
assert("TemplateElement", node, opts); | ||
} | ||
function assertTemplateLiteral(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTemplateLiteral(node, opts = {}) { | ||
assert("TemplateLiteral", node, opts); | ||
} | ||
function assertYieldExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertYieldExpression(node, opts = {}) { | ||
assert("YieldExpression", node, opts); | ||
} | ||
function assertAnyTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertAnyTypeAnnotation(node, opts = {}) { | ||
assert("AnyTypeAnnotation", node, opts); | ||
} | ||
function assertArrayTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertArrayTypeAnnotation(node, opts = {}) { | ||
assert("ArrayTypeAnnotation", node, opts); | ||
} | ||
function assertBooleanTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBooleanTypeAnnotation(node, opts = {}) { | ||
assert("BooleanTypeAnnotation", node, opts); | ||
} | ||
function assertBooleanLiteralTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBooleanLiteralTypeAnnotation(node, opts = {}) { | ||
assert("BooleanLiteralTypeAnnotation", node, opts); | ||
} | ||
function assertNullLiteralTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertNullLiteralTypeAnnotation(node, opts = {}) { | ||
assert("NullLiteralTypeAnnotation", node, opts); | ||
} | ||
function assertClassImplements(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertClassImplements(node, opts = {}) { | ||
assert("ClassImplements", node, opts); | ||
} | ||
function assertDeclareClass(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareClass(node, opts = {}) { | ||
assert("DeclareClass", node, opts); | ||
} | ||
function assertDeclareFunction(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareFunction(node, opts = {}) { | ||
assert("DeclareFunction", node, opts); | ||
} | ||
function assertDeclareInterface(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareInterface(node, opts = {}) { | ||
assert("DeclareInterface", node, opts); | ||
} | ||
function assertDeclareModule(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareModule(node, opts = {}) { | ||
assert("DeclareModule", node, opts); | ||
} | ||
function assertDeclareModuleExports(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareModuleExports(node, opts = {}) { | ||
assert("DeclareModuleExports", node, opts); | ||
} | ||
function assertDeclareTypeAlias(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareTypeAlias(node, opts = {}) { | ||
assert("DeclareTypeAlias", node, opts); | ||
} | ||
function assertDeclareOpaqueType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareOpaqueType(node, opts = {}) { | ||
assert("DeclareOpaqueType", node, opts); | ||
} | ||
function assertDeclareVariable(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareVariable(node, opts = {}) { | ||
assert("DeclareVariable", node, opts); | ||
} | ||
function assertDeclareExportDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareExportDeclaration(node, opts = {}) { | ||
assert("DeclareExportDeclaration", node, opts); | ||
} | ||
function assertDeclareExportAllDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclareExportAllDeclaration(node, opts = {}) { | ||
assert("DeclareExportAllDeclaration", node, opts); | ||
} | ||
function assertDeclaredPredicate(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclaredPredicate(node, opts = {}) { | ||
assert("DeclaredPredicate", node, opts); | ||
} | ||
function assertExistsTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExistsTypeAnnotation(node, opts = {}) { | ||
assert("ExistsTypeAnnotation", node, opts); | ||
} | ||
function assertFunctionTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFunctionTypeAnnotation(node, opts = {}) { | ||
assert("FunctionTypeAnnotation", node, opts); | ||
} | ||
function assertFunctionTypeParam(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFunctionTypeParam(node, opts = {}) { | ||
assert("FunctionTypeParam", node, opts); | ||
} | ||
function assertGenericTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertGenericTypeAnnotation(node, opts = {}) { | ||
assert("GenericTypeAnnotation", node, opts); | ||
} | ||
function assertInferredPredicate(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertInferredPredicate(node, opts = {}) { | ||
assert("InferredPredicate", node, opts); | ||
} | ||
function assertInterfaceExtends(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertInterfaceExtends(node, opts = {}) { | ||
assert("InterfaceExtends", node, opts); | ||
} | ||
function assertInterfaceDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertInterfaceDeclaration(node, opts = {}) { | ||
assert("InterfaceDeclaration", node, opts); | ||
} | ||
function assertIntersectionTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertIntersectionTypeAnnotation(node, opts = {}) { | ||
assert("IntersectionTypeAnnotation", node, opts); | ||
} | ||
function assertMixedTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertMixedTypeAnnotation(node, opts = {}) { | ||
assert("MixedTypeAnnotation", node, opts); | ||
} | ||
function assertEmptyTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertEmptyTypeAnnotation(node, opts = {}) { | ||
assert("EmptyTypeAnnotation", node, opts); | ||
} | ||
function assertNullableTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertNullableTypeAnnotation(node, opts = {}) { | ||
assert("NullableTypeAnnotation", node, opts); | ||
} | ||
function assertNumberLiteralTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertNumberLiteralTypeAnnotation(node, opts = {}) { | ||
assert("NumberLiteralTypeAnnotation", node, opts); | ||
} | ||
function assertNumberTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertNumberTypeAnnotation(node, opts = {}) { | ||
assert("NumberTypeAnnotation", node, opts); | ||
} | ||
function assertObjectTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectTypeAnnotation(node, opts = {}) { | ||
assert("ObjectTypeAnnotation", node, opts); | ||
} | ||
function assertObjectTypeCallProperty(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectTypeCallProperty(node, opts = {}) { | ||
assert("ObjectTypeCallProperty", node, opts); | ||
} | ||
function assertObjectTypeIndexer(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectTypeIndexer(node, opts = {}) { | ||
assert("ObjectTypeIndexer", node, opts); | ||
} | ||
function assertObjectTypeProperty(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectTypeProperty(node, opts = {}) { | ||
assert("ObjectTypeProperty", node, opts); | ||
} | ||
function assertObjectTypeSpreadProperty(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectTypeSpreadProperty(node, opts = {}) { | ||
assert("ObjectTypeSpreadProperty", node, opts); | ||
} | ||
function assertOpaqueType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertOpaqueType(node, opts = {}) { | ||
assert("OpaqueType", node, opts); | ||
} | ||
function assertQualifiedTypeIdentifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertQualifiedTypeIdentifier(node, opts = {}) { | ||
assert("QualifiedTypeIdentifier", node, opts); | ||
} | ||
function assertStringLiteralTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertStringLiteralTypeAnnotation(node, opts = {}) { | ||
assert("StringLiteralTypeAnnotation", node, opts); | ||
} | ||
function assertStringTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertStringTypeAnnotation(node, opts = {}) { | ||
assert("StringTypeAnnotation", node, opts); | ||
} | ||
function assertThisTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertThisTypeAnnotation(node, opts = {}) { | ||
assert("ThisTypeAnnotation", node, opts); | ||
} | ||
function assertTupleTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTupleTypeAnnotation(node, opts = {}) { | ||
assert("TupleTypeAnnotation", node, opts); | ||
} | ||
function assertTypeofTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTypeofTypeAnnotation(node, opts = {}) { | ||
assert("TypeofTypeAnnotation", node, opts); | ||
} | ||
function assertTypeAlias(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTypeAlias(node, opts = {}) { | ||
assert("TypeAlias", node, opts); | ||
} | ||
function assertTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTypeAnnotation(node, opts = {}) { | ||
assert("TypeAnnotation", node, opts); | ||
} | ||
function assertTypeCastExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTypeCastExpression(node, opts = {}) { | ||
assert("TypeCastExpression", node, opts); | ||
} | ||
function assertTypeParameter(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTypeParameter(node, opts = {}) { | ||
assert("TypeParameter", node, opts); | ||
} | ||
function assertTypeParameterDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTypeParameterDeclaration(node, opts = {}) { | ||
assert("TypeParameterDeclaration", node, opts); | ||
} | ||
function assertTypeParameterInstantiation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTypeParameterInstantiation(node, opts = {}) { | ||
assert("TypeParameterInstantiation", node, opts); | ||
} | ||
function assertUnionTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertUnionTypeAnnotation(node, opts = {}) { | ||
assert("UnionTypeAnnotation", node, opts); | ||
} | ||
function assertVariance(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertVariance(node, opts = {}) { | ||
assert("Variance", node, opts); | ||
} | ||
function assertVoidTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertVoidTypeAnnotation(node, opts = {}) { | ||
assert("VoidTypeAnnotation", node, opts); | ||
} | ||
function assertJSXAttribute(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXAttribute(node, opts = {}) { | ||
assert("JSXAttribute", node, opts); | ||
} | ||
function assertJSXClosingElement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXClosingElement(node, opts = {}) { | ||
assert("JSXClosingElement", node, opts); | ||
} | ||
function assertJSXElement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXElement(node, opts = {}) { | ||
assert("JSXElement", node, opts); | ||
} | ||
function assertJSXEmptyExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXEmptyExpression(node, opts = {}) { | ||
assert("JSXEmptyExpression", node, opts); | ||
} | ||
function assertJSXExpressionContainer(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXExpressionContainer(node, opts = {}) { | ||
assert("JSXExpressionContainer", node, opts); | ||
} | ||
function assertJSXSpreadChild(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXSpreadChild(node, opts = {}) { | ||
assert("JSXSpreadChild", node, opts); | ||
} | ||
function assertJSXIdentifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXIdentifier(node, opts = {}) { | ||
assert("JSXIdentifier", node, opts); | ||
} | ||
function assertJSXMemberExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXMemberExpression(node, opts = {}) { | ||
assert("JSXMemberExpression", node, opts); | ||
} | ||
function assertJSXNamespacedName(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXNamespacedName(node, opts = {}) { | ||
assert("JSXNamespacedName", node, opts); | ||
} | ||
function assertJSXOpeningElement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXOpeningElement(node, opts = {}) { | ||
assert("JSXOpeningElement", node, opts); | ||
} | ||
function assertJSXSpreadAttribute(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXSpreadAttribute(node, opts = {}) { | ||
assert("JSXSpreadAttribute", node, opts); | ||
} | ||
function assertJSXText(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXText(node, opts = {}) { | ||
assert("JSXText", node, opts); | ||
} | ||
function assertJSXFragment(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXFragment(node, opts = {}) { | ||
assert("JSXFragment", node, opts); | ||
} | ||
function assertJSXOpeningFragment(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXOpeningFragment(node, opts = {}) { | ||
assert("JSXOpeningFragment", node, opts); | ||
} | ||
function assertJSXClosingFragment(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSXClosingFragment(node, opts = {}) { | ||
assert("JSXClosingFragment", node, opts); | ||
} | ||
function assertNoop(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertNoop(node, opts = {}) { | ||
assert("Noop", node, opts); | ||
} | ||
function assertParenthesizedExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertParenthesizedExpression(node, opts = {}) { | ||
assert("ParenthesizedExpression", node, opts); | ||
} | ||
function assertAwaitExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertAwaitExpression(node, opts = {}) { | ||
assert("AwaitExpression", node, opts); | ||
} | ||
function assertBindExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBindExpression(node, opts = {}) { | ||
assert("BindExpression", node, opts); | ||
} | ||
function assertClassProperty(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertClassProperty(node, opts = {}) { | ||
assert("ClassProperty", node, opts); | ||
} | ||
function assertOptionalMemberExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertOptionalMemberExpression(node, opts = {}) { | ||
assert("OptionalMemberExpression", node, opts); | ||
} | ||
function assertOptionalCallExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertOptionalCallExpression(node, opts = {}) { | ||
assert("OptionalCallExpression", node, opts); | ||
} | ||
function assertClassPrivateProperty(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertClassPrivateProperty(node, opts = {}) { | ||
assert("ClassPrivateProperty", node, opts); | ||
} | ||
function assertImport(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertImport(node, opts = {}) { | ||
assert("Import", node, opts); | ||
} | ||
function assertDecorator(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDecorator(node, opts = {}) { | ||
assert("Decorator", node, opts); | ||
} | ||
function assertDoExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDoExpression(node, opts = {}) { | ||
assert("DoExpression", node, opts); | ||
} | ||
function assertExportDefaultSpecifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExportDefaultSpecifier(node, opts = {}) { | ||
assert("ExportDefaultSpecifier", node, opts); | ||
} | ||
function assertExportNamespaceSpecifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExportNamespaceSpecifier(node, opts = {}) { | ||
assert("ExportNamespaceSpecifier", node, opts); | ||
} | ||
function assertPrivateName(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertPrivateName(node, opts = {}) { | ||
assert("PrivateName", node, opts); | ||
} | ||
function assertTSParameterProperty(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSParameterProperty(node, opts = {}) { | ||
assert("TSParameterProperty", node, opts); | ||
} | ||
function assertTSDeclareFunction(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSDeclareFunction(node, opts = {}) { | ||
assert("TSDeclareFunction", node, opts); | ||
} | ||
function assertTSDeclareMethod(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSDeclareMethod(node, opts = {}) { | ||
assert("TSDeclareMethod", node, opts); | ||
} | ||
function assertTSQualifiedName(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSQualifiedName(node, opts = {}) { | ||
assert("TSQualifiedName", node, opts); | ||
} | ||
function assertTSCallSignatureDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSCallSignatureDeclaration(node, opts = {}) { | ||
assert("TSCallSignatureDeclaration", node, opts); | ||
} | ||
function assertTSConstructSignatureDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSConstructSignatureDeclaration(node, opts = {}) { | ||
assert("TSConstructSignatureDeclaration", node, opts); | ||
} | ||
function assertTSPropertySignature(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSPropertySignature(node, opts = {}) { | ||
assert("TSPropertySignature", node, opts); | ||
} | ||
function assertTSMethodSignature(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSMethodSignature(node, opts = {}) { | ||
assert("TSMethodSignature", node, opts); | ||
} | ||
function assertTSIndexSignature(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSIndexSignature(node, opts = {}) { | ||
assert("TSIndexSignature", node, opts); | ||
} | ||
function assertTSAnyKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSAnyKeyword(node, opts = {}) { | ||
assert("TSAnyKeyword", node, opts); | ||
} | ||
function assertTSNumberKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSNumberKeyword(node, opts = {}) { | ||
assert("TSNumberKeyword", node, opts); | ||
} | ||
function assertTSObjectKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSObjectKeyword(node, opts = {}) { | ||
assert("TSObjectKeyword", node, opts); | ||
} | ||
function assertTSBooleanKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSBooleanKeyword(node, opts = {}) { | ||
assert("TSBooleanKeyword", node, opts); | ||
} | ||
function assertTSStringKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSStringKeyword(node, opts = {}) { | ||
assert("TSStringKeyword", node, opts); | ||
} | ||
function assertTSSymbolKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSSymbolKeyword(node, opts = {}) { | ||
assert("TSSymbolKeyword", node, opts); | ||
} | ||
function assertTSVoidKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSVoidKeyword(node, opts = {}) { | ||
assert("TSVoidKeyword", node, opts); | ||
} | ||
function assertTSUndefinedKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSUndefinedKeyword(node, opts = {}) { | ||
assert("TSUndefinedKeyword", node, opts); | ||
} | ||
function assertTSNullKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSNullKeyword(node, opts = {}) { | ||
assert("TSNullKeyword", node, opts); | ||
} | ||
function assertTSNeverKeyword(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSNeverKeyword(node, opts = {}) { | ||
assert("TSNeverKeyword", node, opts); | ||
} | ||
function assertTSThisType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSThisType(node, opts = {}) { | ||
assert("TSThisType", node, opts); | ||
} | ||
function assertTSFunctionType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSFunctionType(node, opts = {}) { | ||
assert("TSFunctionType", node, opts); | ||
} | ||
function assertTSConstructorType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSConstructorType(node, opts = {}) { | ||
assert("TSConstructorType", node, opts); | ||
} | ||
function assertTSTypeReference(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeReference(node, opts = {}) { | ||
assert("TSTypeReference", node, opts); | ||
} | ||
function assertTSTypePredicate(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypePredicate(node, opts = {}) { | ||
assert("TSTypePredicate", node, opts); | ||
} | ||
function assertTSTypeQuery(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeQuery(node, opts = {}) { | ||
assert("TSTypeQuery", node, opts); | ||
} | ||
function assertTSTypeLiteral(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeLiteral(node, opts = {}) { | ||
assert("TSTypeLiteral", node, opts); | ||
} | ||
function assertTSArrayType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSArrayType(node, opts = {}) { | ||
assert("TSArrayType", node, opts); | ||
} | ||
function assertTSTupleType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTupleType(node, opts = {}) { | ||
assert("TSTupleType", node, opts); | ||
} | ||
function assertTSUnionType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSUnionType(node, opts = {}) { | ||
assert("TSUnionType", node, opts); | ||
} | ||
function assertTSIntersectionType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSIntersectionType(node, opts = {}) { | ||
assert("TSIntersectionType", node, opts); | ||
} | ||
function assertTSConditionalType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSConditionalType(node, opts = {}) { | ||
assert("TSConditionalType", node, opts); | ||
} | ||
function assertTSInferType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSInferType(node, opts = {}) { | ||
assert("TSInferType", node, opts); | ||
} | ||
function assertTSParenthesizedType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSParenthesizedType(node, opts = {}) { | ||
assert("TSParenthesizedType", node, opts); | ||
} | ||
function assertTSTypeOperator(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeOperator(node, opts = {}) { | ||
assert("TSTypeOperator", node, opts); | ||
} | ||
function assertTSIndexedAccessType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSIndexedAccessType(node, opts = {}) { | ||
assert("TSIndexedAccessType", node, opts); | ||
} | ||
function assertTSMappedType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSMappedType(node, opts = {}) { | ||
assert("TSMappedType", node, opts); | ||
} | ||
function assertTSLiteralType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSLiteralType(node, opts = {}) { | ||
assert("TSLiteralType", node, opts); | ||
} | ||
function assertTSExpressionWithTypeArguments(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSExpressionWithTypeArguments(node, opts = {}) { | ||
assert("TSExpressionWithTypeArguments", node, opts); | ||
} | ||
function assertTSInterfaceDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSInterfaceDeclaration(node, opts = {}) { | ||
assert("TSInterfaceDeclaration", node, opts); | ||
} | ||
function assertTSInterfaceBody(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSInterfaceBody(node, opts = {}) { | ||
assert("TSInterfaceBody", node, opts); | ||
} | ||
function assertTSTypeAliasDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeAliasDeclaration(node, opts = {}) { | ||
assert("TSTypeAliasDeclaration", node, opts); | ||
} | ||
function assertTSAsExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSAsExpression(node, opts = {}) { | ||
assert("TSAsExpression", node, opts); | ||
} | ||
function assertTSTypeAssertion(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeAssertion(node, opts = {}) { | ||
assert("TSTypeAssertion", node, opts); | ||
} | ||
function assertTSEnumDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSEnumDeclaration(node, opts = {}) { | ||
assert("TSEnumDeclaration", node, opts); | ||
} | ||
function assertTSEnumMember(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSEnumMember(node, opts = {}) { | ||
assert("TSEnumMember", node, opts); | ||
} | ||
function assertTSModuleDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSModuleDeclaration(node, opts = {}) { | ||
assert("TSModuleDeclaration", node, opts); | ||
} | ||
function assertTSModuleBlock(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSModuleBlock(node, opts = {}) { | ||
assert("TSModuleBlock", node, opts); | ||
} | ||
function assertTSImportEqualsDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSImportEqualsDeclaration(node, opts = {}) { | ||
assert("TSImportEqualsDeclaration", node, opts); | ||
} | ||
function assertTSExternalModuleReference(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSExternalModuleReference(node, opts = {}) { | ||
assert("TSExternalModuleReference", node, opts); | ||
} | ||
function assertTSNonNullExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSNonNullExpression(node, opts = {}) { | ||
assert("TSNonNullExpression", node, opts); | ||
} | ||
function assertTSExportAssignment(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSExportAssignment(node, opts = {}) { | ||
assert("TSExportAssignment", node, opts); | ||
} | ||
function assertTSNamespaceExportDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSNamespaceExportDeclaration(node, opts = {}) { | ||
assert("TSNamespaceExportDeclaration", node, opts); | ||
} | ||
function assertTSTypeAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeAnnotation(node, opts = {}) { | ||
assert("TSTypeAnnotation", node, opts); | ||
} | ||
function assertTSTypeParameterInstantiation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeParameterInstantiation(node, opts = {}) { | ||
assert("TSTypeParameterInstantiation", node, opts); | ||
} | ||
function assertTSTypeParameterDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeParameterDeclaration(node, opts = {}) { | ||
assert("TSTypeParameterDeclaration", node, opts); | ||
} | ||
function assertTSTypeParameter(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeParameter(node, opts = {}) { | ||
assert("TSTypeParameter", node, opts); | ||
} | ||
function assertExpression(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExpression(node, opts = {}) { | ||
assert("Expression", node, opts); | ||
} | ||
function assertBinary(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBinary(node, opts = {}) { | ||
assert("Binary", node, opts); | ||
} | ||
function assertScopable(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertScopable(node, opts = {}) { | ||
assert("Scopable", node, opts); | ||
} | ||
function assertBlockParent(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBlockParent(node, opts = {}) { | ||
assert("BlockParent", node, opts); | ||
} | ||
function assertBlock(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertBlock(node, opts = {}) { | ||
assert("Block", node, opts); | ||
} | ||
function assertStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertStatement(node, opts = {}) { | ||
assert("Statement", node, opts); | ||
} | ||
function assertTerminatorless(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTerminatorless(node, opts = {}) { | ||
assert("Terminatorless", node, opts); | ||
} | ||
function assertCompletionStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertCompletionStatement(node, opts = {}) { | ||
assert("CompletionStatement", node, opts); | ||
} | ||
function assertConditional(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertConditional(node, opts = {}) { | ||
assert("Conditional", node, opts); | ||
} | ||
function assertLoop(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertLoop(node, opts = {}) { | ||
assert("Loop", node, opts); | ||
} | ||
function assertWhile(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertWhile(node, opts = {}) { | ||
assert("While", node, opts); | ||
} | ||
function assertExpressionWrapper(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExpressionWrapper(node, opts = {}) { | ||
assert("ExpressionWrapper", node, opts); | ||
} | ||
function assertFor(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFor(node, opts = {}) { | ||
assert("For", node, opts); | ||
} | ||
function assertForXStatement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertForXStatement(node, opts = {}) { | ||
assert("ForXStatement", node, opts); | ||
} | ||
function assertFunction(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFunction(node, opts = {}) { | ||
assert("Function", node, opts); | ||
} | ||
function assertFunctionParent(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFunctionParent(node, opts = {}) { | ||
assert("FunctionParent", node, opts); | ||
} | ||
function assertPureish(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertPureish(node, opts = {}) { | ||
assert("Pureish", node, opts); | ||
} | ||
function assertDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertDeclaration(node, opts = {}) { | ||
assert("Declaration", node, opts); | ||
} | ||
function assertPatternLike(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertPatternLike(node, opts = {}) { | ||
assert("PatternLike", node, opts); | ||
} | ||
function assertLVal(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertLVal(node, opts = {}) { | ||
assert("LVal", node, opts); | ||
} | ||
function assertTSEntityName(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSEntityName(node, opts = {}) { | ||
assert("TSEntityName", node, opts); | ||
} | ||
function assertLiteral(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertLiteral(node, opts = {}) { | ||
assert("Literal", node, opts); | ||
} | ||
function assertImmutable(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertImmutable(node, opts = {}) { | ||
assert("Immutable", node, opts); | ||
} | ||
function assertUserWhitespacable(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertUserWhitespacable(node, opts = {}) { | ||
assert("UserWhitespacable", node, opts); | ||
} | ||
function assertMethod(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertMethod(node, opts = {}) { | ||
assert("Method", node, opts); | ||
} | ||
function assertObjectMember(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertObjectMember(node, opts = {}) { | ||
assert("ObjectMember", node, opts); | ||
} | ||
function assertProperty(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertProperty(node, opts = {}) { | ||
assert("Property", node, opts); | ||
} | ||
function assertUnaryLike(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertUnaryLike(node, opts = {}) { | ||
assert("UnaryLike", node, opts); | ||
} | ||
function assertPattern(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertPattern(node, opts = {}) { | ||
assert("Pattern", node, opts); | ||
} | ||
function assertClass(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertClass(node, opts = {}) { | ||
assert("Class", node, opts); | ||
} | ||
function assertModuleDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertModuleDeclaration(node, opts = {}) { | ||
assert("ModuleDeclaration", node, opts); | ||
} | ||
function assertExportDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertExportDeclaration(node, opts = {}) { | ||
assert("ExportDeclaration", node, opts); | ||
} | ||
function assertModuleSpecifier(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertModuleSpecifier(node, opts = {}) { | ||
assert("ModuleSpecifier", node, opts); | ||
} | ||
function assertFlow(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFlow(node, opts = {}) { | ||
assert("Flow", node, opts); | ||
} | ||
function assertFlowType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFlowType(node, opts = {}) { | ||
assert("FlowType", node, opts); | ||
} | ||
function assertFlowBaseAnnotation(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFlowBaseAnnotation(node, opts = {}) { | ||
assert("FlowBaseAnnotation", node, opts); | ||
} | ||
function assertFlowDeclaration(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFlowDeclaration(node, opts = {}) { | ||
assert("FlowDeclaration", node, opts); | ||
} | ||
function assertFlowPredicate(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertFlowPredicate(node, opts = {}) { | ||
assert("FlowPredicate", node, opts); | ||
} | ||
function assertJSX(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertJSX(node, opts = {}) { | ||
assert("JSX", node, opts); | ||
} | ||
function assertPrivate(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertPrivate(node, opts = {}) { | ||
assert("Private", node, opts); | ||
} | ||
function assertTSTypeElement(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSTypeElement(node, opts = {}) { | ||
assert("TSTypeElement", node, opts); | ||
} | ||
function assertTSType(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function assertTSType(node, opts = {}) { | ||
assert("TSType", node, opts); | ||
@@ -2279,0 +1275,0 @@ } |
@@ -9,3 +9,3 @@ "use strict"; | ||
function _clone() { | ||
var data = _interopRequireDefault(require("lodash/clone")); | ||
const data = _interopRequireDefault(require("lodash/clone")); | ||
@@ -25,21 +25,17 @@ _clone = function _clone() { | ||
function builder(type) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
function builder(type, ...args) { | ||
const keys = _definitions.BUILDER_KEYS[type]; | ||
const countArgs = args.length; | ||
var keys = _definitions.BUILDER_KEYS[type]; | ||
var countArgs = args.length; | ||
if (countArgs > keys.length) { | ||
throw new Error(type + ": Too many arguments passed. Received " + countArgs + " but can receive no more than " + keys.length); | ||
throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`); | ||
} | ||
var node = { | ||
type: type | ||
const node = { | ||
type | ||
}; | ||
var i = 0; | ||
keys.forEach(function (key) { | ||
var field = _definitions.NODE_FIELDS[type][key]; | ||
var arg; | ||
let i = 0; | ||
keys.forEach(key => { | ||
const field = _definitions.NODE_FIELDS[type][key]; | ||
let arg; | ||
if (i < countArgs) arg = args[i]; | ||
@@ -51,3 +47,3 @@ if (arg === undefined) arg = (0, _clone().default)(field.default); | ||
for (var key in node) { | ||
for (const key in node) { | ||
(0, _validate.default)(node, key, node[key]); | ||
@@ -54,0 +50,0 @@ } |
@@ -15,3 +15,3 @@ "use strict"; | ||
function createUnionTypeAnnotation(types) { | ||
var flattened = (0, _removeTypeDuplicates.default)(types); | ||
const flattened = (0, _removeTypeDuplicates.default)(types); | ||
@@ -18,0 +18,0 @@ if (flattened.length === 1) { |
@@ -15,6 +15,6 @@ "use strict"; | ||
function buildChildren(node) { | ||
var elements = []; | ||
const elements = []; | ||
for (var i = 0; i < node.children.length; i++) { | ||
var child = node.children[i]; | ||
for (let i = 0; i < node.children.length; i++) { | ||
let child = node.children[i]; | ||
@@ -21,0 +21,0 @@ if ((0, _generated.isJSXText)(child)) { |
@@ -10,3 +10,3 @@ "use strict"; | ||
var has = Function.call.bind(Object.prototype.hasOwnProperty); | ||
const has = Function.call.bind(Object.prototype.hasOwnProperty); | ||
@@ -23,5 +23,3 @@ function cloneIfNode(obj, deep) { | ||
if (Array.isArray(obj)) { | ||
return obj.map(function (node) { | ||
return cloneIfNode(node, deep); | ||
}); | ||
return obj.map(node => cloneIfNode(node, deep)); | ||
} | ||
@@ -32,11 +30,7 @@ | ||
function cloneNode(node, deep) { | ||
if (deep === void 0) { | ||
deep = true; | ||
} | ||
function cloneNode(node, deep = true) { | ||
if (!node) return node; | ||
var type = node.type; | ||
var newNode = { | ||
type: type | ||
const type = node.type; | ||
const newNode = { | ||
type | ||
}; | ||
@@ -47,3 +41,3 @@ | ||
} else if (!has(_definitions.NODE_FIELDS, type)) { | ||
throw new Error("Unknown node type: \"" + type + "\""); | ||
throw new Error(`Unknown node type: "${type}"`); | ||
} else { | ||
@@ -53,3 +47,3 @@ var _arr = Object.keys(_definitions.NODE_FIELDS[type]); | ||
for (var _i = 0; _i < _arr.length; _i++) { | ||
var field = _arr[_i]; | ||
const field = _arr[_i]; | ||
@@ -56,0 +50,0 @@ if (has(node, field)) { |
@@ -13,5 +13,5 @@ "use strict"; | ||
function cloneWithoutLoc(node) { | ||
var newNode = (0, _clone.default)(node); | ||
const newNode = (0, _clone.default)(node); | ||
newNode.loc = null; | ||
return newNode; | ||
} |
@@ -10,3 +10,3 @@ "use strict"; | ||
if (!comments || !node) return node; | ||
var key = type + "Comments"; | ||
const key = `${type}Comments`; | ||
@@ -13,0 +13,0 @@ if (node[key]) { |
@@ -11,3 +11,3 @@ "use strict"; | ||
function removeComments(node) { | ||
_constants.COMMENT_KEYS.forEach(function (key) { | ||
_constants.COMMENT_KEYS.forEach(key => { | ||
node[key] = null; | ||
@@ -14,0 +14,0 @@ }); |
@@ -10,85 +10,85 @@ "use strict"; | ||
var EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Expression"]; | ||
const EXPRESSION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Expression"]; | ||
exports.EXPRESSION_TYPES = EXPRESSION_TYPES; | ||
var BINARY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Binary"]; | ||
const BINARY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Binary"]; | ||
exports.BINARY_TYPES = BINARY_TYPES; | ||
var SCOPABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Scopable"]; | ||
const SCOPABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Scopable"]; | ||
exports.SCOPABLE_TYPES = SCOPABLE_TYPES; | ||
var BLOCKPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["BlockParent"]; | ||
const BLOCKPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["BlockParent"]; | ||
exports.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES; | ||
var BLOCK_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Block"]; | ||
const BLOCK_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Block"]; | ||
exports.BLOCK_TYPES = BLOCK_TYPES; | ||
var STATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Statement"]; | ||
const STATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Statement"]; | ||
exports.STATEMENT_TYPES = STATEMENT_TYPES; | ||
var TERMINATORLESS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Terminatorless"]; | ||
const TERMINATORLESS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Terminatorless"]; | ||
exports.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES; | ||
var COMPLETIONSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["CompletionStatement"]; | ||
const COMPLETIONSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["CompletionStatement"]; | ||
exports.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES; | ||
var CONDITIONAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Conditional"]; | ||
const CONDITIONAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Conditional"]; | ||
exports.CONDITIONAL_TYPES = CONDITIONAL_TYPES; | ||
var LOOP_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Loop"]; | ||
const LOOP_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Loop"]; | ||
exports.LOOP_TYPES = LOOP_TYPES; | ||
var WHILE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["While"]; | ||
const WHILE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["While"]; | ||
exports.WHILE_TYPES = WHILE_TYPES; | ||
var EXPRESSIONWRAPPER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExpressionWrapper"]; | ||
const EXPRESSIONWRAPPER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExpressionWrapper"]; | ||
exports.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES; | ||
var FOR_TYPES = _definitions.FLIPPED_ALIAS_KEYS["For"]; | ||
const FOR_TYPES = _definitions.FLIPPED_ALIAS_KEYS["For"]; | ||
exports.FOR_TYPES = FOR_TYPES; | ||
var FORXSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ForXStatement"]; | ||
const FORXSTATEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ForXStatement"]; | ||
exports.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES; | ||
var FUNCTION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Function"]; | ||
const FUNCTION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Function"]; | ||
exports.FUNCTION_TYPES = FUNCTION_TYPES; | ||
var FUNCTIONPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FunctionParent"]; | ||
const FUNCTIONPARENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FunctionParent"]; | ||
exports.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES; | ||
var PUREISH_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pureish"]; | ||
const PUREISH_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pureish"]; | ||
exports.PUREISH_TYPES = PUREISH_TYPES; | ||
var DECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Declaration"]; | ||
const DECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Declaration"]; | ||
exports.DECLARATION_TYPES = DECLARATION_TYPES; | ||
var PATTERNLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["PatternLike"]; | ||
const PATTERNLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["PatternLike"]; | ||
exports.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES; | ||
var LVAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["LVal"]; | ||
const LVAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["LVal"]; | ||
exports.LVAL_TYPES = LVAL_TYPES; | ||
var TSENTITYNAME_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSEntityName"]; | ||
const TSENTITYNAME_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSEntityName"]; | ||
exports.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES; | ||
var LITERAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Literal"]; | ||
const LITERAL_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Literal"]; | ||
exports.LITERAL_TYPES = LITERAL_TYPES; | ||
var IMMUTABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Immutable"]; | ||
const IMMUTABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Immutable"]; | ||
exports.IMMUTABLE_TYPES = IMMUTABLE_TYPES; | ||
var USERWHITESPACABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UserWhitespacable"]; | ||
const USERWHITESPACABLE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UserWhitespacable"]; | ||
exports.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES; | ||
var METHOD_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Method"]; | ||
const METHOD_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Method"]; | ||
exports.METHOD_TYPES = METHOD_TYPES; | ||
var OBJECTMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ObjectMember"]; | ||
const OBJECTMEMBER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ObjectMember"]; | ||
exports.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES; | ||
var PROPERTY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Property"]; | ||
const PROPERTY_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Property"]; | ||
exports.PROPERTY_TYPES = PROPERTY_TYPES; | ||
var UNARYLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UnaryLike"]; | ||
const UNARYLIKE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["UnaryLike"]; | ||
exports.UNARYLIKE_TYPES = UNARYLIKE_TYPES; | ||
var PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pattern"]; | ||
const PATTERN_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Pattern"]; | ||
exports.PATTERN_TYPES = PATTERN_TYPES; | ||
var CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Class"]; | ||
const CLASS_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Class"]; | ||
exports.CLASS_TYPES = CLASS_TYPES; | ||
var MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleDeclaration"]; | ||
const MODULEDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleDeclaration"]; | ||
exports.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES; | ||
var EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExportDeclaration"]; | ||
const EXPORTDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ExportDeclaration"]; | ||
exports.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES; | ||
var MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleSpecifier"]; | ||
const MODULESPECIFIER_TYPES = _definitions.FLIPPED_ALIAS_KEYS["ModuleSpecifier"]; | ||
exports.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES; | ||
var FLOW_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Flow"]; | ||
const FLOW_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Flow"]; | ||
exports.FLOW_TYPES = FLOW_TYPES; | ||
var FLOWTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowType"]; | ||
const FLOWTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowType"]; | ||
exports.FLOWTYPE_TYPES = FLOWTYPE_TYPES; | ||
var FLOWBASEANNOTATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"]; | ||
const FLOWBASEANNOTATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"]; | ||
exports.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES; | ||
var FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowDeclaration"]; | ||
const FLOWDECLARATION_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowDeclaration"]; | ||
exports.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES; | ||
var FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowPredicate"]; | ||
const FLOWPREDICATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["FlowPredicate"]; | ||
exports.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES; | ||
var JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS["JSX"]; | ||
const JSX_TYPES = _definitions.FLIPPED_ALIAS_KEYS["JSX"]; | ||
exports.JSX_TYPES = JSX_TYPES; | ||
var PRIVATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Private"]; | ||
const PRIVATE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["Private"]; | ||
exports.PRIVATE_TYPES = PRIVATE_TYPES; | ||
var TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSTypeElement"]; | ||
const TSTYPEELEMENT_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSTypeElement"]; | ||
exports.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES; | ||
var TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"]; | ||
const TSTYPE_TYPES = _definitions.FLIPPED_ALIAS_KEYS["TSType"]; | ||
exports.TSTYPE_TYPES = TSTYPE_TYPES; |
@@ -7,35 +7,35 @@ "use strict"; | ||
exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0; | ||
var STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; | ||
const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; | ||
exports.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS; | ||
var FLATTENABLE_KEYS = ["body", "expressions"]; | ||
const FLATTENABLE_KEYS = ["body", "expressions"]; | ||
exports.FLATTENABLE_KEYS = FLATTENABLE_KEYS; | ||
var FOR_INIT_KEYS = ["left", "init"]; | ||
const FOR_INIT_KEYS = ["left", "init"]; | ||
exports.FOR_INIT_KEYS = FOR_INIT_KEYS; | ||
var COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; | ||
const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; | ||
exports.COMMENT_KEYS = COMMENT_KEYS; | ||
var LOGICAL_OPERATORS = ["||", "&&", "??"]; | ||
const LOGICAL_OPERATORS = ["||", "&&", "??"]; | ||
exports.LOGICAL_OPERATORS = LOGICAL_OPERATORS; | ||
var UPDATE_OPERATORS = ["++", "--"]; | ||
const UPDATE_OPERATORS = ["++", "--"]; | ||
exports.UPDATE_OPERATORS = UPDATE_OPERATORS; | ||
var BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; | ||
const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; | ||
exports.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS; | ||
var EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="]; | ||
const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="]; | ||
exports.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS; | ||
var COMPARISON_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS.concat(["in", "instanceof"]); | ||
const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"]; | ||
exports.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS; | ||
var BOOLEAN_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS.concat(BOOLEAN_NUMBER_BINARY_OPERATORS); | ||
const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS]; | ||
exports.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS; | ||
var NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; | ||
const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; | ||
exports.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS; | ||
var BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS); | ||
const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS]; | ||
exports.BINARY_OPERATORS = BINARY_OPERATORS; | ||
var BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; | ||
const BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; | ||
exports.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS; | ||
var NUMBER_UNARY_OPERATORS = ["+", "-", "~"]; | ||
const NUMBER_UNARY_OPERATORS = ["+", "-", "~"]; | ||
exports.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS; | ||
var STRING_UNARY_OPERATORS = ["typeof"]; | ||
const STRING_UNARY_OPERATORS = ["typeof"]; | ||
exports.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS; | ||
var UNARY_OPERATORS = ["void", "throw"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS); | ||
const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS]; | ||
exports.UNARY_OPERATORS = UNARY_OPERATORS; | ||
var INHERIT_KEYS = { | ||
const INHERIT_KEYS = { | ||
optional: ["typeAnnotation", "typeParameters", "returnType"], | ||
@@ -45,5 +45,5 @@ force: ["start", "loc", "end"] | ||
exports.INHERIT_KEYS = INHERIT_KEYS; | ||
var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); | ||
const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); | ||
exports.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL; | ||
var NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding"); | ||
const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding"); | ||
exports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING; |
@@ -12,8 +12,4 @@ "use strict"; | ||
function ensureBlock(node, key) { | ||
if (key === void 0) { | ||
key = "body"; | ||
} | ||
function ensureBlock(node, key = "body") { | ||
return node[key] = (0, _toBlock.default)(node[key], node); | ||
} |
@@ -19,4 +19,4 @@ "use strict"; | ||
function gatherSequenceExpressions(nodes, scope, declars) { | ||
var exprs = []; | ||
var ensureLastUndefined = true; | ||
const exprs = []; | ||
let ensureLastUndefined = true; | ||
@@ -35,3 +35,3 @@ for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var node = _ref; | ||
const node = _ref; | ||
ensureLastUndefined = false; | ||
@@ -48,6 +48,6 @@ | ||
for (var _i2 = 0; _i2 < _arr.length; _i2++) { | ||
var declar = _arr[_i2]; | ||
var bindings = (0, _getBindingIdentifiers.default)(declar); | ||
const declar = _arr[_i2]; | ||
const bindings = (0, _getBindingIdentifiers.default)(declar); | ||
for (var key in bindings) { | ||
for (const key in bindings) { | ||
declars.push({ | ||
@@ -66,8 +66,8 @@ kind: node.kind, | ||
} else if ((0, _generated.isIfStatement)(node)) { | ||
var consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode(); | ||
var alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode(); | ||
const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode(); | ||
const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode(); | ||
if (!consequent || !alternate) return; | ||
exprs.push((0, _generated2.conditionalExpression)(node.test, consequent, alternate)); | ||
} else if ((0, _generated.isBlockStatement)(node)) { | ||
var body = gatherSequenceExpressions(node.body, scope, declars); | ||
const body = gatherSequenceExpressions(node.body, scope, declars); | ||
if (!body) return; | ||
@@ -74,0 +74,0 @@ exprs.push(body); |
@@ -17,3 +17,3 @@ "use strict"; | ||
var blockNodes = []; | ||
let blockNodes = []; | ||
@@ -20,0 +20,0 @@ if ((0, _generated.isEmptyStatement)(node)) { |
@@ -12,9 +12,5 @@ "use strict"; | ||
function toComputedKey(node, key) { | ||
if (key === void 0) { | ||
key = node.key || node.property; | ||
} | ||
function toComputedKey(node, key = node.key || node.property) { | ||
if (!node.computed && (0, _generated.isIdentifier)(key)) key = (0, _generated2.stringLiteral)(key.name); | ||
return key; | ||
} |
@@ -26,3 +26,3 @@ "use strict"; | ||
if (!(0, _generated.isExpression)(node)) { | ||
throw new Error("cannot turn " + node.type + " to an expression"); | ||
throw new Error(`cannot turn ${node.type} to an expression`); | ||
} | ||
@@ -29,0 +29,0 @@ |
@@ -21,3 +21,3 @@ "use strict"; | ||
if (!(0, _isValidIdentifier.default)(name)) { | ||
name = "_" + name; | ||
name = `_${name}`; | ||
} | ||
@@ -24,0 +24,0 @@ |
@@ -16,9 +16,5 @@ "use strict"; | ||
function toKeyAlias(node, key) { | ||
if (key === void 0) { | ||
key = node.key; | ||
} | ||
function toKeyAlias(node, key = node.key) { | ||
let alias; | ||
var alias; | ||
if (node.kind === "method") { | ||
@@ -35,7 +31,7 @@ return toKeyAlias.increment() + ""; | ||
if (node.computed) { | ||
alias = "[" + alias + "]"; | ||
alias = `[${alias}]`; | ||
} | ||
if (node.static) { | ||
alias = "static:" + alias; | ||
alias = `static:${alias}`; | ||
} | ||
@@ -42,0 +38,0 @@ |
@@ -14,8 +14,8 @@ "use strict"; | ||
if (!nodes || !nodes.length) return; | ||
var declars = []; | ||
var result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars); | ||
const declars = []; | ||
const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars); | ||
if (!result) return; | ||
for (var _i = 0; _i < declars.length; _i++) { | ||
var declar = declars[_i]; | ||
const declar = declars[_i]; | ||
scope.push(declar); | ||
@@ -22,0 +22,0 @@ } |
@@ -17,4 +17,4 @@ "use strict"; | ||
var mustHaveId = false; | ||
var newType; | ||
let mustHaveId = false; | ||
let newType; | ||
@@ -39,3 +39,3 @@ if ((0, _generated.isClass)(node)) { | ||
} else { | ||
throw new Error("cannot turn " + node.type + " to a statement"); | ||
throw new Error(`cannot turn ${node.type} to a statement`); | ||
} | ||
@@ -42,0 +42,0 @@ } |
@@ -9,3 +9,3 @@ "use strict"; | ||
function _isPlainObject() { | ||
var data = _interopRequireDefault(require("lodash/isPlainObject")); | ||
const data = _interopRequireDefault(require("lodash/isPlainObject")); | ||
@@ -20,3 +20,3 @@ _isPlainObject = function _isPlainObject() { | ||
function _isRegExp() { | ||
var data = _interopRequireDefault(require("lodash/isRegExp")); | ||
const data = _interopRequireDefault(require("lodash/isRegExp")); | ||
@@ -58,4 +58,4 @@ _isRegExp = function _isRegExp() { | ||
if ((0, _isRegExp().default)(value)) { | ||
var pattern = value.source; | ||
var flags = value.toString().match(/\/([a-z]+|)$/)[1]; | ||
const pattern = value.source; | ||
const flags = value.toString().match(/\/([a-z]+|)$/)[1]; | ||
return (0, _generated.regExpLiteral)(pattern, flags); | ||
@@ -69,6 +69,6 @@ } | ||
if ((0, _isPlainObject().default)(value)) { | ||
var props = []; | ||
const props = []; | ||
for (var key in value) { | ||
var nodeKey = void 0; | ||
for (const key in value) { | ||
let nodeKey; | ||
@@ -75,0 +75,0 @@ if ((0, _isValidIdentifier.default)(key)) { |
@@ -18,6 +18,2 @@ "use strict"; | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
(0, _utils.default)("ArrayExpression", { | ||
@@ -53,3 +49,3 @@ fields: { | ||
operator: { | ||
validate: _utils.assertOneOf.apply(void 0, _constants.BINARY_OPERATORS) | ||
validate: (0, _utils.assertOneOf)(..._constants.BINARY_OPERATORS) | ||
}, | ||
@@ -237,3 +233,3 @@ left: { | ||
}); | ||
var functionCommon = { | ||
const functionCommon = { | ||
params: { | ||
@@ -252,3 +248,3 @@ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("LVal"))) | ||
exports.functionCommon = functionCommon; | ||
var functionTypeAnnotationCommon = { | ||
const functionTypeAnnotationCommon = { | ||
returnType: { | ||
@@ -264,4 +260,3 @@ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), | ||
exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon; | ||
var functionDeclarationCommon = _objectSpread({}, functionCommon, { | ||
const functionDeclarationCommon = Object.assign({}, functionCommon, { | ||
declare: { | ||
@@ -276,3 +271,2 @@ validate: (0, _utils.assertValueType)("boolean"), | ||
}); | ||
exports.functionDeclarationCommon = functionDeclarationCommon; | ||
@@ -282,3 +276,3 @@ (0, _utils.default)("FunctionDeclaration", { | ||
visitor: ["id", "params", "body", "returnType", "typeParameters"], | ||
fields: _objectSpread({}, functionDeclarationCommon, functionTypeAnnotationCommon, { | ||
fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, { | ||
body: { | ||
@@ -293,3 +287,3 @@ validate: (0, _utils.assertNodeType)("BlockStatement") | ||
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], | ||
fields: _objectSpread({}, functionCommon, functionTypeAnnotationCommon, { | ||
fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { | ||
id: { | ||
@@ -304,3 +298,3 @@ validate: (0, _utils.assertNodeType)("Identifier"), | ||
}); | ||
var patternLikeCommon = { | ||
const patternLikeCommon = { | ||
typeAnnotation: { | ||
@@ -319,3 +313,3 @@ validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), | ||
aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"], | ||
fields: _objectSpread({}, patternLikeCommon, { | ||
fields: Object.assign({}, patternLikeCommon, { | ||
name: { | ||
@@ -411,3 +405,3 @@ validate: (0, _utils.chain)(function (node, key, val) { | ||
operator: { | ||
validate: _utils.assertOneOf.apply(void 0, _constants.LOGICAL_OPERATORS) | ||
validate: (0, _utils.assertOneOf)(..._constants.LOGICAL_OPERATORS) | ||
}, | ||
@@ -432,6 +426,6 @@ left: { | ||
validate: function () { | ||
var normal = (0, _utils.assertNodeType)("Identifier", "PrivateName"); | ||
var computed = (0, _utils.assertNodeType)("Expression"); | ||
const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName"); | ||
const computed = (0, _utils.assertNodeType)("Expression"); | ||
return function (node, key, val) { | ||
var validator = node.computed ? computed : normal; | ||
const validator = node.computed ? computed : normal; | ||
validator(node, key, val); | ||
@@ -485,3 +479,3 @@ }; | ||
builder: ["kind", "key", "params", "body", "computed"], | ||
fields: _objectSpread({}, functionCommon, functionTypeAnnotationCommon, { | ||
fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, { | ||
kind: { | ||
@@ -497,6 +491,6 @@ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("method", "get", "set")), | ||
validate: function () { | ||
var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); | ||
var computed = (0, _utils.assertNodeType)("Expression"); | ||
const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); | ||
const computed = (0, _utils.assertNodeType)("Expression"); | ||
return function (node, key, val) { | ||
var validator = node.computed ? computed : normal; | ||
const validator = node.computed ? computed : normal; | ||
validator(node, key, val); | ||
@@ -525,6 +519,6 @@ }; | ||
validate: function () { | ||
var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); | ||
var computed = (0, _utils.assertNodeType)("Expression"); | ||
const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); | ||
const computed = (0, _utils.assertNodeType)("Expression"); | ||
return function (node, key, val) { | ||
var validator = node.computed ? computed : normal; | ||
const validator = node.computed ? computed : normal; | ||
validator(node, key, val); | ||
@@ -554,3 +548,3 @@ }; | ||
deprecatedAlias: "RestProperty", | ||
fields: _objectSpread({}, patternLikeCommon, { | ||
fields: Object.assign({}, patternLikeCommon, { | ||
argument: { | ||
@@ -643,3 +637,3 @@ validate: (0, _utils.assertNodeType)("LVal") | ||
operator: { | ||
validate: _utils.assertOneOf.apply(void 0, _constants.UNARY_OPERATORS) | ||
validate: (0, _utils.assertOneOf)(..._constants.UNARY_OPERATORS) | ||
} | ||
@@ -660,3 +654,3 @@ }, | ||
operator: { | ||
validate: _utils.assertOneOf.apply(void 0, _constants.UPDATE_OPERATORS) | ||
validate: (0, _utils.assertOneOf)(..._constants.UPDATE_OPERATORS) | ||
} | ||
@@ -663,0 +657,0 @@ }, |
@@ -14,6 +14,2 @@ "use strict"; | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
(0, _utils.default)("AssignmentPattern", { | ||
@@ -23,3 +19,3 @@ visitor: ["left", "right"], | ||
aliases: ["Pattern", "PatternLike", "LVal"], | ||
fields: _objectSpread({}, _core.patternLikeCommon, { | ||
fields: Object.assign({}, _core.patternLikeCommon, { | ||
left: { | ||
@@ -40,3 +36,3 @@ validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern") | ||
aliases: ["Pattern", "PatternLike", "LVal"], | ||
fields: _objectSpread({}, _core.patternLikeCommon, { | ||
fields: Object.assign({}, _core.patternLikeCommon, { | ||
elements: { | ||
@@ -54,3 +50,3 @@ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("PatternLike"))) | ||
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], | ||
fields: _objectSpread({}, _core.functionCommon, _core.functionTypeAnnotationCommon, { | ||
fields: Object.assign({}, _core.functionCommon, _core.functionTypeAnnotationCommon, { | ||
expression: { | ||
@@ -72,3 +68,3 @@ validate: (0, _utils.assertValueType)("boolean") | ||
}); | ||
var classCommon = { | ||
const classCommon = { | ||
typeParameters: { | ||
@@ -98,3 +94,3 @@ validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), | ||
aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"], | ||
fields: _objectSpread({}, classCommon, { | ||
fields: Object.assign({}, classCommon, { | ||
declare: { | ||
@@ -121,3 +117,3 @@ validate: (0, _utils.assertValueType)("boolean"), | ||
aliases: ["Scopable", "Class", "Expression", "Pureish"], | ||
fields: _objectSpread({}, classCommon, { | ||
fields: Object.assign({}, classCommon, { | ||
id: { | ||
@@ -263,3 +259,3 @@ optional: true, | ||
}); | ||
var classMethodOrPropertyCommon = { | ||
const classMethodOrPropertyCommon = { | ||
abstract: { | ||
@@ -287,6 +283,6 @@ validate: (0, _utils.assertValueType)("boolean"), | ||
validate: (0, _utils.chain)(function () { | ||
var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); | ||
var computed = (0, _utils.assertNodeType)("Expression"); | ||
const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral"); | ||
const computed = (0, _utils.assertNodeType)("Expression"); | ||
return function (node, key, val) { | ||
var validator = node.computed ? computed : normal; | ||
const validator = node.computed ? computed : normal; | ||
validator(node, key, val); | ||
@@ -298,4 +294,3 @@ }; | ||
exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon; | ||
var classMethodOrDeclareMethodCommon = _objectSpread({}, _core.functionCommon, classMethodOrPropertyCommon, { | ||
const classMethodOrDeclareMethodCommon = Object.assign({}, _core.functionCommon, classMethodOrPropertyCommon, { | ||
kind: { | ||
@@ -314,3 +309,2 @@ validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("get", "set", "method", "constructor")), | ||
}); | ||
exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; | ||
@@ -321,3 +315,3 @@ (0, _utils.default)("ClassMethod", { | ||
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], | ||
fields: _objectSpread({}, classMethodOrDeclareMethodCommon, _core.functionTypeAnnotationCommon, { | ||
fields: Object.assign({}, classMethodOrDeclareMethodCommon, _core.functionTypeAnnotationCommon, { | ||
body: { | ||
@@ -332,3 +326,3 @@ validate: (0, _utils.assertNodeType)("BlockStatement") | ||
aliases: ["Pattern", "PatternLike", "LVal"], | ||
fields: _objectSpread({}, _core.patternLikeCommon, { | ||
fields: Object.assign({}, _core.patternLikeCommon, { | ||
properties: { | ||
@@ -335,0 +329,0 @@ validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty"))) |
@@ -9,6 +9,2 @@ "use strict"; | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
(0, _utils.default)("AwaitExpression", { | ||
@@ -33,3 +29,3 @@ builder: ["argument"], | ||
aliases: ["Property"], | ||
fields: _objectSpread({}, _es.classMethodOrPropertyCommon, { | ||
fields: Object.assign({}, _es.classMethodOrPropertyCommon, { | ||
value: { | ||
@@ -67,6 +63,6 @@ validate: (0, _utils.assertNodeType)("Expression"), | ||
validate: function () { | ||
var normal = (0, _utils.assertNodeType)("Identifier"); | ||
var computed = (0, _utils.assertNodeType)("Expression"); | ||
const normal = (0, _utils.assertNodeType)("Identifier"); | ||
const computed = (0, _utils.assertNodeType)("Expression"); | ||
return function (node, key, val) { | ||
var validator = node.computed ? computed : normal; | ||
const validator = node.computed ? computed : normal; | ||
validator(node, key, val); | ||
@@ -73,0 +69,0 @@ }; |
@@ -7,7 +7,3 @@ "use strict"; | ||
var defineInterfaceishType = function defineInterfaceishType(name, typeParameterType) { | ||
if (typeParameterType === void 0) { | ||
typeParameterType = "TypeParameterDeclaration"; | ||
} | ||
const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => { | ||
(0, _utils.default)(name, { | ||
@@ -14,0 +10,0 @@ builder: ["id", "typeParameters", "extends", "body"], |
@@ -45,3 +45,3 @@ "use strict"; | ||
function _toFastProperties() { | ||
var data = _interopRequireDefault(require("to-fast-properties")); | ||
const data = _interopRequireDefault(require("to-fast-properties")); | ||
@@ -79,3 +79,3 @@ _toFastProperties = function _toFastProperties() { | ||
(0, _toFastProperties().default)(_utils.DEPRECATED_KEYS); | ||
var TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS)); | ||
const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS)); | ||
exports.TYPES = TYPES; |
@@ -11,8 +11,4 @@ "use strict"; | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var bool = (0, _utils.assertValueType)("boolean"); | ||
var tSFunctionTypeAnnotationCommon = { | ||
const bool = (0, _utils.assertValueType)("boolean"); | ||
const tSFunctionTypeAnnotationCommon = { | ||
returnType: { | ||
@@ -47,7 +43,7 @@ validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"), | ||
visitor: ["id", "typeParameters", "params", "returnType"], | ||
fields: _objectSpread({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon) | ||
fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon) | ||
}); | ||
(0, _utils.default)("TSDeclareMethod", { | ||
visitor: ["decorators", "key", "typeParameters", "params", "returnType"], | ||
fields: _objectSpread({}, _es.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon) | ||
fields: Object.assign({}, _es.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon) | ||
}); | ||
@@ -62,3 +58,3 @@ (0, _utils.default)("TSQualifiedName", { | ||
}); | ||
var signatureDeclarationCommon = { | ||
const signatureDeclarationCommon = { | ||
typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), | ||
@@ -68,3 +64,3 @@ parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]), | ||
}; | ||
var callConstructSignatureDeclaration = { | ||
const callConstructSignatureDeclaration = { | ||
aliases: ["TSTypeElement"], | ||
@@ -76,3 +72,3 @@ visitor: ["typeParameters", "parameters", "typeAnnotation"], | ||
(0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration); | ||
var namedTypeElementCommon = { | ||
const namedTypeElementCommon = { | ||
key: (0, _utils.validateType)("Expression"), | ||
@@ -85,3 +81,3 @@ computed: (0, _utils.validate)(bool), | ||
visitor: ["key", "typeAnnotation", "initializer"], | ||
fields: _objectSpread({}, namedTypeElementCommon, { | ||
fields: Object.assign({}, namedTypeElementCommon, { | ||
readonly: (0, _utils.validateOptional)(bool), | ||
@@ -95,3 +91,3 @@ typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"), | ||
visitor: ["key", "typeParameters", "parameters", "typeAnnotation"], | ||
fields: _objectSpread({}, signatureDeclarationCommon, namedTypeElementCommon) | ||
fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon) | ||
}); | ||
@@ -107,6 +103,6 @@ (0, _utils.default)("TSIndexSignature", { | ||
}); | ||
var tsKeywordTypes = ["TSAnyKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSBooleanKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSVoidKeyword", "TSUndefinedKeyword", "TSNullKeyword", "TSNeverKeyword"]; | ||
const tsKeywordTypes = ["TSAnyKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSBooleanKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSVoidKeyword", "TSUndefinedKeyword", "TSNullKeyword", "TSNeverKeyword"]; | ||
for (var _i = 0; _i < tsKeywordTypes.length; _i++) { | ||
var type = tsKeywordTypes[_i]; | ||
const type = tsKeywordTypes[_i]; | ||
(0, _utils.default)(type, { | ||
@@ -124,3 +120,3 @@ aliases: ["TSType"], | ||
}); | ||
var fnOrCtr = { | ||
const fnOrCtr = { | ||
aliases: ["TSType"], | ||
@@ -176,3 +172,3 @@ visitor: ["typeParameters", "typeAnnotation"], | ||
}); | ||
var unionOrIntersection = { | ||
const unionOrIntersection = { | ||
aliases: ["TSType"], | ||
@@ -179,0 +175,0 @@ visitor: ["types"], |
@@ -27,13 +27,13 @@ "use strict"; | ||
var VISITOR_KEYS = {}; | ||
const VISITOR_KEYS = {}; | ||
exports.VISITOR_KEYS = VISITOR_KEYS; | ||
var ALIAS_KEYS = {}; | ||
const ALIAS_KEYS = {}; | ||
exports.ALIAS_KEYS = ALIAS_KEYS; | ||
var FLIPPED_ALIAS_KEYS = {}; | ||
const FLIPPED_ALIAS_KEYS = {}; | ||
exports.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS; | ||
var NODE_FIELDS = {}; | ||
const NODE_FIELDS = {}; | ||
exports.NODE_FIELDS = NODE_FIELDS; | ||
var BUILDER_KEYS = {}; | ||
const BUILDER_KEYS = {}; | ||
exports.BUILDER_KEYS = BUILDER_KEYS; | ||
var DEPRECATED_KEYS = {}; | ||
const DEPRECATED_KEYS = {}; | ||
exports.DEPRECATED_KEYS = DEPRECATED_KEYS; | ||
@@ -55,3 +55,3 @@ | ||
return { | ||
validate: validate | ||
validate | ||
}; | ||
@@ -61,3 +61,3 @@ } | ||
function typeIs(typeName) { | ||
return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType.apply(void 0, typeName); | ||
return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName); | ||
} | ||
@@ -71,3 +71,3 @@ | ||
return { | ||
validate: validate, | ||
validate, | ||
optional: true | ||
@@ -100,4 +100,4 @@ }; | ||
for (var i = 0; i < val.length; i++) { | ||
callback(node, key + "[" + i + "]", val[i]); | ||
for (let i = 0; i < val.length; i++) { | ||
callback(node, `${key}[${i}]`, val[i]); | ||
} | ||
@@ -110,10 +110,6 @@ } | ||
function assertOneOf() { | ||
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { | ||
values[_key] = arguments[_key]; | ||
} | ||
function assertOneOf(...values) { | ||
function validate(node, key, val) { | ||
if (values.indexOf(val) < 0) { | ||
throw new TypeError("Property " + key + " expected value to be one of " + JSON.stringify(values) + " but got " + JSON.stringify(val)); | ||
throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`); | ||
} | ||
@@ -126,12 +122,8 @@ } | ||
function assertNodeType() { | ||
for (var _len2 = arguments.length, types = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
types[_key2] = arguments[_key2]; | ||
} | ||
function assertNodeType(...types) { | ||
function validate(node, key, val) { | ||
var valid = false; | ||
let valid = false; | ||
for (var _i = 0; _i < types.length; _i++) { | ||
var type = types[_i]; | ||
const type = types[_i]; | ||
@@ -145,3 +137,3 @@ if ((0, _is.default)(type, val)) { | ||
if (!valid) { | ||
throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " " + ("but instead got " + JSON.stringify(val && val.type))); | ||
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`); | ||
} | ||
@@ -154,12 +146,8 @@ } | ||
function assertNodeOrValueType() { | ||
for (var _len3 = arguments.length, types = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
types[_key3] = arguments[_key3]; | ||
} | ||
function assertNodeOrValueType(...types) { | ||
function validate(node, key, val) { | ||
var valid = false; | ||
let valid = false; | ||
for (var _i2 = 0; _i2 < types.length; _i2++) { | ||
var type = types[_i2]; | ||
const type = types[_i2]; | ||
@@ -173,3 +161,3 @@ if (getType(val) === type || (0, _is.default)(type, val)) { | ||
if (!valid) { | ||
throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " " + ("but instead got " + JSON.stringify(val && val.type))); | ||
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} ` + `but instead got ${JSON.stringify(val && val.type)}`); | ||
} | ||
@@ -184,6 +172,6 @@ } | ||
function validate(node, key, val) { | ||
var valid = getType(val) === type; | ||
const valid = getType(val) === type; | ||
if (!valid) { | ||
throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val)); | ||
throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`); | ||
} | ||
@@ -196,11 +184,7 @@ } | ||
function chain() { | ||
for (var _len4 = arguments.length, fns = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | ||
fns[_key4] = arguments[_key4]; | ||
} | ||
function validate() { | ||
function chain(...fns) { | ||
function validate(...args) { | ||
for (var _i3 = 0; _i3 < fns.length; _i3++) { | ||
var fn = fns[_i3]; | ||
fn.apply(void 0, arguments); | ||
const fn = fns[_i3]; | ||
fn(...args); | ||
} | ||
@@ -213,13 +197,9 @@ } | ||
function defineType(type, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function defineType(type, opts = {}) { | ||
const inherits = opts.inherits && store[opts.inherits] || {}; | ||
const fields = opts.fields || inherits.fields || {}; | ||
const visitor = opts.visitor || inherits.visitor || []; | ||
const aliases = opts.aliases || inherits.aliases || []; | ||
const builder = opts.builder || inherits.builder || opts.visitor || []; | ||
var inherits = opts.inherits && store[opts.inherits] || {}; | ||
var fields = opts.fields || inherits.fields || {}; | ||
var visitor = opts.visitor || inherits.visitor || []; | ||
var aliases = opts.aliases || inherits.aliases || []; | ||
var builder = opts.builder || inherits.builder || opts.visitor || []; | ||
if (opts.deprecatedAlias) { | ||
@@ -232,8 +212,8 @@ DEPRECATED_KEYS[opts.deprecatedAlias] = type; | ||
for (var _i4 = 0; _i4 < _arr.length; _i4++) { | ||
var _key5 = _arr[_i4]; | ||
fields[_key5] = fields[_key5] || {}; | ||
const key = _arr[_i4]; | ||
fields[key] = fields[key] || {}; | ||
} | ||
for (var key in fields) { | ||
var field = fields[key]; | ||
for (const key in fields) { | ||
const field = fields[key]; | ||
@@ -255,3 +235,3 @@ if (builder.indexOf(key) === -1) { | ||
ALIAS_KEYS[type] = opts.aliases = aliases; | ||
aliases.forEach(function (alias) { | ||
aliases.forEach(alias => { | ||
FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || []; | ||
@@ -263,2 +243,2 @@ FLIPPED_ALIAS_KEYS[alias].push(type); | ||
var store = {}; | ||
const store = {}; |
@@ -565,3 +565,3 @@ "use strict"; | ||
var react = { | ||
const react = { | ||
isReactComponent: _isReactComponent.default, | ||
@@ -568,0 +568,0 @@ isCompatTag: _isCompatTag.default, |
@@ -10,7 +10,3 @@ "use strict"; | ||
function appendToMemberExpression(member, append, computed) { | ||
if (computed === void 0) { | ||
computed = false; | ||
} | ||
function appendToMemberExpression(member, append, computed = false) { | ||
member.object = (0, _generated.memberExpression)(member.object, member.property, member.computed); | ||
@@ -17,0 +13,0 @@ member.property = append; |
@@ -11,9 +11,9 @@ "use strict"; | ||
function removeTypeDuplicates(nodes) { | ||
var generics = {}; | ||
var bases = {}; | ||
var typeGroups = []; | ||
var types = []; | ||
const generics = {}; | ||
const bases = {}; | ||
const typeGroups = []; | ||
const types = []; | ||
for (var i = 0; i < nodes.length; i++) { | ||
var node = nodes[i]; | ||
for (let i = 0; i < nodes.length; i++) { | ||
const node = nodes[i]; | ||
if (!node) continue; | ||
@@ -44,6 +44,6 @@ | ||
if ((0, _generated.isGenericTypeAnnotation)(node)) { | ||
var name = node.id.name; | ||
const name = node.id.name; | ||
if (generics[name]) { | ||
var existing = generics[name]; | ||
let existing = generics[name]; | ||
@@ -67,8 +67,8 @@ if (existing.typeParameters) { | ||
for (var type in bases) { | ||
for (const type in bases) { | ||
types.push(bases[type]); | ||
} | ||
for (var _name in generics) { | ||
types.push(generics[_name]); | ||
for (const name in generics) { | ||
types.push(generics[name]); | ||
} | ||
@@ -75,0 +75,0 @@ |
@@ -19,10 +19,10 @@ "use strict"; | ||
for (var _i = 0; _i < _arr.length; _i++) { | ||
var _key = _arr[_i]; | ||
const key = _arr[_i]; | ||
if (child[_key] == null) { | ||
child[_key] = parent[_key]; | ||
if (child[key] == null) { | ||
child[key] = parent[key]; | ||
} | ||
} | ||
for (var key in parent) { | ||
for (const key in parent) { | ||
if (key[0] === "_" && key !== "__clone") child[key] = parent[key]; | ||
@@ -34,4 +34,4 @@ } | ||
for (var _i2 = 0; _i2 < _arr2.length; _i2++) { | ||
var _key2 = _arr2[_i2]; | ||
child[_key2] = parent[_key2]; | ||
const key = _arr2[_i2]; | ||
child[key] = parent[key]; | ||
} | ||
@@ -38,0 +38,0 @@ |
@@ -10,13 +10,9 @@ "use strict"; | ||
var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; | ||
const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; | ||
var CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS); | ||
const CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS); | ||
function removeProperties(node, opts) { | ||
if (opts === void 0) { | ||
opts = {}; | ||
} | ||
function removeProperties(node, opts = {}) { | ||
const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; | ||
var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; | ||
for (var _iterator = map, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
@@ -34,11 +30,11 @@ var _ref; | ||
var _key = _ref; | ||
if (node[_key] != null) node[_key] = undefined; | ||
const key = _ref; | ||
if (node[key] != null) node[key] = undefined; | ||
} | ||
for (var key in node) { | ||
for (const key in node) { | ||
if (key[0] === "_" && node[key] != null) node[key] = undefined; | ||
} | ||
var symbols = Object.getOwnPropertySymbols(node); | ||
const symbols = Object.getOwnPropertySymbols(node); | ||
@@ -57,5 +53,5 @@ for (var _iterator2 = symbols, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { | ||
var sym = _ref2; | ||
const sym = _ref2; | ||
node[sym] = null; | ||
} | ||
} |
@@ -11,13 +11,13 @@ "use strict"; | ||
function getBindingIdentifiers(node, duplicates, outerOnly) { | ||
var search = [].concat(node); | ||
var ids = Object.create(null); | ||
let search = [].concat(node); | ||
const ids = Object.create(null); | ||
while (search.length) { | ||
var id = search.shift(); | ||
const id = search.shift(); | ||
if (!id) continue; | ||
var keys = getBindingIdentifiers.keys[id.type]; | ||
const keys = getBindingIdentifiers.keys[id.type]; | ||
if ((0, _generated.isIdentifier)(id)) { | ||
if (duplicates) { | ||
var _ids = ids[id.name] = ids[id.name] || []; | ||
const _ids = ids[id.name] = ids[id.name] || []; | ||
@@ -52,4 +52,4 @@ _ids.push(id); | ||
if (keys) { | ||
for (var i = 0; i < keys.length; i++) { | ||
var key = keys[i]; | ||
for (let i = 0; i < keys.length; i++) { | ||
const key = keys[i]; | ||
@@ -56,0 +56,0 @@ if (id[key]) { |
@@ -17,5 +17,5 @@ "use strict"; | ||
var _ref = handlers, | ||
enter = _ref.enter, | ||
exit = _ref.exit; | ||
const _ref = handlers, | ||
enter = _ref.enter, | ||
exit = _ref.exit; | ||
traverseSimpleImpl(node, enter, exit, state, []); | ||
@@ -25,3 +25,3 @@ } | ||
function traverseSimpleImpl(node, enter, exit, state, ancestors) { | ||
var keys = _definitions.VISITOR_KEYS[node.type]; | ||
const keys = _definitions.VISITOR_KEYS[node.type]; | ||
if (!keys) return; | ||
@@ -42,12 +42,12 @@ if (enter) enter(node, ancestors, state); | ||
var _key = _ref2; | ||
var subNode = node[_key]; | ||
const key = _ref2; | ||
const subNode = node[key]; | ||
if (Array.isArray(subNode)) { | ||
for (var i = 0; i < subNode.length; i++) { | ||
var child = subNode[i]; | ||
for (let i = 0; i < subNode.length; i++) { | ||
const child = subNode[i]; | ||
if (!child) continue; | ||
ancestors.push({ | ||
node: node, | ||
key: _key, | ||
node, | ||
key, | ||
index: i | ||
@@ -60,4 +60,4 @@ }); | ||
ancestors.push({ | ||
node: node, | ||
key: _key | ||
node, | ||
key | ||
}); | ||
@@ -64,0 +64,0 @@ traverseSimpleImpl(subNode, enter, exit, state, ancestors); |
@@ -12,3 +12,3 @@ "use strict"; | ||
if (!node) return; | ||
var keys = _definitions.VISITOR_KEYS[node.type]; | ||
const keys = _definitions.VISITOR_KEYS[node.type]; | ||
if (!keys) return; | ||
@@ -30,4 +30,4 @@ opts = opts || {}; | ||
var key = _ref; | ||
var subNode = node[key]; | ||
const key = _ref; | ||
const subNode = node[key]; | ||
@@ -47,4 +47,4 @@ if (Array.isArray(subNode)) { | ||
var _node = _ref2; | ||
traverseFast(_node, enter, opts); | ||
const node = _ref2; | ||
traverseFast(node, enter, opts); | ||
} | ||
@@ -51,0 +51,0 @@ } else { |
@@ -9,3 +9,3 @@ "use strict"; | ||
function _uniq() { | ||
var data = _interopRequireDefault(require("lodash/uniq")); | ||
const data = _interopRequireDefault(require("lodash/uniq")); | ||
@@ -12,0 +12,0 @@ _uniq = function _uniq() { |
@@ -11,6 +11,6 @@ "use strict"; | ||
function cleanJSXElementLiteralChild(child, args) { | ||
var lines = child.value.split(/\r\n|\n|\r/); | ||
var lastNonEmptyLine = 0; | ||
const lines = child.value.split(/\r\n|\n|\r/); | ||
let lastNonEmptyLine = 0; | ||
for (var i = 0; i < lines.length; i++) { | ||
for (let i = 0; i < lines.length; i++) { | ||
if (lines[i].match(/[^ \t]/)) { | ||
@@ -21,10 +21,10 @@ lastNonEmptyLine = i; | ||
var str = ""; | ||
let str = ""; | ||
for (var _i = 0; _i < lines.length; _i++) { | ||
var line = lines[_i]; | ||
var isFirstLine = _i === 0; | ||
var isLastLine = _i === lines.length - 1; | ||
var isLastNonEmptyLine = _i === lastNonEmptyLine; | ||
var trimmedLine = line.replace(/\t/g, " "); | ||
for (let i = 0; i < lines.length; i++) { | ||
const line = lines[i]; | ||
const isFirstLine = i === 0; | ||
const isLastLine = i === lines.length - 1; | ||
const isLastNonEmptyLine = i === lastNonEmptyLine; | ||
let trimmedLine = line.replace(/\t/g, " "); | ||
@@ -31,0 +31,0 @@ if (!isFirstLine) { |
@@ -9,7 +9,7 @@ "use strict"; | ||
function shallowEqual(actual, expected) { | ||
var keys = Object.keys(expected); | ||
const keys = Object.keys(expected); | ||
var _arr = keys; | ||
for (var _i = 0; _i < _arr.length; _i++) { | ||
var key = _arr[_i]; | ||
const key = _arr[_i]; | ||
@@ -16,0 +16,0 @@ if (actual[key] !== expected[key]) { |
@@ -13,6 +13,4 @@ "use strict"; | ||
function buildMatchMemberExpression(match, allowPartial) { | ||
var parts = match.split("."); | ||
return function (member) { | ||
return (0, _matchesPattern.default)(member, parts, allowPartial); | ||
}; | ||
const parts = match.split("."); | ||
return member => (0, _matchesPattern.default)(member, parts, allowPartial); | ||
} |
@@ -16,3 +16,3 @@ "use strict"; | ||
if (!node) return false; | ||
var matches = (0, _isType.default)(node.type, type); | ||
const matches = (0, _isType.default)(node.type, type); | ||
if (!matches) return false; | ||
@@ -19,0 +19,0 @@ |
@@ -13,8 +13,8 @@ "use strict"; | ||
function isBinding(node, parent) { | ||
var keys = _getBindingIdentifiers.default.keys[parent.type]; | ||
const keys = _getBindingIdentifiers.default.keys[parent.type]; | ||
if (keys) { | ||
for (var i = 0; i < keys.length; i++) { | ||
var key = keys[i]; | ||
var val = parent[key]; | ||
for (let i = 0; i < keys.length; i++) { | ||
const key = keys[i]; | ||
const val = parent[key]; | ||
@@ -21,0 +21,0 @@ if (Array.isArray(val)) { |
@@ -19,6 +19,6 @@ "use strict"; | ||
var fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type); | ||
const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type); | ||
for (var _i = 0; _i < fields.length; _i++) { | ||
var field = fields[_i]; | ||
const field = fields[_i]; | ||
@@ -38,3 +38,3 @@ if (typeof a[field] !== typeof b[field]) { | ||
for (var i = 0; i < a[field].length; i++) { | ||
for (let i = 0; i < a[field].length; i++) { | ||
if (!isNodesEquivalent(a[field][i], b[field][i])) { | ||
@@ -41,0 +41,0 @@ return false; |
@@ -13,3 +13,3 @@ "use strict"; | ||
if (_definitions.ALIAS_KEYS[targetType]) return false; | ||
var aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType]; | ||
const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType]; | ||
@@ -31,3 +31,3 @@ if (aliases) { | ||
var alias = _ref; | ||
const alias = _ref; | ||
if (nodeType === alias) return true; | ||
@@ -34,0 +34,0 @@ } |
@@ -12,3 +12,3 @@ "use strict"; | ||
var RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]); | ||
const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]); | ||
@@ -15,0 +15,0 @@ function isValidES3Identifier(name) { |
@@ -9,3 +9,3 @@ "use strict"; | ||
function _esutils() { | ||
var data = _interopRequireDefault(require("esutils")); | ||
const data = _interopRequireDefault(require("esutils")); | ||
@@ -12,0 +12,0 @@ _esutils = function _esutils() { |
@@ -12,5 +12,5 @@ "use strict"; | ||
if (!(0, _generated.isMemberExpression)(member)) return false; | ||
var parts = Array.isArray(match) ? match : match.split("."); | ||
var nodes = []; | ||
var node; | ||
const parts = Array.isArray(match) ? match : match.split("."); | ||
const nodes = []; | ||
let node; | ||
@@ -25,10 +25,10 @@ for (node = member; (0, _generated.isMemberExpression)(node); node = node.object) { | ||
for (var i = 0, j = nodes.length - 1; i < parts.length; i++, j--) { | ||
var _node = nodes[j]; | ||
var value = void 0; | ||
for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) { | ||
const node = nodes[j]; | ||
let value; | ||
if ((0, _generated.isIdentifier)(_node)) { | ||
value = _node.name; | ||
} else if ((0, _generated.isStringLiteral)(_node)) { | ||
value = _node.value; | ||
if ((0, _generated.isIdentifier)(node)) { | ||
value = node.name; | ||
} else if ((0, _generated.isStringLiteral)(node)) { | ||
value = node.value; | ||
} else { | ||
@@ -35,0 +35,0 @@ return false; |
@@ -12,4 +12,4 @@ "use strict"; | ||
var isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component"); | ||
const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component"); | ||
var _default = isReactComponent; | ||
exports.default = _default; |
@@ -12,5 +12,5 @@ "use strict"; | ||
if (!node) return; | ||
var fields = _definitions.NODE_FIELDS[node.type]; | ||
const fields = _definitions.NODE_FIELDS[node.type]; | ||
if (!fields) return; | ||
var field = fields[key]; | ||
const field = fields[key]; | ||
if (!field || !field.validate) return; | ||
@@ -17,0 +17,0 @@ if (field.optional && val == null) return; |
{ | ||
"name": "@babel/types", | ||
"version": "7.0.0-beta.46", | ||
"version": "7.0.0-beta.47", | ||
"description": "Babel Types is a Lodash-esque utility library for AST nodes", | ||
@@ -13,9 +13,9 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"esutils": "^2.0.2", | ||
"lodash": "^4.2.0", | ||
"lodash": "^4.17.5", | ||
"to-fast-properties": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/generator": "7.0.0-beta.46", | ||
"babylon": "7.0.0-beta.46" | ||
"@babel/generator": "7.0.0-beta.47", | ||
"babylon": "7.0.0-beta.47" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
617020
11499
Updatedlodash@^4.17.5