hexo/node_modules/@babel/generator/lib/generators/jsx.js.map

1 line
7.0 KiB
Plaintext
Raw Normal View History

2023-09-25 15:58:56 +08:00
{"version":3,"names":["JSXAttribute","node","print","name","value","token","JSXIdentifier","word","JSXNamespacedName","namespace","JSXMemberExpression","object","property","JSXSpreadAttribute","argument","JSXExpressionContainer","expression","JSXSpreadChild","JSXText","raw","getPossibleRaw","undefined","JSXElement","open","openingElement","selfClosing","indent","child","children","dedent","closingElement","spaceSeparator","space","JSXOpeningElement","typeParameters","attributes","length","printJoin","separator","JSXClosingElement","JSXEmptyExpression","printInnerComments","JSXFragment","openingFragment","closingFragment","JSXOpeningFragment","JSXClosingFragment"],"sources":["../../src/generators/jsx.ts"],"sourcesContent":["import type Printer from \"../printer\";\nimport type * as t from \"@babel/types\";\n\nexport function JSXAttribute(this: Printer, node: t.JSXAttribute) {\n this.print(node.name, node);\n if (node.value) {\n this.token(\"=\");\n this.print(node.value, node);\n }\n}\n\nexport function JSXIdentifier(this: Printer, node: t.JSXIdentifier) {\n this.word(node.name);\n}\n\nexport function JSXNamespacedName(this: Printer, node: t.JSXNamespacedName) {\n this.print(node.namespace, node);\n this.token(\":\");\n this.print(node.name, node);\n}\n\nexport function JSXMemberExpression(\n this: Printer,\n node: t.JSXMemberExpression,\n) {\n this.print(node.object, node);\n this.token(\".\");\n this.print(node.property, node);\n}\n\nexport function JSXSpreadAttribute(this: Printer, node: t.JSXSpreadAttribute) {\n this.token(\"{\");\n this.token(\"...\");\n this.print(node.argument, node);\n this.token(\"}\");\n}\n\nexport function JSXExpressionContainer(\n this: Printer,\n node: t.JSXExpressionContainer,\n) {\n this.token(\"{\");\n this.print(node.expression, node);\n this.token(\"}\");\n}\n\nexport function JSXSpreadChild(this: Printer, node: t.JSXSpreadChild) {\n this.token(\"{\");\n this.token(\"...\");\n this.print(node.expression, node);\n this.token(\"}\");\n}\n\nexport function JSXText(this: Printer, node: t.JSXText) {\n const raw = this.getPossibleRaw(node);\n\n if (raw !== undefined) {\n this.token(raw, true);\n } else {\n this.token(node.value, true);\n }\n}\n\nexport function JSXElement(this: Printer, node: t.JSXElement) {\n const open = node.openingElement;\n this.print(open, node);\n if (open.selfClosing) return;\n\n this.indent();\n for (const child of node.children) {\n this.print(child, node);\n }\n this.dedent();\n\n this.print(node.closingElement, node);\n}\n\nfunction spaceSeparator(this: Printer) {\n this.space();\n}\n\nexport function JSXOpeningElement(this: Printer, node: t.JSXOpeningElement) {\n this.token(\"<\");\n this.print(node.name, node);\n this.print(node.typeParameters, node); // TS\n if (node.attributes.length > 0) {\n this.space();\n this.printJoin(node.attributes, node, { separator: spaceSeparator });\n }\n if (node.selfClosing) {\n this.space();\n this.token(\"/>\");\n } else {\n this.token(\">\");\n }\n}\n\nexport function JSXClosingElement(this: Printer, node: t.JSXClosingElement) {\n this.token(\"</\");\n this.print(node.name, node);\n this.token(\">\");\n}\n\nexport function JSXEmptyExpression(this: Printer) {\n // This node is empty, so forcefully print its inner comments.\n this.printInnerComments();\n}\n\nexport function JSXFragment(this: Printer, node: t.JSXFragment) {\n this.print(node.openingFragment, node);\n\n this.indent();\n for (const child of node.children) {\n this.print(child, node);\n }\n this.dedent();\n\n this.print(node.closingFragment, node);\n}\n\nexport function JSXOpeningFragment(this: Printer) {\n this.token(\"<\");\n this.token(\">\");\n}\n\nexport function JSXClosingFragment(this: Printer) {\n this.token(\"</\");\n this.token(\">\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGO,SAASA,YAAYA,CAAgBC,IAAoB,EAAE;EAChE,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,IAAI,EAAEF,IAAI,CAAC;EAC3B,IAAIA,IAAI,CAACG,KAAK,EAAE;IACd,IAAI,CAACC,SAAK,IAAK;IACf,IAAI,CAACH,KAAK,CAACD,IAAI,CAACG,KA