| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354 |
- "use strict";
- var _index = require("./index");
- var _index2 = _interopRequireDefault(_index);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- (0, _index2.default)("AssignmentPattern", {
- visitor: ["left", "right"],
- aliases: ["Pattern", "LVal"],
- fields: {
- left: {
- validate: (0, _index.assertNodeType)("Identifier")
- },
- right: {
- validate: (0, _index.assertNodeType)("Expression")
- },
- decorators: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
- }
- }
- });
- (0, _index2.default)("ArrayPattern", {
- visitor: ["elements", "typeAnnotation"],
- aliases: ["Pattern", "LVal"],
- fields: {
- elements: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Identifier", "Pattern", "RestElement")))
- },
- decorators: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
- }
- }
- });
- (0, _index2.default)("ArrowFunctionExpression", {
- builder: ["params", "body", "async"],
- visitor: ["params", "body", "returnType", "typeParameters"],
- aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
- fields: {
- params: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal")))
- },
- body: {
- validate: (0, _index.assertNodeType)("BlockStatement", "Expression")
- },
- async: {
- validate: (0, _index.assertValueType)("boolean"),
- default: false
- }
- }
- });
- (0, _index2.default)("ClassBody", {
- visitor: ["body"],
- fields: {
- body: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ClassMethod", "ClassProperty")))
- }
- }
- });
- (0, _index2.default)("ClassDeclaration", {
- builder: ["id", "superClass", "body", "decorators"],
- visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
- aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"],
- fields: {
- id: {
- validate: (0, _index.assertNodeType)("Identifier")
- },
- body: {
- validate: (0, _index.assertNodeType)("ClassBody")
- },
- superClass: {
- optional: true,
- validate: (0, _index.assertNodeType)("Expression")
- },
- decorators: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
- }
- }
- });
- (0, _index2.default)("ClassExpression", {
- inherits: "ClassDeclaration",
- aliases: ["Scopable", "Class", "Expression", "Pureish"],
- fields: {
- id: {
- optional: true,
- validate: (0, _index.assertNodeType)("Identifier")
- },
- body: {
- validate: (0, _index.assertNodeType)("ClassBody")
- },
- superClass: {
- optional: true,
- validate: (0, _index.assertNodeType)("Expression")
- },
- decorators: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
- }
- }
- });
- (0, _index2.default)("ExportAllDeclaration", {
- visitor: ["source"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
- fields: {
- source: {
- validate: (0, _index.assertNodeType)("StringLiteral")
- }
- }
- });
- (0, _index2.default)("ExportDefaultDeclaration", {
- visitor: ["declaration"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
- fields: {
- declaration: {
- validate: (0, _index.assertNodeType)("FunctionDeclaration", "ClassDeclaration", "Expression")
- }
- }
- });
- (0, _index2.default)("ExportNamedDeclaration", {
- visitor: ["declaration", "specifiers", "source"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
- fields: {
- declaration: {
- validate: (0, _index.assertNodeType)("Declaration"),
- optional: true
- },
- specifiers: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ExportSpecifier")))
- },
- source: {
- validate: (0, _index.assertNodeType)("StringLiteral"),
- optional: true
- }
- }
- });
- (0, _index2.default)("ExportSpecifier", {
- visitor: ["local", "exported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: (0, _index.assertNodeType)("Identifier")
- },
- exported: {
- validate: (0, _index.assertNodeType)("Identifier")
- }
- }
- });
- (0, _index2.default)("ForOfStatement", {
- visitor: ["left", "right", "body"],
- aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
- fields: {
- left: {
- validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal")
- },
- right: {
- validate: (0, _index.assertNodeType)("Expression")
- },
- body: {
- validate: (0, _index.assertNodeType)("Statement")
- }
- }
- });
- (0, _index2.default)("ImportDeclaration", {
- visitor: ["specifiers", "source"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration"],
- fields: {
- specifiers: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
- },
- source: {
- validate: (0, _index.assertNodeType)("StringLiteral")
- }
- }
- });
- (0, _index2.default)("ImportDefaultSpecifier", {
- visitor: ["local"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: (0, _index.assertNodeType)("Identifier")
- }
- }
- });
- (0, _index2.default)("ImportNamespaceSpecifier", {
- visitor: ["local"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: (0, _index.assertNodeType)("Identifier")
- }
- }
- });
- (0, _index2.default)("ImportSpecifier", {
- visitor: ["local", "imported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: (0, _index.assertNodeType)("Identifier")
- },
- imported: {
- validate: (0, _index.assertNodeType)("Identifier")
- },
- importKind: {
- validate: (0, _index.assertOneOf)(null, "type", "typeof")
- }
- }
- });
- (0, _index2.default)("MetaProperty", {
- visitor: ["meta", "property"],
- aliases: ["Expression"],
- fields: {
- meta: {
- validate: (0, _index.assertValueType)("string")
- },
- property: {
- validate: (0, _index.assertValueType)("string")
- }
- }
- });
- (0, _index2.default)("ClassMethod", {
- aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
- builder: ["kind", "key", "params", "body", "computed", "static"],
- visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
- fields: {
- kind: {
- validate: (0, _index.chain)((0, _index.assertValueType)("string"), (0, _index.assertOneOf)("get", "set", "method", "constructor")),
- default: "method"
- },
- computed: {
- default: false,
- validate: (0, _index.assertValueType)("boolean")
- },
- static: {
- default: false,
- validate: (0, _index.assertValueType)("boolean")
- },
- key: {
- validate: function validate(node, key, val) {
- var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
- _index.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
- }
- },
- params: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal")))
- },
- body: {
- validate: (0, _index.assertNodeType)("BlockStatement")
- },
- generator: {
- default: false,
- validate: (0, _index.assertValueType)("boolean")
- },
- async: {
- default: false,
- validate: (0, _index.assertValueType)("boolean")
- }
- }
- });
- (0, _index2.default)("ObjectPattern", {
- visitor: ["properties", "typeAnnotation"],
- aliases: ["Pattern", "LVal"],
- fields: {
- properties: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("RestProperty", "Property")))
- },
- decorators: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
- }
- }
- });
- (0, _index2.default)("SpreadElement", {
- visitor: ["argument"],
- aliases: ["UnaryLike"],
- fields: {
- argument: {
- validate: (0, _index.assertNodeType)("Expression")
- }
- }
- });
- (0, _index2.default)("Super", {
- aliases: ["Expression"]
- });
- (0, _index2.default)("TaggedTemplateExpression", {
- visitor: ["tag", "quasi"],
- aliases: ["Expression"],
- fields: {
- tag: {
- validate: (0, _index.assertNodeType)("Expression")
- },
- quasi: {
- validate: (0, _index.assertNodeType)("TemplateLiteral")
- }
- }
- });
- (0, _index2.default)("TemplateElement", {
- builder: ["value", "tail"],
- fields: {
- value: {},
- tail: {
- validate: (0, _index.assertValueType)("boolean"),
- default: false
- }
- }
- });
- (0, _index2.default)("TemplateLiteral", {
- visitor: ["quasis", "expressions"],
- aliases: ["Expression", "Literal"],
- fields: {
- quasis: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("TemplateElement")))
- },
- expressions: {
- validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression")))
- }
- }
- });
- (0, _index2.default)("YieldExpression", {
- builder: ["argument", "delegate"],
- visitor: ["argument"],
- aliases: ["Expression", "Terminatorless"],
- fields: {
- delegate: {
- validate: (0, _index.assertValueType)("boolean"),
- default: false
- },
- argument: {
- optional: true,
- validate: (0, _index.assertNodeType)("Expression")
- }
- }
- });
|