1 line
769 B
JSON
1 line
769 B
JSON
{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = toExpression;\n\nvar _generated = require(\"../validators/generated\");\n\nfunction toExpression(node) {\n if ((0, _generated.isExpressionStatement)(node)) {\n node = node.expression;\n }\n\n if ((0, _generated.isExpression)(node)) {\n return node;\n }\n\n if ((0, _generated.isClass)(node)) {\n node.type = \"ClassExpression\";\n } else if ((0, _generated.isFunction)(node)) {\n node.type = \"FunctionExpression\";\n }\n\n if (!(0, _generated.isExpression)(node)) {\n throw new Error(\"cannot turn \".concat(node.type, \" to an expression\"));\n }\n\n return node;\n}","map":null,"metadata":{},"sourceType":"script"} |