1 line
6.0 KiB
JSON
1 line
6.0 KiB
JSON
{"ast":null,"code":"\"use strict\";\n\nvar _utils = _interopRequireWildcard(require(\"./utils\"));\n\nfunction _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj.default = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\n(0, _utils.default)(\"JSXAttribute\", {\n visitor: [\"name\", \"value\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\", \"JSXNamespacedName\")\n },\n value: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"JSXElement\", \"JSXFragment\", \"StringLiteral\", \"JSXExpressionContainer\")\n }\n }\n});\n(0, _utils.default)(\"JSXClosingElement\", {\n visitor: [\"name\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\", \"JSXMemberExpression\", \"JSXNamespacedName\")\n }\n }\n});\n(0, _utils.default)(\"JSXElement\", {\n builder: [\"openingElement\", \"closingElement\", \"children\", \"selfClosing\"],\n visitor: [\"openingElement\", \"children\", \"closingElement\"],\n aliases: [\"JSX\", \"Immutable\", \"Expression\"],\n fields: {\n openingElement: {\n validate: (0, _utils.assertNodeType)(\"JSXOpeningElement\")\n },\n closingElement: {\n optional: true,\n validate: (0, _utils.assertNodeType)(\"JSXClosingElement\")\n },\n children: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"JSXText\", \"JSXExpressionContainer\", \"JSXSpreadChild\", \"JSXElement\", \"JSXFragment\")))\n }\n }\n});\n(0, _utils.default)(\"JSXEmptyExpression\", {\n aliases: [\"JSX\"]\n});\n(0, _utils.default)(\"JSXExpressionContainer\", {\n visitor: [\"expression\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n expression: {\n validate: (0, _utils.assertNodeType)(\"Expression\", \"JSXEmptyExpression\")\n }\n }\n});\n(0, _utils.default)(\"JSXSpreadChild\", {\n visitor: [\"expression\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n expression: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"JSXIdentifier\", {\n builder: [\"name\"],\n aliases: [\"JSX\"],\n fields: {\n name: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n }\n});\n(0, _utils.default)(\"JSXMemberExpression\", {\n visitor: [\"object\", \"property\"],\n aliases: [\"JSX\"],\n fields: {\n object: {\n validate: (0, _utils.assertNodeType)(\"JSXMemberExpression\", \"JSXIdentifier\")\n },\n property: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\")\n }\n }\n});\n(0, _utils.default)(\"JSXNamespacedName\", {\n visitor: [\"namespace\", \"name\"],\n aliases: [\"JSX\"],\n fields: {\n namespace: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\")\n },\n name: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\")\n }\n }\n});\n(0, _utils.default)(\"JSXOpeningElement\", {\n builder: [\"name\", \"attributes\", \"selfClosing\"],\n visitor: [\"name\", \"attributes\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: (0, _utils.assertNodeType)(\"JSXIdentifier\", \"JSXMemberExpression\", \"JSXNamespacedName\")\n },\n selfClosing: {\n default: false,\n validate: (0, _utils.assertValueType)(\"boolean\")\n },\n attributes: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"JSXAttribute\", \"JSXSpreadAttribute\")))\n },\n typeParameters: {\n validate: (0, _utils.assertNodeType)(\"TypeParameterInstantiation\", \"TSTypeParameterInstantiation\"),\n optional: true\n }\n }\n});\n(0, _utils.default)(\"JSXSpreadAttribute\", {\n visitor: [\"argument\"],\n aliases: [\"JSX\"],\n fields: {\n argument: {\n validate: (0, _utils.assertNodeType)(\"Expression\")\n }\n }\n});\n(0, _utils.default)(\"JSXText\", {\n aliases: [\"JSX\", \"Immutable\"],\n builder: [\"value\"],\n fields: {\n value: {\n validate: (0, _utils.assertValueType)(\"string\")\n }\n }\n});\n(0, _utils.default)(\"JSXFragment\", {\n builder: [\"openingFragment\", \"closingFragment\", \"children\"],\n visitor: [\"openingFragment\", \"children\", \"closingFragment\"],\n aliases: [\"JSX\", \"Immutable\", \"Expression\"],\n fields: {\n openingFragment: {\n validate: (0, _utils.assertNodeType)(\"JSXOpeningFragment\")\n },\n closingFragment: {\n validate: (0, _utils.assertNodeType)(\"JSXClosingFragment\")\n },\n children: {\n validate: (0, _utils.chain)((0, _utils.assertValueType)(\"array\"), (0, _utils.assertEach)((0, _utils.assertNodeType)(\"JSXText\", \"JSXExpressionContainer\", \"JSXSpreadChild\", \"JSXElement\", \"JSXFragment\")))\n }\n }\n});\n(0, _utils.default)(\"JSXOpeningFragment\", {\n aliases: [\"JSX\", \"Immutable\"]\n});\n(0, _utils.default)(\"JSXClosingFragment\", {\n aliases: [\"JSX\", \"Immutable\"]\n});","map":null,"metadata":{},"sourceType":"script"} |