Upload folder using huggingface_hub (part 3)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- node_modules/@babel/generator/LICENSE +22 -0
- node_modules/@babel/generator/README.md +19 -0
- node_modules/@babel/generator/lib/generators/modules.js.map +1 -0
- node_modules/@babel/generator/lib/generators/statements.js +297 -0
- node_modules/@babel/generator/lib/generators/statements.js.map +1 -0
- node_modules/@babel/generator/lib/generators/template-literals.js +38 -0
- node_modules/@babel/generator/lib/generators/template-literals.js.map +1 -0
- node_modules/@babel/generator/lib/generators/types.js +183 -0
- node_modules/@babel/generator/lib/generators/types.js.map +1 -0
- node_modules/@babel/generator/lib/generators/typescript.js +726 -0
- node_modules/@babel/generator/lib/generators/typescript.js.map +1 -0
- node_modules/@babel/generator/lib/index.js +108 -0
- node_modules/@babel/generator/lib/index.js.map +1 -0
- node_modules/@babel/generator/lib/node/index.js +95 -0
- node_modules/@babel/generator/lib/node/index.js.map +1 -0
- node_modules/@babel/generator/lib/node/parentheses.js +298 -0
- node_modules/@babel/generator/lib/node/parentheses.js.map +1 -0
- node_modules/@babel/generator/lib/nodes.js +19 -0
- node_modules/@babel/generator/lib/nodes.js.map +1 -0
- node_modules/@babel/generator/lib/printer.js +783 -0
- node_modules/@babel/generator/lib/printer.js.map +1 -0
- node_modules/@babel/generator/lib/source-map.js +88 -0
- node_modules/@babel/generator/lib/source-map.js.map +1 -0
- node_modules/@babel/generator/lib/token-map.js +195 -0
- node_modules/@babel/generator/lib/token-map.js.map +1 -0
- node_modules/@babel/generator/package.json +39 -0
- node_modules/@babel/helper-compilation-targets/LICENSE +22 -0
- node_modules/@babel/helper-compilation-targets/README.md +19 -0
- node_modules/@babel/helper-compilation-targets/lib/debug.js +28 -0
- node_modules/@babel/helper-compilation-targets/lib/debug.js.map +1 -0
- node_modules/@babel/helper-compilation-targets/lib/filter-items.js +67 -0
- node_modules/@babel/helper-compilation-targets/lib/filter-items.js.map +1 -0
- node_modules/@babel/helper-compilation-targets/lib/index.js +229 -0
- node_modules/@babel/helper-compilation-targets/lib/index.js.map +1 -0
- node_modules/@babel/helper-compilation-targets/lib/options.js +24 -0
- node_modules/@babel/helper-compilation-targets/lib/options.js.map +1 -0
- node_modules/@babel/helper-compilation-targets/lib/pretty.js +40 -0
- node_modules/@babel/helper-compilation-targets/lib/pretty.js.map +1 -0
- node_modules/@babel/helper-compilation-targets/lib/targets.js +28 -0
- node_modules/@babel/helper-compilation-targets/lib/targets.js.map +1 -0
- node_modules/@babel/helper-compilation-targets/lib/utils.js +58 -0
- node_modules/@babel/helper-compilation-targets/lib/utils.js.map +1 -0
- node_modules/@babel/helper-compilation-targets/package.json +43 -0
- node_modules/@babel/helper-globals/LICENSE +22 -0
- node_modules/@babel/helper-globals/README.md +19 -0
- node_modules/@babel/helper-globals/data/browser-upper.json +911 -0
- node_modules/@babel/helper-globals/data/builtin-lower.json +15 -0
- node_modules/@babel/helper-globals/data/builtin-upper.json +51 -0
- node_modules/@babel/helper-globals/package.json +32 -0
- node_modules/@babel/helper-module-imports/LICENSE +22 -0
node_modules/@babel/generator/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/generator/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/generator
|
| 2 |
+
|
| 3 |
+
> Turns an AST into code.
|
| 4 |
+
|
| 5 |
+
See our website [@babel/generator](https://babeljs.io/docs/babel-generator) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save-dev @babel/generator
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/generator --dev
|
| 19 |
+
```
|
node_modules/@babel/generator/lib/generators/modules.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_index","_expressions","isClassDeclaration","isExportDefaultSpecifier","isExportNamespaceSpecifier","isImportDefaultSpecifier","isImportNamespaceSpecifier","isStatement","ImportSpecifier","node","importKind","word","space","print","imported","local","name","ImportDefaultSpecifier","ExportDefaultSpecifier","exported","ExportSpecifier","exportKind","ExportNamespaceSpecifier","token","warningShown","_printAttributes","hasPreviousBrace","_node$extra","attributes","assertions","importAttributesKeyword","format","extra","deprecatedAssertSyntax","deprecatedWithLegacySyntax","console","warn","useAssertKeyword","printList","occurrenceCount","undefined","shouldPrintTrailingComma","ExportAllDeclaration","_node$attributes","_node$assertions","length","source","call","semicolon","maybePrintDecoratorsBeforeExport","printer","declaration","_shouldPrintDecoratorsBeforeExport","printJoin","decorators","ExportNamedDeclaration","declar","specifiers","slice","hasSpecial","first","shift","hasBrace","_node$attributes2","_node$assertions2","ExportDefaultDeclaration","noIndentInnerCommentsHere","tokenContext","TokenContext","exportDefault","ImportDeclaration","_node$attributes3","_node$assertions3","isTypeKind","module","phase","hasSpecifiers","ImportAttribute","key","value","ImportNamespaceSpecifier","ImportExpression","options","rightParens"],"sources":["../../src/generators/modules.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isClassDeclaration,\n isExportDefaultSpecifier,\n isExportNamespaceSpecifier,\n isImportDefaultSpecifier,\n isImportNamespaceSpecifier,\n isStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { TokenContext } from \"../node/index.ts\";\nimport { _shouldPrintDecoratorsBeforeExport } from \"./expressions.ts\";\n\nexport function ImportSpecifier(this: Printer, node: t.ImportSpecifier) {\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n this.print(node.imported);\n // @ts-expect-error todo(flow-ts) maybe check node type instead of relying on name to be undefined on t.StringLiteral\n if (node.local && node.local.name !== node.imported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local);\n }\n}\n\nexport function ImportDefaultSpecifier(\n this: Printer,\n node: t.ImportDefaultSpecifier,\n) {\n this.print(node.local);\n}\n\nexport function ExportDefaultSpecifier(\n this: Printer,\n node: t.ExportDefaultSpecifier,\n) {\n this.print(node.exported);\n}\n\nexport function ExportSpecifier(this: Printer, node: t.ExportSpecifier) {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n this.print(node.local);\n // @ts-expect-error todo(flow-ts) maybe check node type instead of relying on name to be undefined on t.StringLiteral\n if (node.exported && node.local.name !== node.exported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported);\n }\n}\n\nexport function ExportNamespaceSpecifier(\n this: Printer,\n node: t.ExportNamespaceSpecifier,\n) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported);\n}\n\nlet warningShown = false;\n\nexport function _printAttributes(\n this: Printer,\n node: Extract<t.Node, { attributes?: t.ImportAttribute[] | null }>,\n hasPreviousBrace: boolean,\n) {\n const { attributes } = node;\n\n if (!process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n // eslint-disable-next-line no-var\n var { assertions } = node;\n const { importAttributesKeyword } = this.format;\n\n if (\n attributes &&\n !importAttributesKeyword &&\n node.extra &&\n (node.extra.deprecatedAssertSyntax ||\n node.extra.deprecatedWithLegacySyntax) &&\n // In the production build only show the warning once.\n // We want to show it per-usage locally for tests.\n (!process.env.IS_PUBLISH || !warningShown)\n ) {\n warningShown = true;\n console.warn(`\\\nYou are using import attributes, without specifying the desired output syntax.\nPlease specify the \"importAttributesKeyword\" generator option, whose value can be one of:\n - \"with\" : \\`import { a } from \"b\" with { type: \"json\" };\\`\n - \"assert\" : \\`import { a } from \"b\" assert { type: \"json\" };\\`\n - \"with-legacy\" : \\`import { a } from \"b\" with type: \"json\";\\`\n`);\n }\n\n const useAssertKeyword =\n importAttributesKeyword === \"assert\" ||\n (!importAttributesKeyword && assertions);\n\n this.word(useAssertKeyword ? \"assert\" : \"with\");\n this.space();\n\n if (\n !useAssertKeyword &&\n (importAttributesKeyword === \"with-legacy\" ||\n (!importAttributesKeyword && node.extra?.deprecatedWithLegacySyntax))\n ) {\n // with-legacy\n this.printList(attributes || assertions);\n return;\n }\n } else {\n this.word(\"with\");\n this.space();\n }\n\n const occurrenceCount = hasPreviousBrace ? 1 : 0;\n\n this.token(\"{\", undefined, occurrenceCount);\n this.space();\n this.printList(\n process.env.BABEL_8_BREAKING ? attributes : attributes || assertions,\n this.shouldPrintTrailingComma(\"}\"),\n );\n this.space();\n this.token(\"}\", undefined, occurrenceCount);\n}\n\nexport function ExportAllDeclaration(\n this: Printer,\n node: t.ExportAllDeclaration | t.DeclareExportAllDeclaration,\n) {\n this.word(\"export\");\n this.space();\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n this.token(\"*\");\n this.space();\n this.word(\"from\");\n this.space();\n if (\n node.attributes?.length ||\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n (!process.env.BABEL_8_BREAKING && node.assertions?.length)\n ) {\n this.print(node.source, true);\n this.space();\n _printAttributes.call(this, node, false);\n } else {\n this.print(node.source);\n }\n\n this.semicolon();\n}\n\nfunction maybePrintDecoratorsBeforeExport(\n printer: Printer,\n node: t.ExportNamedDeclaration | t.ExportDefaultDeclaration,\n) {\n if (\n isClassDeclaration(node.declaration) &&\n _shouldPrintDecoratorsBeforeExport.call(\n printer,\n node as t.ExportNamedDeclaration & { declaration: t.ClassDeclaration },\n )\n ) {\n printer.printJoin(node.declaration.decorators);\n }\n}\n\nexport function ExportNamedDeclaration(\n this: Printer,\n node: t.ExportNamedDeclaration,\n) {\n maybePrintDecoratorsBeforeExport(this, node);\n\n this.word(\"export\");\n this.space();\n if (node.declaration) {\n const declar = node.declaration;\n this.print(declar);\n if (!isStatement(declar)) this.semicolon();\n } else {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n\n // print \"special\" specifiers first\n let hasSpecial = false;\n for (;;) {\n const first = specifiers[0];\n if (\n isExportDefaultSpecifier(first) ||\n isExportNamespaceSpecifier(first)\n ) {\n hasSpecial = true;\n this.print(specifiers.shift());\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n let hasBrace = false;\n if (specifiers.length || (!specifiers.length && !hasSpecial)) {\n hasBrace = true;\n this.token(\"{\");\n if (specifiers.length) {\n this.space();\n this.printList(specifiers, this.shouldPrintTrailingComma(\"}\"));\n this.space();\n }\n this.token(\"}\");\n }\n\n if (node.source) {\n this.space();\n this.word(\"from\");\n this.space();\n if (\n node.attributes?.length ||\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n (!process.env.BABEL_8_BREAKING && node.assertions?.length)\n ) {\n this.print(node.source, true);\n this.space();\n _printAttributes.call(this, node, hasBrace);\n } else {\n this.print(node.source);\n }\n }\n\n this.semicolon();\n }\n}\n\nexport function ExportDefaultDeclaration(\n this: Printer,\n node: t.ExportDefaultDeclaration,\n) {\n maybePrintDecoratorsBeforeExport(this, node);\n\n this.word(\"export\");\n this.noIndentInnerCommentsHere();\n this.space();\n this.word(\"default\");\n this.space();\n this.tokenContext |= TokenContext.exportDefault;\n const declar = node.declaration;\n this.print(declar);\n if (!isStatement(declar)) this.semicolon();\n}\n\nexport function ImportDeclaration(this: Printer, node: t.ImportDeclaration) {\n this.word(\"import\");\n this.space();\n\n const isTypeKind = node.importKind === \"type\" || node.importKind === \"typeof\";\n if (isTypeKind) {\n this.noIndentInnerCommentsHere();\n this.word(node.importKind!);\n this.space();\n } else if (node.module) {\n this.noIndentInnerCommentsHere();\n this.word(\"module\");\n this.space();\n } else if (node.phase) {\n this.noIndentInnerCommentsHere();\n this.word(node.phase);\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n const hasSpecifiers = !!specifiers.length;\n // print \"special\" specifiers first. The loop condition is constant,\n // but there is a \"break\" in the body.\n while (hasSpecifiers) {\n const first = specifiers[0];\n if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {\n this.print(specifiers.shift());\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n let hasBrace = false;\n if (specifiers.length) {\n hasBrace = true;\n this.token(\"{\");\n this.space();\n this.printList(specifiers, this.shouldPrintTrailingComma(\"}\"));\n this.space();\n this.token(\"}\");\n } else if (isTypeKind && !hasSpecifiers) {\n hasBrace = true;\n this.token(\"{\");\n this.token(\"}\");\n }\n\n if (hasSpecifiers || isTypeKind) {\n this.space();\n this.word(\"from\");\n this.space();\n }\n\n if (\n node.attributes?.length ||\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n (!process.env.BABEL_8_BREAKING && node.assertions?.length)\n ) {\n this.print(node.source, true);\n this.space();\n _printAttributes.call(this, node, hasBrace);\n } else {\n this.print(node.source);\n }\n\n this.semicolon();\n}\n\nexport function ImportAttribute(this: Printer, node: t.ImportAttribute) {\n this.print(node.key);\n this.token(\":\");\n this.space();\n this.print(node.value);\n}\n\nexport function ImportNamespaceSpecifier(\n this: Printer,\n node: t.ImportNamespaceSpecifier,\n) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local);\n}\n\nexport function ImportExpression(this: Printer, node: t.ImportExpression) {\n this.word(\"import\");\n if (node.phase) {\n this.token(\".\");\n this.word(node.phase);\n }\n this.token(\"(\");\n const shouldPrintTrailingComma = this.shouldPrintTrailingComma(\")\");\n this.print(node.source);\n if (node.options != null) {\n this.token(\",\");\n this.space();\n this.print(node.options);\n }\n if (shouldPrintTrailingComma) {\n this.token(\",\");\n }\n this.rightParens(node);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AASA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAAsE;EATpEG,kBAAkB;EAClBC,wBAAwB;EACxBC,0BAA0B;EAC1BC,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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.BreakStatement = BreakStatement;
|
| 7 |
+
exports.CatchClause = CatchClause;
|
| 8 |
+
exports.ContinueStatement = ContinueStatement;
|
| 9 |
+
exports.DebuggerStatement = DebuggerStatement;
|
| 10 |
+
exports.DoWhileStatement = DoWhileStatement;
|
| 11 |
+
exports.ForInStatement = ForInStatement;
|
| 12 |
+
exports.ForOfStatement = ForOfStatement;
|
| 13 |
+
exports.ForStatement = ForStatement;
|
| 14 |
+
exports.IfStatement = IfStatement;
|
| 15 |
+
exports.LabeledStatement = LabeledStatement;
|
| 16 |
+
exports.ReturnStatement = ReturnStatement;
|
| 17 |
+
exports.SwitchCase = SwitchCase;
|
| 18 |
+
exports.SwitchStatement = SwitchStatement;
|
| 19 |
+
exports.ThrowStatement = ThrowStatement;
|
| 20 |
+
exports.TryStatement = TryStatement;
|
| 21 |
+
exports.VariableDeclaration = VariableDeclaration;
|
| 22 |
+
exports.VariableDeclarator = VariableDeclarator;
|
| 23 |
+
exports.WhileStatement = WhileStatement;
|
| 24 |
+
exports.WithStatement = WithStatement;
|
| 25 |
+
var _t = require("@babel/types");
|
| 26 |
+
var _index = require("../node/index.js");
|
| 27 |
+
const {
|
| 28 |
+
isFor,
|
| 29 |
+
isIfStatement,
|
| 30 |
+
isStatement
|
| 31 |
+
} = _t;
|
| 32 |
+
function WithStatement(node) {
|
| 33 |
+
this.word("with");
|
| 34 |
+
this.space();
|
| 35 |
+
this.tokenChar(40);
|
| 36 |
+
this.print(node.object);
|
| 37 |
+
this.tokenChar(41);
|
| 38 |
+
this.printBlock(node.body);
|
| 39 |
+
}
|
| 40 |
+
function IfStatement(node) {
|
| 41 |
+
this.word("if");
|
| 42 |
+
this.space();
|
| 43 |
+
this.tokenChar(40);
|
| 44 |
+
this.print(node.test);
|
| 45 |
+
this.tokenChar(41);
|
| 46 |
+
this.space();
|
| 47 |
+
const needsBlock = node.alternate && isIfStatement(getLastStatement(node.consequent));
|
| 48 |
+
if (needsBlock) {
|
| 49 |
+
this.tokenChar(123);
|
| 50 |
+
this.newline();
|
| 51 |
+
this.indent();
|
| 52 |
+
}
|
| 53 |
+
this.printAndIndentOnComments(node.consequent);
|
| 54 |
+
if (needsBlock) {
|
| 55 |
+
this.dedent();
|
| 56 |
+
this.newline();
|
| 57 |
+
this.tokenChar(125);
|
| 58 |
+
}
|
| 59 |
+
if (node.alternate) {
|
| 60 |
+
if (this.endsWith(125)) this.space();
|
| 61 |
+
this.word("else");
|
| 62 |
+
this.space();
|
| 63 |
+
this.printAndIndentOnComments(node.alternate);
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
+
function getLastStatement(statement) {
|
| 67 |
+
const {
|
| 68 |
+
body
|
| 69 |
+
} = statement;
|
| 70 |
+
if (isStatement(body) === false) {
|
| 71 |
+
return statement;
|
| 72 |
+
}
|
| 73 |
+
return getLastStatement(body);
|
| 74 |
+
}
|
| 75 |
+
function ForStatement(node) {
|
| 76 |
+
this.word("for");
|
| 77 |
+
this.space();
|
| 78 |
+
this.tokenChar(40);
|
| 79 |
+
this.tokenContext |= _index.TokenContext.forInitHead | _index.TokenContext.forInOrInitHeadAccumulate;
|
| 80 |
+
this.print(node.init);
|
| 81 |
+
this.tokenContext = _index.TokenContext.normal;
|
| 82 |
+
this.tokenChar(59);
|
| 83 |
+
if (node.test) {
|
| 84 |
+
this.space();
|
| 85 |
+
this.print(node.test);
|
| 86 |
+
}
|
| 87 |
+
this.tokenChar(59, 1);
|
| 88 |
+
if (node.update) {
|
| 89 |
+
this.space();
|
| 90 |
+
this.print(node.update);
|
| 91 |
+
}
|
| 92 |
+
this.tokenChar(41);
|
| 93 |
+
this.printBlock(node.body);
|
| 94 |
+
}
|
| 95 |
+
function WhileStatement(node) {
|
| 96 |
+
this.word("while");
|
| 97 |
+
this.space();
|
| 98 |
+
this.tokenChar(40);
|
| 99 |
+
this.print(node.test);
|
| 100 |
+
this.tokenChar(41);
|
| 101 |
+
this.printBlock(node.body);
|
| 102 |
+
}
|
| 103 |
+
function ForInStatement(node) {
|
| 104 |
+
this.word("for");
|
| 105 |
+
this.space();
|
| 106 |
+
this.noIndentInnerCommentsHere();
|
| 107 |
+
this.tokenChar(40);
|
| 108 |
+
this.tokenContext |= _index.TokenContext.forInHead | _index.TokenContext.forInOrInitHeadAccumulate;
|
| 109 |
+
this.print(node.left);
|
| 110 |
+
this.tokenContext = _index.TokenContext.normal;
|
| 111 |
+
this.space();
|
| 112 |
+
this.word("in");
|
| 113 |
+
this.space();
|
| 114 |
+
this.print(node.right);
|
| 115 |
+
this.tokenChar(41);
|
| 116 |
+
this.printBlock(node.body);
|
| 117 |
+
}
|
| 118 |
+
function ForOfStatement(node) {
|
| 119 |
+
this.word("for");
|
| 120 |
+
this.space();
|
| 121 |
+
if (node.await) {
|
| 122 |
+
this.word("await");
|
| 123 |
+
this.space();
|
| 124 |
+
}
|
| 125 |
+
this.noIndentInnerCommentsHere();
|
| 126 |
+
this.tokenChar(40);
|
| 127 |
+
this.tokenContext |= _index.TokenContext.forOfHead;
|
| 128 |
+
this.print(node.left);
|
| 129 |
+
this.space();
|
| 130 |
+
this.word("of");
|
| 131 |
+
this.space();
|
| 132 |
+
this.print(node.right);
|
| 133 |
+
this.tokenChar(41);
|
| 134 |
+
this.printBlock(node.body);
|
| 135 |
+
}
|
| 136 |
+
function DoWhileStatement(node) {
|
| 137 |
+
this.word("do");
|
| 138 |
+
this.space();
|
| 139 |
+
this.print(node.body);
|
| 140 |
+
this.space();
|
| 141 |
+
this.word("while");
|
| 142 |
+
this.space();
|
| 143 |
+
this.tokenChar(40);
|
| 144 |
+
this.print(node.test);
|
| 145 |
+
this.tokenChar(41);
|
| 146 |
+
this.semicolon();
|
| 147 |
+
}
|
| 148 |
+
function printStatementAfterKeyword(printer, node) {
|
| 149 |
+
if (node) {
|
| 150 |
+
printer.space();
|
| 151 |
+
printer.printTerminatorless(node);
|
| 152 |
+
}
|
| 153 |
+
printer.semicolon();
|
| 154 |
+
}
|
| 155 |
+
function BreakStatement(node) {
|
| 156 |
+
this.word("break");
|
| 157 |
+
printStatementAfterKeyword(this, node.label);
|
| 158 |
+
}
|
| 159 |
+
function ContinueStatement(node) {
|
| 160 |
+
this.word("continue");
|
| 161 |
+
printStatementAfterKeyword(this, node.label);
|
| 162 |
+
}
|
| 163 |
+
function ReturnStatement(node) {
|
| 164 |
+
this.word("return");
|
| 165 |
+
printStatementAfterKeyword(this, node.argument);
|
| 166 |
+
}
|
| 167 |
+
function ThrowStatement(node) {
|
| 168 |
+
this.word("throw");
|
| 169 |
+
printStatementAfterKeyword(this, node.argument);
|
| 170 |
+
}
|
| 171 |
+
function LabeledStatement(node) {
|
| 172 |
+
this.print(node.label);
|
| 173 |
+
this.tokenChar(58);
|
| 174 |
+
this.space();
|
| 175 |
+
this.print(node.body);
|
| 176 |
+
}
|
| 177 |
+
function TryStatement(node) {
|
| 178 |
+
this.word("try");
|
| 179 |
+
this.space();
|
| 180 |
+
this.print(node.block);
|
| 181 |
+
this.space();
|
| 182 |
+
if (node.handlers) {
|
| 183 |
+
this.print(node.handlers[0]);
|
| 184 |
+
} else {
|
| 185 |
+
this.print(node.handler);
|
| 186 |
+
}
|
| 187 |
+
if (node.finalizer) {
|
| 188 |
+
this.space();
|
| 189 |
+
this.word("finally");
|
| 190 |
+
this.space();
|
| 191 |
+
this.print(node.finalizer);
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
function CatchClause(node) {
|
| 195 |
+
this.word("catch");
|
| 196 |
+
this.space();
|
| 197 |
+
if (node.param) {
|
| 198 |
+
this.tokenChar(40);
|
| 199 |
+
this.print(node.param);
|
| 200 |
+
this.print(node.param.typeAnnotation);
|
| 201 |
+
this.tokenChar(41);
|
| 202 |
+
this.space();
|
| 203 |
+
}
|
| 204 |
+
this.print(node.body);
|
| 205 |
+
}
|
| 206 |
+
function SwitchStatement(node) {
|
| 207 |
+
this.word("switch");
|
| 208 |
+
this.space();
|
| 209 |
+
this.tokenChar(40);
|
| 210 |
+
this.print(node.discriminant);
|
| 211 |
+
this.tokenChar(41);
|
| 212 |
+
this.space();
|
| 213 |
+
this.tokenChar(123);
|
| 214 |
+
this.printSequence(node.cases, true);
|
| 215 |
+
this.rightBrace(node);
|
| 216 |
+
}
|
| 217 |
+
function SwitchCase(node) {
|
| 218 |
+
if (node.test) {
|
| 219 |
+
this.word("case");
|
| 220 |
+
this.space();
|
| 221 |
+
this.print(node.test);
|
| 222 |
+
this.tokenChar(58);
|
| 223 |
+
} else {
|
| 224 |
+
this.word("default");
|
| 225 |
+
this.tokenChar(58);
|
| 226 |
+
}
|
| 227 |
+
if (node.consequent.length) {
|
| 228 |
+
this.newline();
|
| 229 |
+
this.printSequence(node.consequent, true);
|
| 230 |
+
}
|
| 231 |
+
}
|
| 232 |
+
function DebuggerStatement() {
|
| 233 |
+
this.word("debugger");
|
| 234 |
+
this.semicolon();
|
| 235 |
+
}
|
| 236 |
+
function commaSeparatorWithNewline(occurrenceCount) {
|
| 237 |
+
this.tokenChar(44, occurrenceCount);
|
| 238 |
+
this.newline();
|
| 239 |
+
}
|
| 240 |
+
function VariableDeclaration(node, parent) {
|
| 241 |
+
if (node.declare) {
|
| 242 |
+
this.word("declare");
|
| 243 |
+
this.space();
|
| 244 |
+
}
|
| 245 |
+
const {
|
| 246 |
+
kind
|
| 247 |
+
} = node;
|
| 248 |
+
switch (kind) {
|
| 249 |
+
case "await using":
|
| 250 |
+
this.word("await");
|
| 251 |
+
this.space();
|
| 252 |
+
case "using":
|
| 253 |
+
this.word("using", true);
|
| 254 |
+
break;
|
| 255 |
+
default:
|
| 256 |
+
this.word(kind);
|
| 257 |
+
}
|
| 258 |
+
this.space();
|
| 259 |
+
let hasInits = false;
|
| 260 |
+
if (!isFor(parent)) {
|
| 261 |
+
for (const declar of node.declarations) {
|
| 262 |
+
if (declar.init) {
|
| 263 |
+
hasInits = true;
|
| 264 |
+
break;
|
| 265 |
+
}
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
this.printList(node.declarations, undefined, undefined, node.declarations.length > 1, hasInits ? commaSeparatorWithNewline : undefined);
|
| 269 |
+
if (parent != null) {
|
| 270 |
+
switch (parent.type) {
|
| 271 |
+
case "ForStatement":
|
| 272 |
+
if (parent.init === node) {
|
| 273 |
+
return;
|
| 274 |
+
}
|
| 275 |
+
break;
|
| 276 |
+
case "ForInStatement":
|
| 277 |
+
case "ForOfStatement":
|
| 278 |
+
if (parent.left === node) {
|
| 279 |
+
return;
|
| 280 |
+
}
|
| 281 |
+
}
|
| 282 |
+
}
|
| 283 |
+
this.semicolon();
|
| 284 |
+
}
|
| 285 |
+
function VariableDeclarator(node) {
|
| 286 |
+
this.print(node.id);
|
| 287 |
+
if (node.definite) this.tokenChar(33);
|
| 288 |
+
this.print(node.id.typeAnnotation);
|
| 289 |
+
if (node.init) {
|
| 290 |
+
this.space();
|
| 291 |
+
this.tokenChar(61);
|
| 292 |
+
this.space();
|
| 293 |
+
this.print(node.init);
|
| 294 |
+
}
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
//# sourceMappingURL=statements.js.map
|
node_modules/@babel/generator/lib/generators/statements.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_index","isFor","isIfStatement","isStatement","WithStatement","node","word","space","token","print","object","printBlock","body","IfStatement","test","needsBlock","alternate","getLastStatement","consequent","newline","indent","printAndIndentOnComments","dedent","endsWith","statement","ForStatement","tokenContext","TokenContext","forInitHead","forInOrInitHeadAccumulate","init","normal","tokenChar","update","WhileStatement","ForInStatement","noIndentInnerCommentsHere","forInHead","left","right","ForOfStatement","await","forOfHead","DoWhileStatement","semicolon","printStatementAfterKeyword","printer","printTerminatorless","BreakStatement","label","ContinueStatement","ReturnStatement","argument","ThrowStatement","LabeledStatement","TryStatement","block","handlers","handler","finalizer","CatchClause","param","typeAnnotation","SwitchStatement","discriminant","printSequence","cases","rightBrace","SwitchCase","length","DebuggerStatement","commaSeparatorWithNewline","occurrenceCount","VariableDeclaration","parent","declare","kind","hasInits","declar","declarations","printList","undefined","type","VariableDeclarator","id","definite"],"sources":["../../src/generators/statements.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport { isFor, isIfStatement, isStatement } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function WithStatement(this: Printer, node: t.WithStatement) {\n this.word(\"with\");\n this.space();\n this.token(\"(\");\n this.print(node.object);\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function IfStatement(this: Printer, node: t.IfStatement) {\n this.word(\"if\");\n this.space();\n this.token(\"(\");\n this.print(node.test);\n this.token(\")\");\n this.space();\n\n const needsBlock =\n node.alternate && isIfStatement(getLastStatement(node.consequent));\n if (needsBlock) {\n this.token(\"{\");\n this.newline();\n this.indent();\n }\n\n this.printAndIndentOnComments(node.consequent);\n\n if (needsBlock) {\n this.dedent();\n this.newline();\n this.token(\"}\");\n }\n\n if (node.alternate) {\n if (this.endsWith(charCodes.rightCurlyBrace)) this.space();\n this.word(\"else\");\n this.space();\n this.printAndIndentOnComments(node.alternate);\n }\n}\n\n// Recursively get the last statement.\nfunction getLastStatement(statement: t.Statement): t.Statement {\n // @ts-expect-error: If statement.body is empty or not a Node, isStatement will return false\n const { body } = statement;\n if (isStatement(body) === false) {\n return statement;\n }\n\n return getLastStatement(body);\n}\n\nexport function ForStatement(this: Printer, node: t.ForStatement) {\n this.word(\"for\");\n this.space();\n this.token(\"(\");\n\n this.tokenContext |=\n TokenContext.forInitHead | TokenContext.forInOrInitHeadAccumulate;\n this.print(node.init);\n this.tokenContext = TokenContext.normal;\n\n this.token(\";\");\n\n if (node.test) {\n this.space();\n this.print(node.test);\n }\n this.tokenChar(charCodes.semicolon, 1);\n\n if (node.update) {\n this.space();\n this.print(node.update);\n }\n\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function WhileStatement(this: Printer, node: t.WhileStatement) {\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test);\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function ForInStatement(this: Printer, node: t.ForInStatement) {\n this.word(\"for\");\n this.space();\n this.noIndentInnerCommentsHere();\n this.token(\"(\");\n this.tokenContext |=\n TokenContext.forInHead | TokenContext.forInOrInitHeadAccumulate;\n this.print(node.left);\n this.tokenContext = TokenContext.normal;\n this.space();\n this.word(\"in\");\n this.space();\n this.print(node.right);\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function ForOfStatement(this: Printer, node: t.ForOfStatement) {\n this.word(\"for\");\n this.space();\n if (node.await) {\n this.word(\"await\");\n this.space();\n }\n this.noIndentInnerCommentsHere();\n this.token(\"(\");\n this.tokenContext |= TokenContext.forOfHead;\n this.print(node.left);\n this.space();\n this.word(\"of\");\n this.space();\n this.print(node.right);\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function DoWhileStatement(this: Printer, node: t.DoWhileStatement) {\n this.word(\"do\");\n this.space();\n this.print(node.body);\n this.space();\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test);\n this.token(\")\");\n this.semicolon();\n}\n\nfunction printStatementAfterKeyword(\n printer: Printer,\n node: t.Node | null | undefined,\n) {\n if (node) {\n printer.space();\n printer.printTerminatorless(node);\n }\n\n printer.semicolon();\n}\n\nexport function BreakStatement(this: Printer, node: t.ContinueStatement) {\n this.word(\"break\");\n printStatementAfterKeyword(this, node.label);\n}\n\nexport function ContinueStatement(this: Printer, node: t.ContinueStatement) {\n this.word(\"continue\");\n printStatementAfterKeyword(this, node.label);\n}\n\nexport function ReturnStatement(this: Printer, node: t.ReturnStatement) {\n this.word(\"return\");\n printStatementAfterKeyword(this, node.argument);\n}\n\nexport function ThrowStatement(this: Printer, node: t.ThrowStatement) {\n this.word(\"throw\");\n printStatementAfterKeyword(this, node.argument);\n}\n\nexport function LabeledStatement(this: Printer, node: t.LabeledStatement) {\n this.print(node.label);\n this.token(\":\");\n this.space();\n this.print(node.body);\n}\n\nexport function TryStatement(this: Printer, node: t.TryStatement) {\n this.word(\"try\");\n this.space();\n this.print(node.block);\n this.space();\n\n // Esprima bug puts the catch clause in a `handlers` array.\n // see https://code.google.com/p/esprima/issues/detail?id=433\n // We run into this from regenerator generated ast.\n // @ts-expect-error todo(flow->ts) should ast node type be updated to support this?\n if (node.handlers) {\n // @ts-expect-error todo(flow->ts) should ast node type be updated to support this?\n this.print(node.handlers[0]);\n } else {\n this.print(node.handler);\n }\n\n if (node.finalizer) {\n this.space();\n this.word(\"finally\");\n this.space();\n this.print(node.finalizer);\n }\n}\n\nexport function CatchClause(this: Printer, node: t.CatchClause) {\n this.word(\"catch\");\n this.space();\n if (node.param) {\n this.token(\"(\");\n this.print(node.param);\n this.print(node.param.typeAnnotation);\n this.token(\")\");\n this.space();\n }\n this.print(node.body);\n}\n\nexport function SwitchStatement(this: Printer, node: t.SwitchStatement) {\n this.word(\"switch\");\n this.space();\n this.token(\"(\");\n this.print(node.discriminant);\n this.token(\")\");\n this.space();\n this.token(\"{\");\n\n this.printSequence(node.cases, true);\n\n this.rightBrace(node);\n}\n\nexport function SwitchCase(this: Printer, node: t.SwitchCase) {\n if (node.test) {\n this.word(\"case\");\n this.space();\n this.print(node.test);\n this.token(\":\");\n } else {\n this.word(\"default\");\n this.token(\":\");\n }\n\n if (node.consequent.length) {\n this.newline();\n this.printSequence(node.consequent, true);\n }\n}\n\nexport function DebuggerStatement(this: Printer) {\n this.word(\"debugger\");\n this.semicolon();\n}\n\nfunction commaSeparatorWithNewline(this: Printer, occurrenceCount: number) {\n this.tokenChar(charCodes.comma, occurrenceCount);\n this.newline();\n}\n\nexport function VariableDeclaration(\n this: Printer,\n node: t.VariableDeclaration,\n parent: t.Node,\n) {\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n const { kind } = node;\n switch (kind) {\n case \"await using\":\n this.word(\"await\");\n this.space();\n // fallthrough\n case \"using\":\n this.word(\"using\", true);\n break;\n default:\n this.word(kind);\n }\n this.space();\n\n let hasInits = false;\n // don't add whitespace to loop heads\n if (!isFor(parent)) {\n for (const declar of node.declarations) {\n if (declar.init) {\n // has an init so let's split it up over multiple lines\n hasInits = true;\n break;\n }\n }\n }\n\n //\n // use a pretty separator when we aren't in compact mode, have initializers and don't have retainLines on\n // this will format declarations like:\n //\n // let foo = \"bar\", bar = \"foo\";\n //\n // into\n //\n // let foo = \"bar\",\n // bar = \"foo\";\n //\n\n this.printList(\n node.declarations,\n undefined,\n undefined,\n node.declarations.length > 1,\n hasInits ? commaSeparatorWithNewline : undefined,\n );\n\n if (parent != null) {\n switch (parent.type) {\n case \"ForStatement\":\n if (parent.init === node) {\n return;\n }\n break;\n case \"ForInStatement\":\n case \"ForOfStatement\":\n if (parent.left === node) {\n return;\n }\n }\n }\n\n this.semicolon();\n}\n\nexport function VariableDeclarator(this: Printer, node: t.VariableDeclarator) {\n this.print(node.id);\n if (node.definite) this.token(\"!\"); // TS\n // @ts-ignore(Babel 7 vs Babel 8) Property 'typeAnnotation' does not exist on type 'MemberExpression'.\n this.print(node.id.typeAnnotation);\n if (node.init) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.init);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.TaggedTemplateExpression = TaggedTemplateExpression;
|
| 7 |
+
exports.TemplateElement = TemplateElement;
|
| 8 |
+
exports.TemplateLiteral = TemplateLiteral;
|
| 9 |
+
exports._printTemplate = _printTemplate;
|
| 10 |
+
function TaggedTemplateExpression(node) {
|
| 11 |
+
this.print(node.tag);
|
| 12 |
+
this.print(node.typeParameters);
|
| 13 |
+
this.print(node.quasi);
|
| 14 |
+
}
|
| 15 |
+
function TemplateElement() {
|
| 16 |
+
throw new Error("TemplateElement printing is handled in TemplateLiteral");
|
| 17 |
+
}
|
| 18 |
+
function _printTemplate(node, substitutions) {
|
| 19 |
+
const quasis = node.quasis;
|
| 20 |
+
let partRaw = "`";
|
| 21 |
+
for (let i = 0; i < quasis.length - 1; i++) {
|
| 22 |
+
partRaw += quasis[i].value.raw;
|
| 23 |
+
this.token(partRaw + "${", true);
|
| 24 |
+
this.print(substitutions[i]);
|
| 25 |
+
partRaw = "}";
|
| 26 |
+
if (this.tokenMap) {
|
| 27 |
+
const token = this.tokenMap.findMatching(node, "}", i);
|
| 28 |
+
if (token) this._catchUpTo(token.loc.start);
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
partRaw += quasis[quasis.length - 1].value.raw;
|
| 32 |
+
this.token(partRaw + "`", true);
|
| 33 |
+
}
|
| 34 |
+
function TemplateLiteral(node) {
|
| 35 |
+
_printTemplate.call(this, node, node.expressions);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
//# sourceMappingURL=template-literals.js.map
|
node_modules/@babel/generator/lib/generators/template-literals.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["TaggedTemplateExpression","node","print","tag","typeParameters","quasi","TemplateElement","Error","_printTemplate","substitutions","quasis","partRaw","i","length","value","raw","token","tokenMap","findMatching","_catchUpTo","loc","start","TemplateLiteral","call","expressions"],"sources":["../../src/generators/template-literals.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\n\nexport function TaggedTemplateExpression(\n this: Printer,\n node: t.TaggedTemplateExpression,\n) {\n this.print(node.tag);\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n this.print(node.typeArguments);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n this.print(node.typeParameters);\n }\n this.print(node.quasi);\n}\n\nexport function TemplateElement(this: Printer) {\n throw new Error(\"TemplateElement printing is handled in TemplateLiteral\");\n}\n\nexport type TemplateLiteralBase = t.Node & {\n quasis: t.TemplateElement[];\n};\n\nexport function _printTemplate<T extends t.Node>(\n this: Printer,\n node: TemplateLiteralBase,\n substitutions: T[],\n) {\n const quasis = node.quasis;\n let partRaw = \"`\";\n for (let i = 0; i < quasis.length - 1; i++) {\n partRaw += quasis[i].value.raw;\n this.token(partRaw + \"${\", true);\n this.print(substitutions[i]);\n partRaw = \"}\";\n\n // In Babel 7 we have individual tokens for ${ and }, so the automatic\n // catchup logic does not work. Manually look for those tokens.\n if (!process.env.BABEL_8_BREAKING && this.tokenMap) {\n const token = this.tokenMap.findMatching(node, \"}\", i);\n if (token) this._catchUpTo(token.loc.start);\n }\n }\n partRaw += quasis[quasis.length - 1].value.raw;\n this.token(partRaw + \"`\", true);\n}\n\nexport function TemplateLiteral(this: Printer, node: t.TemplateLiteral) {\n _printTemplate.call(this, node, node.expressions);\n}\n"],"mappings":";;;;;;;;;AAGO,SAASA,wBAAwBA,CAEtCC,IAAgC,EAChC;EACA,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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.ArgumentPlaceholder = ArgumentPlaceholder;
|
| 7 |
+
exports.ArrayPattern = exports.ArrayExpression = ArrayExpression;
|
| 8 |
+
exports.BigIntLiteral = BigIntLiteral;
|
| 9 |
+
exports.BooleanLiteral = BooleanLiteral;
|
| 10 |
+
exports.Identifier = Identifier;
|
| 11 |
+
exports.NullLiteral = NullLiteral;
|
| 12 |
+
exports.NumericLiteral = NumericLiteral;
|
| 13 |
+
exports.ObjectPattern = exports.ObjectExpression = ObjectExpression;
|
| 14 |
+
exports.ObjectMethod = ObjectMethod;
|
| 15 |
+
exports.ObjectProperty = ObjectProperty;
|
| 16 |
+
exports.PipelineBareFunction = PipelineBareFunction;
|
| 17 |
+
exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
|
| 18 |
+
exports.PipelineTopicExpression = PipelineTopicExpression;
|
| 19 |
+
exports.RegExpLiteral = RegExpLiteral;
|
| 20 |
+
exports.SpreadElement = exports.RestElement = RestElement;
|
| 21 |
+
exports.StringLiteral = StringLiteral;
|
| 22 |
+
exports.TopicReference = TopicReference;
|
| 23 |
+
exports.VoidPattern = VoidPattern;
|
| 24 |
+
exports._getRawIdentifier = _getRawIdentifier;
|
| 25 |
+
var _t = require("@babel/types");
|
| 26 |
+
var _jsesc = require("jsesc");
|
| 27 |
+
var _methods = require("./methods.js");
|
| 28 |
+
const {
|
| 29 |
+
isAssignmentPattern,
|
| 30 |
+
isIdentifier
|
| 31 |
+
} = _t;
|
| 32 |
+
let lastRawIdentResult = "";
|
| 33 |
+
function _getRawIdentifier(node) {
|
| 34 |
+
const {
|
| 35 |
+
name
|
| 36 |
+
} = node;
|
| 37 |
+
const token = this.tokenMap.find(node, tok => tok.value === name);
|
| 38 |
+
if (token) {
|
| 39 |
+
lastRawIdentResult = this._originalCode.slice(token.start, token.end);
|
| 40 |
+
return lastRawIdentResult;
|
| 41 |
+
}
|
| 42 |
+
return lastRawIdentResult = node.name;
|
| 43 |
+
}
|
| 44 |
+
function Identifier(node) {
|
| 45 |
+
if (this._buf._map) {
|
| 46 |
+
var _node$loc;
|
| 47 |
+
this.sourceIdentifierName(((_node$loc = node.loc) == null ? void 0 : _node$loc.identifierName) || node.name);
|
| 48 |
+
}
|
| 49 |
+
this.word(this.tokenMap ? lastRawIdentResult : node.name);
|
| 50 |
+
}
|
| 51 |
+
function ArgumentPlaceholder() {
|
| 52 |
+
this.tokenChar(63);
|
| 53 |
+
}
|
| 54 |
+
function RestElement(node) {
|
| 55 |
+
this.token("...");
|
| 56 |
+
this.print(node.argument);
|
| 57 |
+
}
|
| 58 |
+
function ObjectExpression(node) {
|
| 59 |
+
const props = node.properties;
|
| 60 |
+
this.tokenChar(123);
|
| 61 |
+
if (props.length) {
|
| 62 |
+
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
| 63 |
+
this.space();
|
| 64 |
+
this.printList(props, this.shouldPrintTrailingComma("}"), true, true, undefined, true);
|
| 65 |
+
this.space();
|
| 66 |
+
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
| 67 |
+
}
|
| 68 |
+
this.rightBrace(node);
|
| 69 |
+
}
|
| 70 |
+
function ObjectMethod(node) {
|
| 71 |
+
this.printJoin(node.decorators);
|
| 72 |
+
_methods._methodHead.call(this, node);
|
| 73 |
+
this.space();
|
| 74 |
+
this.print(node.body);
|
| 75 |
+
}
|
| 76 |
+
function ObjectProperty(node) {
|
| 77 |
+
this.printJoin(node.decorators);
|
| 78 |
+
if (node.computed) {
|
| 79 |
+
this.tokenChar(91);
|
| 80 |
+
this.print(node.key);
|
| 81 |
+
this.tokenChar(93);
|
| 82 |
+
} else {
|
| 83 |
+
if (isAssignmentPattern(node.value) && isIdentifier(node.key) && node.key.name === node.value.left.name) {
|
| 84 |
+
this.print(node.value);
|
| 85 |
+
return;
|
| 86 |
+
}
|
| 87 |
+
this.print(node.key);
|
| 88 |
+
if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) {
|
| 89 |
+
return;
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
this.tokenChar(58);
|
| 93 |
+
this.space();
|
| 94 |
+
this.print(node.value);
|
| 95 |
+
}
|
| 96 |
+
function ArrayExpression(node) {
|
| 97 |
+
const elems = node.elements;
|
| 98 |
+
const len = elems.length;
|
| 99 |
+
this.tokenChar(91);
|
| 100 |
+
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
| 101 |
+
for (let i = 0; i < elems.length; i++) {
|
| 102 |
+
const elem = elems[i];
|
| 103 |
+
if (elem) {
|
| 104 |
+
if (i > 0) this.space();
|
| 105 |
+
this.print(elem, undefined, true);
|
| 106 |
+
if (i < len - 1 || this.shouldPrintTrailingComma("]")) {
|
| 107 |
+
this.tokenChar(44, i);
|
| 108 |
+
}
|
| 109 |
+
} else {
|
| 110 |
+
this.tokenChar(44, i);
|
| 111 |
+
}
|
| 112 |
+
}
|
| 113 |
+
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
| 114 |
+
this.tokenChar(93);
|
| 115 |
+
}
|
| 116 |
+
function RegExpLiteral(node) {
|
| 117 |
+
this.word(`/${node.pattern}/${node.flags}`, false);
|
| 118 |
+
}
|
| 119 |
+
function BooleanLiteral(node) {
|
| 120 |
+
this.word(node.value ? "true" : "false");
|
| 121 |
+
}
|
| 122 |
+
function NullLiteral() {
|
| 123 |
+
this.word("null");
|
| 124 |
+
}
|
| 125 |
+
function NumericLiteral(node) {
|
| 126 |
+
const raw = this.getPossibleRaw(node);
|
| 127 |
+
const opts = this.format.jsescOption;
|
| 128 |
+
const value = node.value;
|
| 129 |
+
const str = value + "";
|
| 130 |
+
if (opts.numbers) {
|
| 131 |
+
this.number(_jsesc(value, opts), value);
|
| 132 |
+
} else if (raw == null) {
|
| 133 |
+
this.number(str, value);
|
| 134 |
+
} else if (this.format.minified) {
|
| 135 |
+
this.number(raw.length < str.length ? raw : str, value);
|
| 136 |
+
} else {
|
| 137 |
+
this.number(raw, value);
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
function StringLiteral(node) {
|
| 141 |
+
const raw = this.getPossibleRaw(node);
|
| 142 |
+
if (!this.format.minified && raw !== undefined) {
|
| 143 |
+
this.token(raw);
|
| 144 |
+
return;
|
| 145 |
+
}
|
| 146 |
+
const val = _jsesc(node.value, this.format.jsescOption);
|
| 147 |
+
this.token(val);
|
| 148 |
+
}
|
| 149 |
+
function BigIntLiteral(node) {
|
| 150 |
+
const raw = this.getPossibleRaw(node);
|
| 151 |
+
if (!this.format.minified && raw !== undefined) {
|
| 152 |
+
this.word(raw);
|
| 153 |
+
return;
|
| 154 |
+
}
|
| 155 |
+
this.word(node.value + "n");
|
| 156 |
+
}
|
| 157 |
+
const validTopicTokenSet = new Set(["^^", "@@", "^", "%", "#"]);
|
| 158 |
+
function TopicReference() {
|
| 159 |
+
const {
|
| 160 |
+
topicToken
|
| 161 |
+
} = this.format;
|
| 162 |
+
if (validTopicTokenSet.has(topicToken)) {
|
| 163 |
+
this.token(topicToken);
|
| 164 |
+
} else {
|
| 165 |
+
const givenTopicTokenJSON = JSON.stringify(topicToken);
|
| 166 |
+
const validTopics = Array.from(validTopicTokenSet, v => JSON.stringify(v));
|
| 167 |
+
throw new Error(`The "topicToken" generator option must be one of ` + `${validTopics.join(", ")} (${givenTopicTokenJSON} received instead).`);
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
function PipelineTopicExpression(node) {
|
| 171 |
+
this.print(node.expression);
|
| 172 |
+
}
|
| 173 |
+
function PipelineBareFunction(node) {
|
| 174 |
+
this.print(node.callee);
|
| 175 |
+
}
|
| 176 |
+
function PipelinePrimaryTopicReference() {
|
| 177 |
+
this.tokenChar(35);
|
| 178 |
+
}
|
| 179 |
+
function VoidPattern() {
|
| 180 |
+
this.word("void");
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
//# sourceMappingURL=types.js.map
|
node_modules/@babel/generator/lib/generators/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_jsesc","_methods","isAssignmentPattern","isIdentifier","lastRawIdentResult","_getRawIdentifier","node","name","token","tokenMap","find","tok","value","_originalCode","slice","start","end","Identifier","_buf","_map","_node$loc","sourceIdentifierName","loc","identifierName","word","ArgumentPlaceholder","RestElement","print","argument","ObjectExpression","props","properties","length","oldNoLineTerminatorAfterNode","enterDelimited","space","printList","shouldPrintTrailingComma","undefined","_noLineTerminatorAfterNode","rightBrace","ObjectMethod","printJoin","decorators","_methodHead","call","body","ObjectProperty","computed","key","left","shorthand","ArrayExpression","elems","elements","len","i","elem","tokenChar","RegExpLiteral","pattern","flags","BooleanLiteral","NullLiteral","NumericLiteral","raw","getPossibleRaw","opts","format","jsescOption","str","numbers","number","jsesc","minified","StringLiteral","val","BigIntLiteral","validTopicTokenSet","Set","TopicReference","topicToken","has","givenTopicTokenJSON","JSON","stringify","validTopics","Array","from","v","Error","join","PipelineTopicExpression","expression","PipelineBareFunction","callee","PipelinePrimaryTopicReference","VoidPattern"],"sources":["../../src/generators/types.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport { isAssignmentPattern, isIdentifier } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport jsesc from \"jsesc\";\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\nimport { _methodHead } from \"./methods.ts\";\n\nlet lastRawIdentResult: string = \"\";\nexport function _getRawIdentifier(this: Printer, node: t.Identifier) {\n const { name } = node;\n const token = this.tokenMap!.find(node, tok => tok.value === name);\n if (token) {\n lastRawIdentResult = this._originalCode!.slice(token.start, token.end);\n return lastRawIdentResult;\n }\n return (lastRawIdentResult = node.name);\n}\n\nexport function Identifier(this: Printer, node: t.Identifier) {\n if (this._buf._map) {\n this.sourceIdentifierName(node.loc?.identifierName || node.name);\n }\n\n this.word(this.tokenMap ? lastRawIdentResult : node.name);\n}\n\nexport function ArgumentPlaceholder(this: Printer) {\n this.token(\"?\");\n}\n\nexport function RestElement(this: Printer, node: t.RestElement) {\n this.token(\"...\");\n this.print(node.argument);\n}\n\nexport { RestElement as SpreadElement };\n\nexport function ObjectExpression(this: Printer, node: t.ObjectExpression) {\n const props = node.properties;\n\n this.token(\"{\");\n\n if (props.length) {\n const oldNoLineTerminatorAfterNode = this.enterDelimited();\n this.space();\n this.printList(\n props,\n this.shouldPrintTrailingComma(\"}\"),\n true,\n true,\n undefined,\n true,\n );\n this.space();\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n }\n\n this.rightBrace(node);\n}\n\nexport { ObjectExpression as ObjectPattern };\n\nexport function ObjectMethod(this: Printer, node: t.ObjectMethod) {\n this.printJoin(node.decorators);\n _methodHead.call(this, node);\n this.space();\n this.print(node.body);\n}\n\nexport function ObjectProperty(this: Printer, node: t.ObjectProperty) {\n this.printJoin(node.decorators);\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key);\n this.token(\"]\");\n } else {\n // print `({ foo: foo = 5 } = {})` as `({ foo = 5 } = {});`\n if (\n isAssignmentPattern(node.value) &&\n isIdentifier(node.key) &&\n // @ts-expect-error todo(flow->ts) `.name` does not exist on some types in union\n node.key.name === node.value.left.name\n ) {\n this.print(node.value);\n return;\n }\n\n this.print(node.key);\n\n // shorthand!\n if (\n node.shorthand &&\n isIdentifier(node.key) &&\n isIdentifier(node.value) &&\n node.key.name === node.value.name\n ) {\n return;\n }\n }\n\n this.token(\":\");\n this.space();\n this.print(node.value);\n}\n\nexport function ArrayExpression(this: Printer, node: t.ArrayExpression) {\n const elems = node.elements;\n const len = elems.length;\n\n this.token(\"[\");\n\n const oldNoLineTerminatorAfterNode = this.enterDelimited();\n\n for (let i = 0; i < elems.length; i++) {\n const elem = elems[i];\n if (elem) {\n if (i > 0) this.space();\n this.print(elem, undefined, true);\n if (i < len - 1 || this.shouldPrintTrailingComma(\"]\")) {\n this.tokenChar(charCodes.comma, i);\n }\n } else {\n // If the array expression ends with a hole, that hole\n // will be ignored by the interpreter, but if it ends with\n // two (or more) holes, we need to write out two (or more)\n // commas so that the resulting code is interpreted with\n // both (all) of the holes.\n this.tokenChar(charCodes.comma, i);\n }\n }\n\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n\n this.token(\"]\");\n}\n\nexport { ArrayExpression as ArrayPattern };\n\nexport function RegExpLiteral(this: Printer, node: t.RegExpLiteral) {\n this.word(`/${node.pattern}/${node.flags}`, false);\n}\n\nexport function BooleanLiteral(this: Printer, node: t.BooleanLiteral) {\n this.word(node.value ? \"true\" : \"false\");\n}\n\nexport function NullLiteral(this: Printer) {\n this.word(\"null\");\n}\n\nexport function NumericLiteral(this: Printer, node: t.NumericLiteral) {\n const raw = this.getPossibleRaw(node);\n const opts = this.format.jsescOption;\n const value = node.value;\n const str = value + \"\";\n if (opts.numbers) {\n this.number(jsesc(value, opts), value);\n } else if (raw == null) {\n this.number(str, value); // normalize\n } else if (this.format.minified) {\n this.number(raw.length < str.length ? raw : str, value);\n } else {\n this.number(raw, value);\n }\n}\n\nexport function StringLiteral(this: Printer, node: t.StringLiteral) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.token(raw);\n return;\n }\n\n const val = jsesc(node.value, this.format.jsescOption);\n\n this.token(val);\n}\n\nexport function BigIntLiteral(this: Printer, node: t.BigIntLiteral) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.word(raw);\n return;\n }\n this.word(node.value + \"n\");\n}\n\n// Hack pipe operator\nconst validTopicTokenSet = new Set<string | undefined>([\n \"^^\",\n \"@@\",\n \"^\",\n \"%\",\n \"#\",\n]);\nexport function TopicReference(this: Printer) {\n const { topicToken } = this.format;\n\n if (validTopicTokenSet.has(topicToken)) {\n this.token(topicToken!);\n } else {\n const givenTopicTokenJSON = JSON.stringify(topicToken);\n const validTopics = Array.from(validTopicTokenSet, v => JSON.stringify(v));\n throw new Error(\n `The \"topicToken\" generator option must be one of ` +\n `${validTopics.join(\", \")} (${givenTopicTokenJSON} received instead).`,\n );\n }\n}\n\n// Smart-mix pipe operator\nexport function PipelineTopicExpression(\n this: Printer,\n node: t.PipelineTopicExpression,\n) {\n this.print(node.expression);\n}\n\nexport function PipelineBareFunction(\n this: Printer,\n node: t.PipelineBareFunction,\n) {\n this.print(node.callee);\n}\n\nexport function PipelinePrimaryTopicReference(this: Printer) {\n this.token(\"#\");\n}\n\n// discard binding\nexport function VoidPattern(this: Printer) {\n this.word(\"void\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AAA2C;EANlCG,mBAAmB;EAAEC;AAAY,IAAAL,EAAA;AAQ1C,IAAIM,kBAA0B,GAAG,EAAE;AAC5B,SAASC,iBAAiBA,CAAgBC,IAAkB,EAAE;EACnE,MAAM;IAAEC;EAAK,CAAC,GAAGD,IAAI;EACrB,MAAME,KAAK,GAAG,IAAI,CAACC,QAAQ,CAAEC,IAAI,CAACJ,IAAI,EAAEK,GAAG,IAAIA,GAAG,CAACC,KAAK,KAAKL,IAAI,CAAC;EAClE,IAAIC,KAAK,EAAE;IACTJ,kBAAkB,GAAG,IAAI,CAACS,aAAa,CAAEC,KAAK,CAACN,KAAK,CAACO,KAAK,EAAEP,KAAK,CAACQ,GAAG,CAAC;IACtE,OAAOZ,kBAAkB;EAC3B;EACA,OAAQA,kBAAkB,GAAGE,IAAI,CAACC,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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.TSAnyKeyword = TSAnyKeyword;
|
| 7 |
+
exports.TSArrayType = TSArrayType;
|
| 8 |
+
exports.TSAsExpression = TSAsExpression;
|
| 9 |
+
exports.TSBigIntKeyword = TSBigIntKeyword;
|
| 10 |
+
exports.TSBooleanKeyword = TSBooleanKeyword;
|
| 11 |
+
exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration;
|
| 12 |
+
exports.TSInterfaceHeritage = exports.TSClassImplements = TSClassImplements;
|
| 13 |
+
exports.TSConditionalType = TSConditionalType;
|
| 14 |
+
exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;
|
| 15 |
+
exports.TSConstructorType = TSConstructorType;
|
| 16 |
+
exports.TSDeclareFunction = TSDeclareFunction;
|
| 17 |
+
exports.TSDeclareMethod = TSDeclareMethod;
|
| 18 |
+
exports.TSEnumBody = TSEnumBody;
|
| 19 |
+
exports.TSEnumDeclaration = TSEnumDeclaration;
|
| 20 |
+
exports.TSEnumMember = TSEnumMember;
|
| 21 |
+
exports.TSExportAssignment = TSExportAssignment;
|
| 22 |
+
exports.TSExternalModuleReference = TSExternalModuleReference;
|
| 23 |
+
exports.TSFunctionType = TSFunctionType;
|
| 24 |
+
exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
|
| 25 |
+
exports.TSImportType = TSImportType;
|
| 26 |
+
exports.TSIndexSignature = TSIndexSignature;
|
| 27 |
+
exports.TSIndexedAccessType = TSIndexedAccessType;
|
| 28 |
+
exports.TSInferType = TSInferType;
|
| 29 |
+
exports.TSInstantiationExpression = TSInstantiationExpression;
|
| 30 |
+
exports.TSInterfaceBody = TSInterfaceBody;
|
| 31 |
+
exports.TSInterfaceDeclaration = TSInterfaceDeclaration;
|
| 32 |
+
exports.TSIntersectionType = TSIntersectionType;
|
| 33 |
+
exports.TSIntrinsicKeyword = TSIntrinsicKeyword;
|
| 34 |
+
exports.TSLiteralType = TSLiteralType;
|
| 35 |
+
exports.TSMappedType = TSMappedType;
|
| 36 |
+
exports.TSMethodSignature = TSMethodSignature;
|
| 37 |
+
exports.TSModuleBlock = TSModuleBlock;
|
| 38 |
+
exports.TSModuleDeclaration = TSModuleDeclaration;
|
| 39 |
+
exports.TSNamedTupleMember = TSNamedTupleMember;
|
| 40 |
+
exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
|
| 41 |
+
exports.TSNeverKeyword = TSNeverKeyword;
|
| 42 |
+
exports.TSNonNullExpression = TSNonNullExpression;
|
| 43 |
+
exports.TSNullKeyword = TSNullKeyword;
|
| 44 |
+
exports.TSNumberKeyword = TSNumberKeyword;
|
| 45 |
+
exports.TSObjectKeyword = TSObjectKeyword;
|
| 46 |
+
exports.TSOptionalType = TSOptionalType;
|
| 47 |
+
exports.TSParameterProperty = TSParameterProperty;
|
| 48 |
+
exports.TSParenthesizedType = TSParenthesizedType;
|
| 49 |
+
exports.TSPropertySignature = TSPropertySignature;
|
| 50 |
+
exports.TSQualifiedName = TSQualifiedName;
|
| 51 |
+
exports.TSRestType = TSRestType;
|
| 52 |
+
exports.TSSatisfiesExpression = TSSatisfiesExpression;
|
| 53 |
+
exports.TSStringKeyword = TSStringKeyword;
|
| 54 |
+
exports.TSSymbolKeyword = TSSymbolKeyword;
|
| 55 |
+
exports.TSTemplateLiteralType = TSTemplateLiteralType;
|
| 56 |
+
exports.TSThisType = TSThisType;
|
| 57 |
+
exports.TSTupleType = TSTupleType;
|
| 58 |
+
exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
|
| 59 |
+
exports.TSTypeAnnotation = TSTypeAnnotation;
|
| 60 |
+
exports.TSTypeAssertion = TSTypeAssertion;
|
| 61 |
+
exports.TSTypeLiteral = TSTypeLiteral;
|
| 62 |
+
exports.TSTypeOperator = TSTypeOperator;
|
| 63 |
+
exports.TSTypeParameter = TSTypeParameter;
|
| 64 |
+
exports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
|
| 65 |
+
exports.TSTypePredicate = TSTypePredicate;
|
| 66 |
+
exports.TSTypeQuery = TSTypeQuery;
|
| 67 |
+
exports.TSTypeReference = TSTypeReference;
|
| 68 |
+
exports.TSUndefinedKeyword = TSUndefinedKeyword;
|
| 69 |
+
exports.TSUnionType = TSUnionType;
|
| 70 |
+
exports.TSUnknownKeyword = TSUnknownKeyword;
|
| 71 |
+
exports.TSVoidKeyword = TSVoidKeyword;
|
| 72 |
+
exports._tsPrintClassMemberModifiers = _tsPrintClassMemberModifiers;
|
| 73 |
+
var _methods = require("./methods.js");
|
| 74 |
+
var _classes = require("./classes.js");
|
| 75 |
+
var _templateLiterals = require("./template-literals.js");
|
| 76 |
+
function TSTypeAnnotation(node, parent) {
|
| 77 |
+
this.token((parent.type === "TSFunctionType" || parent.type === "TSConstructorType") && parent.typeAnnotation === node ? "=>" : ":");
|
| 78 |
+
this.space();
|
| 79 |
+
if (node.optional) this.tokenChar(63);
|
| 80 |
+
this.print(node.typeAnnotation);
|
| 81 |
+
}
|
| 82 |
+
function TSTypeParameterInstantiation(node, parent) {
|
| 83 |
+
this.tokenChar(60);
|
| 84 |
+
let printTrailingSeparator = parent.type === "ArrowFunctionExpression" && node.params.length === 1;
|
| 85 |
+
if (this.tokenMap && node.start != null && node.end != null) {
|
| 86 |
+
printTrailingSeparator && (printTrailingSeparator = !!this.tokenMap.find(node, t => this.tokenMap.matchesOriginal(t, ",")));
|
| 87 |
+
printTrailingSeparator || (printTrailingSeparator = this.shouldPrintTrailingComma(">"));
|
| 88 |
+
}
|
| 89 |
+
this.printList(node.params, printTrailingSeparator);
|
| 90 |
+
this.tokenChar(62);
|
| 91 |
+
}
|
| 92 |
+
function TSTypeParameter(node) {
|
| 93 |
+
if (node.const) {
|
| 94 |
+
this.word("const");
|
| 95 |
+
this.space();
|
| 96 |
+
}
|
| 97 |
+
if (node.in) {
|
| 98 |
+
this.word("in");
|
| 99 |
+
this.space();
|
| 100 |
+
}
|
| 101 |
+
if (node.out) {
|
| 102 |
+
this.word("out");
|
| 103 |
+
this.space();
|
| 104 |
+
}
|
| 105 |
+
this.word(node.name);
|
| 106 |
+
if (node.constraint) {
|
| 107 |
+
this.space();
|
| 108 |
+
this.word("extends");
|
| 109 |
+
this.space();
|
| 110 |
+
this.print(node.constraint);
|
| 111 |
+
}
|
| 112 |
+
if (node.default) {
|
| 113 |
+
this.space();
|
| 114 |
+
this.tokenChar(61);
|
| 115 |
+
this.space();
|
| 116 |
+
this.print(node.default);
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
function TSParameterProperty(node) {
|
| 120 |
+
if (node.accessibility) {
|
| 121 |
+
this.word(node.accessibility);
|
| 122 |
+
this.space();
|
| 123 |
+
}
|
| 124 |
+
if (node.readonly) {
|
| 125 |
+
this.word("readonly");
|
| 126 |
+
this.space();
|
| 127 |
+
}
|
| 128 |
+
_methods._param.call(this, node.parameter);
|
| 129 |
+
}
|
| 130 |
+
function TSDeclareFunction(node, parent) {
|
| 131 |
+
if (node.declare) {
|
| 132 |
+
this.word("declare");
|
| 133 |
+
this.space();
|
| 134 |
+
}
|
| 135 |
+
_methods._functionHead.call(this, node, parent, false);
|
| 136 |
+
this.semicolon();
|
| 137 |
+
}
|
| 138 |
+
function TSDeclareMethod(node) {
|
| 139 |
+
_classes._classMethodHead.call(this, node);
|
| 140 |
+
this.semicolon();
|
| 141 |
+
}
|
| 142 |
+
function TSQualifiedName(node) {
|
| 143 |
+
this.print(node.left);
|
| 144 |
+
this.tokenChar(46);
|
| 145 |
+
this.print(node.right);
|
| 146 |
+
}
|
| 147 |
+
function TSCallSignatureDeclaration(node) {
|
| 148 |
+
tsPrintSignatureDeclarationBase.call(this, node);
|
| 149 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 150 |
+
}
|
| 151 |
+
function maybePrintTrailingCommaOrSemicolon(printer, node) {
|
| 152 |
+
if (!printer.tokenMap || !node.start || !node.end) {
|
| 153 |
+
printer.semicolon();
|
| 154 |
+
return;
|
| 155 |
+
}
|
| 156 |
+
if (printer.tokenMap.endMatches(node, ",")) {
|
| 157 |
+
printer.token(",");
|
| 158 |
+
} else if (printer.tokenMap.endMatches(node, ";")) {
|
| 159 |
+
printer.semicolon();
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
function TSConstructSignatureDeclaration(node) {
|
| 163 |
+
this.word("new");
|
| 164 |
+
this.space();
|
| 165 |
+
tsPrintSignatureDeclarationBase.call(this, node);
|
| 166 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 167 |
+
}
|
| 168 |
+
function TSPropertySignature(node) {
|
| 169 |
+
const {
|
| 170 |
+
readonly
|
| 171 |
+
} = node;
|
| 172 |
+
if (readonly) {
|
| 173 |
+
this.word("readonly");
|
| 174 |
+
this.space();
|
| 175 |
+
}
|
| 176 |
+
tsPrintPropertyOrMethodName.call(this, node);
|
| 177 |
+
this.print(node.typeAnnotation);
|
| 178 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 179 |
+
}
|
| 180 |
+
function tsPrintPropertyOrMethodName(node) {
|
| 181 |
+
if (node.computed) {
|
| 182 |
+
this.tokenChar(91);
|
| 183 |
+
}
|
| 184 |
+
this.print(node.key);
|
| 185 |
+
if (node.computed) {
|
| 186 |
+
this.tokenChar(93);
|
| 187 |
+
}
|
| 188 |
+
if (node.optional) {
|
| 189 |
+
this.tokenChar(63);
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
+
function TSMethodSignature(node) {
|
| 193 |
+
const {
|
| 194 |
+
kind
|
| 195 |
+
} = node;
|
| 196 |
+
if (kind === "set" || kind === "get") {
|
| 197 |
+
this.word(kind);
|
| 198 |
+
this.space();
|
| 199 |
+
}
|
| 200 |
+
tsPrintPropertyOrMethodName.call(this, node);
|
| 201 |
+
tsPrintSignatureDeclarationBase.call(this, node);
|
| 202 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 203 |
+
}
|
| 204 |
+
function TSIndexSignature(node) {
|
| 205 |
+
const {
|
| 206 |
+
readonly,
|
| 207 |
+
static: isStatic
|
| 208 |
+
} = node;
|
| 209 |
+
if (isStatic) {
|
| 210 |
+
this.word("static");
|
| 211 |
+
this.space();
|
| 212 |
+
}
|
| 213 |
+
if (readonly) {
|
| 214 |
+
this.word("readonly");
|
| 215 |
+
this.space();
|
| 216 |
+
}
|
| 217 |
+
this.tokenChar(91);
|
| 218 |
+
_methods._parameters.call(this, node.parameters, 93);
|
| 219 |
+
this.print(node.typeAnnotation);
|
| 220 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 221 |
+
}
|
| 222 |
+
function TSAnyKeyword() {
|
| 223 |
+
this.word("any");
|
| 224 |
+
}
|
| 225 |
+
function TSBigIntKeyword() {
|
| 226 |
+
this.word("bigint");
|
| 227 |
+
}
|
| 228 |
+
function TSUnknownKeyword() {
|
| 229 |
+
this.word("unknown");
|
| 230 |
+
}
|
| 231 |
+
function TSNumberKeyword() {
|
| 232 |
+
this.word("number");
|
| 233 |
+
}
|
| 234 |
+
function TSObjectKeyword() {
|
| 235 |
+
this.word("object");
|
| 236 |
+
}
|
| 237 |
+
function TSBooleanKeyword() {
|
| 238 |
+
this.word("boolean");
|
| 239 |
+
}
|
| 240 |
+
function TSStringKeyword() {
|
| 241 |
+
this.word("string");
|
| 242 |
+
}
|
| 243 |
+
function TSSymbolKeyword() {
|
| 244 |
+
this.word("symbol");
|
| 245 |
+
}
|
| 246 |
+
function TSVoidKeyword() {
|
| 247 |
+
this.word("void");
|
| 248 |
+
}
|
| 249 |
+
function TSUndefinedKeyword() {
|
| 250 |
+
this.word("undefined");
|
| 251 |
+
}
|
| 252 |
+
function TSNullKeyword() {
|
| 253 |
+
this.word("null");
|
| 254 |
+
}
|
| 255 |
+
function TSNeverKeyword() {
|
| 256 |
+
this.word("never");
|
| 257 |
+
}
|
| 258 |
+
function TSIntrinsicKeyword() {
|
| 259 |
+
this.word("intrinsic");
|
| 260 |
+
}
|
| 261 |
+
function TSThisType() {
|
| 262 |
+
this.word("this");
|
| 263 |
+
}
|
| 264 |
+
function TSFunctionType(node) {
|
| 265 |
+
tsPrintFunctionOrConstructorType.call(this, node);
|
| 266 |
+
}
|
| 267 |
+
function TSConstructorType(node) {
|
| 268 |
+
if (node.abstract) {
|
| 269 |
+
this.word("abstract");
|
| 270 |
+
this.space();
|
| 271 |
+
}
|
| 272 |
+
this.word("new");
|
| 273 |
+
this.space();
|
| 274 |
+
tsPrintFunctionOrConstructorType.call(this, node);
|
| 275 |
+
}
|
| 276 |
+
function tsPrintFunctionOrConstructorType(node) {
|
| 277 |
+
const {
|
| 278 |
+
typeParameters
|
| 279 |
+
} = node;
|
| 280 |
+
const parameters = node.parameters;
|
| 281 |
+
this.print(typeParameters);
|
| 282 |
+
this.tokenChar(40);
|
| 283 |
+
_methods._parameters.call(this, parameters, 41);
|
| 284 |
+
this.space();
|
| 285 |
+
const returnType = node.typeAnnotation;
|
| 286 |
+
this.print(returnType);
|
| 287 |
+
}
|
| 288 |
+
function TSTypeReference(node) {
|
| 289 |
+
const typeArguments = node.typeParameters;
|
| 290 |
+
this.print(node.typeName, !!typeArguments);
|
| 291 |
+
this.print(typeArguments);
|
| 292 |
+
}
|
| 293 |
+
function TSTypePredicate(node) {
|
| 294 |
+
if (node.asserts) {
|
| 295 |
+
this.word("asserts");
|
| 296 |
+
this.space();
|
| 297 |
+
}
|
| 298 |
+
this.print(node.parameterName);
|
| 299 |
+
if (node.typeAnnotation) {
|
| 300 |
+
this.space();
|
| 301 |
+
this.word("is");
|
| 302 |
+
this.space();
|
| 303 |
+
this.print(node.typeAnnotation.typeAnnotation);
|
| 304 |
+
}
|
| 305 |
+
}
|
| 306 |
+
function TSTypeQuery(node) {
|
| 307 |
+
this.word("typeof");
|
| 308 |
+
this.space();
|
| 309 |
+
this.print(node.exprName);
|
| 310 |
+
const typeArguments = node.typeParameters;
|
| 311 |
+
if (typeArguments) {
|
| 312 |
+
this.print(typeArguments);
|
| 313 |
+
}
|
| 314 |
+
}
|
| 315 |
+
function TSTypeLiteral(node) {
|
| 316 |
+
printBraced(this, node, () => this.printJoin(node.members, true, true, undefined, undefined, true));
|
| 317 |
+
}
|
| 318 |
+
function TSArrayType(node) {
|
| 319 |
+
this.print(node.elementType, true);
|
| 320 |
+
this.tokenChar(91);
|
| 321 |
+
this.tokenChar(93);
|
| 322 |
+
}
|
| 323 |
+
function TSTupleType(node) {
|
| 324 |
+
this.tokenChar(91);
|
| 325 |
+
this.printList(node.elementTypes, this.shouldPrintTrailingComma("]"));
|
| 326 |
+
this.tokenChar(93);
|
| 327 |
+
}
|
| 328 |
+
function TSOptionalType(node) {
|
| 329 |
+
this.print(node.typeAnnotation);
|
| 330 |
+
this.tokenChar(63);
|
| 331 |
+
}
|
| 332 |
+
function TSRestType(node) {
|
| 333 |
+
this.token("...");
|
| 334 |
+
this.print(node.typeAnnotation);
|
| 335 |
+
}
|
| 336 |
+
function TSNamedTupleMember(node) {
|
| 337 |
+
this.print(node.label);
|
| 338 |
+
if (node.optional) this.tokenChar(63);
|
| 339 |
+
this.tokenChar(58);
|
| 340 |
+
this.space();
|
| 341 |
+
this.print(node.elementType);
|
| 342 |
+
}
|
| 343 |
+
function TSUnionType(node) {
|
| 344 |
+
tsPrintUnionOrIntersectionType(this, node, "|");
|
| 345 |
+
}
|
| 346 |
+
function TSIntersectionType(node) {
|
| 347 |
+
tsPrintUnionOrIntersectionType(this, node, "&");
|
| 348 |
+
}
|
| 349 |
+
function tsPrintUnionOrIntersectionType(printer, node, sep) {
|
| 350 |
+
var _printer$tokenMap;
|
| 351 |
+
let hasLeadingToken = 0;
|
| 352 |
+
if ((_printer$tokenMap = printer.tokenMap) != null && _printer$tokenMap.startMatches(node, sep)) {
|
| 353 |
+
hasLeadingToken = 1;
|
| 354 |
+
printer.token(sep);
|
| 355 |
+
}
|
| 356 |
+
printer.printJoin(node.types, undefined, undefined, function (i) {
|
| 357 |
+
this.space();
|
| 358 |
+
this.token(sep, undefined, i + hasLeadingToken);
|
| 359 |
+
this.space();
|
| 360 |
+
});
|
| 361 |
+
}
|
| 362 |
+
function TSConditionalType(node) {
|
| 363 |
+
this.print(node.checkType);
|
| 364 |
+
this.space();
|
| 365 |
+
this.word("extends");
|
| 366 |
+
this.space();
|
| 367 |
+
this.print(node.extendsType);
|
| 368 |
+
this.space();
|
| 369 |
+
this.tokenChar(63);
|
| 370 |
+
this.space();
|
| 371 |
+
this.print(node.trueType);
|
| 372 |
+
this.space();
|
| 373 |
+
this.tokenChar(58);
|
| 374 |
+
this.space();
|
| 375 |
+
this.print(node.falseType);
|
| 376 |
+
}
|
| 377 |
+
function TSInferType(node) {
|
| 378 |
+
this.word("infer");
|
| 379 |
+
this.print(node.typeParameter);
|
| 380 |
+
}
|
| 381 |
+
function TSParenthesizedType(node) {
|
| 382 |
+
this.tokenChar(40);
|
| 383 |
+
this.print(node.typeAnnotation);
|
| 384 |
+
this.tokenChar(41);
|
| 385 |
+
}
|
| 386 |
+
function TSTypeOperator(node) {
|
| 387 |
+
this.word(node.operator);
|
| 388 |
+
this.space();
|
| 389 |
+
this.print(node.typeAnnotation);
|
| 390 |
+
}
|
| 391 |
+
function TSIndexedAccessType(node) {
|
| 392 |
+
this.print(node.objectType, true);
|
| 393 |
+
this.tokenChar(91);
|
| 394 |
+
this.print(node.indexType);
|
| 395 |
+
this.tokenChar(93);
|
| 396 |
+
}
|
| 397 |
+
function TSMappedType(node) {
|
| 398 |
+
const {
|
| 399 |
+
nameType,
|
| 400 |
+
optional,
|
| 401 |
+
readonly,
|
| 402 |
+
typeAnnotation
|
| 403 |
+
} = node;
|
| 404 |
+
this.tokenChar(123);
|
| 405 |
+
const oldNoLineTerminatorAfterNode = this.enterDelimited();
|
| 406 |
+
this.space();
|
| 407 |
+
if (readonly) {
|
| 408 |
+
tokenIfPlusMinus(this, readonly);
|
| 409 |
+
this.word("readonly");
|
| 410 |
+
this.space();
|
| 411 |
+
}
|
| 412 |
+
this.tokenChar(91);
|
| 413 |
+
this.word(node.typeParameter.name);
|
| 414 |
+
this.space();
|
| 415 |
+
this.word("in");
|
| 416 |
+
this.space();
|
| 417 |
+
this.print(node.typeParameter.constraint, undefined, true);
|
| 418 |
+
if (nameType) {
|
| 419 |
+
this.space();
|
| 420 |
+
this.word("as");
|
| 421 |
+
this.space();
|
| 422 |
+
this.print(nameType, undefined, true);
|
| 423 |
+
}
|
| 424 |
+
this.tokenChar(93);
|
| 425 |
+
if (optional) {
|
| 426 |
+
tokenIfPlusMinus(this, optional);
|
| 427 |
+
this.tokenChar(63);
|
| 428 |
+
}
|
| 429 |
+
if (typeAnnotation) {
|
| 430 |
+
this.tokenChar(58);
|
| 431 |
+
this.space();
|
| 432 |
+
this.print(typeAnnotation, undefined, true);
|
| 433 |
+
}
|
| 434 |
+
this.space();
|
| 435 |
+
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
| 436 |
+
this.tokenChar(125);
|
| 437 |
+
}
|
| 438 |
+
function tokenIfPlusMinus(self, tok) {
|
| 439 |
+
if (tok !== true) {
|
| 440 |
+
self.token(tok);
|
| 441 |
+
}
|
| 442 |
+
}
|
| 443 |
+
function TSTemplateLiteralType(node) {
|
| 444 |
+
_templateLiterals._printTemplate.call(this, node, node.types);
|
| 445 |
+
}
|
| 446 |
+
function TSLiteralType(node) {
|
| 447 |
+
this.print(node.literal);
|
| 448 |
+
}
|
| 449 |
+
function TSClassImplements(node) {
|
| 450 |
+
this.print(node.expression);
|
| 451 |
+
this.print(node.typeArguments);
|
| 452 |
+
}
|
| 453 |
+
function TSInterfaceDeclaration(node) {
|
| 454 |
+
const {
|
| 455 |
+
declare,
|
| 456 |
+
id,
|
| 457 |
+
typeParameters,
|
| 458 |
+
extends: extendz,
|
| 459 |
+
body
|
| 460 |
+
} = node;
|
| 461 |
+
if (declare) {
|
| 462 |
+
this.word("declare");
|
| 463 |
+
this.space();
|
| 464 |
+
}
|
| 465 |
+
this.word("interface");
|
| 466 |
+
this.space();
|
| 467 |
+
this.print(id);
|
| 468 |
+
this.print(typeParameters);
|
| 469 |
+
if (extendz != null && extendz.length) {
|
| 470 |
+
this.space();
|
| 471 |
+
this.word("extends");
|
| 472 |
+
this.space();
|
| 473 |
+
this.printList(extendz);
|
| 474 |
+
}
|
| 475 |
+
this.space();
|
| 476 |
+
this.print(body);
|
| 477 |
+
}
|
| 478 |
+
function TSInterfaceBody(node) {
|
| 479 |
+
printBraced(this, node, () => this.printJoin(node.body, true, true, undefined, undefined, true));
|
| 480 |
+
}
|
| 481 |
+
function TSTypeAliasDeclaration(node) {
|
| 482 |
+
const {
|
| 483 |
+
declare,
|
| 484 |
+
id,
|
| 485 |
+
typeParameters,
|
| 486 |
+
typeAnnotation
|
| 487 |
+
} = node;
|
| 488 |
+
if (declare) {
|
| 489 |
+
this.word("declare");
|
| 490 |
+
this.space();
|
| 491 |
+
}
|
| 492 |
+
this.word("type");
|
| 493 |
+
this.space();
|
| 494 |
+
this.print(id);
|
| 495 |
+
this.print(typeParameters);
|
| 496 |
+
this.space();
|
| 497 |
+
this.tokenChar(61);
|
| 498 |
+
this.space();
|
| 499 |
+
this.print(typeAnnotation);
|
| 500 |
+
this.semicolon();
|
| 501 |
+
}
|
| 502 |
+
function TSAsExpression(node) {
|
| 503 |
+
const {
|
| 504 |
+
expression,
|
| 505 |
+
typeAnnotation
|
| 506 |
+
} = node;
|
| 507 |
+
this.print(expression, true);
|
| 508 |
+
this.space();
|
| 509 |
+
this.word("as");
|
| 510 |
+
this.space();
|
| 511 |
+
this.print(typeAnnotation);
|
| 512 |
+
}
|
| 513 |
+
function TSSatisfiesExpression(node) {
|
| 514 |
+
const {
|
| 515 |
+
expression,
|
| 516 |
+
typeAnnotation
|
| 517 |
+
} = node;
|
| 518 |
+
this.print(expression, true);
|
| 519 |
+
this.space();
|
| 520 |
+
this.word("satisfies");
|
| 521 |
+
this.space();
|
| 522 |
+
this.print(typeAnnotation);
|
| 523 |
+
}
|
| 524 |
+
function TSTypeAssertion(node) {
|
| 525 |
+
const {
|
| 526 |
+
typeAnnotation,
|
| 527 |
+
expression
|
| 528 |
+
} = node;
|
| 529 |
+
this.tokenChar(60);
|
| 530 |
+
this.print(typeAnnotation);
|
| 531 |
+
this.tokenChar(62);
|
| 532 |
+
this.space();
|
| 533 |
+
this.print(expression);
|
| 534 |
+
}
|
| 535 |
+
function TSInstantiationExpression(node) {
|
| 536 |
+
this.print(node.expression);
|
| 537 |
+
this.print(node.typeParameters);
|
| 538 |
+
}
|
| 539 |
+
function TSEnumDeclaration(node) {
|
| 540 |
+
const {
|
| 541 |
+
declare,
|
| 542 |
+
const: isConst,
|
| 543 |
+
id
|
| 544 |
+
} = node;
|
| 545 |
+
if (declare) {
|
| 546 |
+
this.word("declare");
|
| 547 |
+
this.space();
|
| 548 |
+
}
|
| 549 |
+
if (isConst) {
|
| 550 |
+
this.word("const");
|
| 551 |
+
this.space();
|
| 552 |
+
}
|
| 553 |
+
this.word("enum");
|
| 554 |
+
this.space();
|
| 555 |
+
this.print(id);
|
| 556 |
+
this.space();
|
| 557 |
+
TSEnumBody.call(this, node);
|
| 558 |
+
}
|
| 559 |
+
function TSEnumBody(node) {
|
| 560 |
+
printBraced(this, node, () => {
|
| 561 |
+
var _this$shouldPrintTrai;
|
| 562 |
+
return this.printList(node.members, (_this$shouldPrintTrai = this.shouldPrintTrailingComma("}")) != null ? _this$shouldPrintTrai : true, true, true, undefined, true);
|
| 563 |
+
});
|
| 564 |
+
}
|
| 565 |
+
function TSEnumMember(node) {
|
| 566 |
+
const {
|
| 567 |
+
id,
|
| 568 |
+
initializer
|
| 569 |
+
} = node;
|
| 570 |
+
this.print(id);
|
| 571 |
+
if (initializer) {
|
| 572 |
+
this.space();
|
| 573 |
+
this.tokenChar(61);
|
| 574 |
+
this.space();
|
| 575 |
+
this.print(initializer);
|
| 576 |
+
}
|
| 577 |
+
}
|
| 578 |
+
function TSModuleDeclaration(node) {
|
| 579 |
+
const {
|
| 580 |
+
declare,
|
| 581 |
+
id,
|
| 582 |
+
kind
|
| 583 |
+
} = node;
|
| 584 |
+
if (declare) {
|
| 585 |
+
this.word("declare");
|
| 586 |
+
this.space();
|
| 587 |
+
}
|
| 588 |
+
if (!node.global) {
|
| 589 |
+
this.word(kind != null ? kind : id.type === "Identifier" ? "namespace" : "module");
|
| 590 |
+
this.space();
|
| 591 |
+
}
|
| 592 |
+
this.print(id);
|
| 593 |
+
if (!node.body) {
|
| 594 |
+
this.semicolon();
|
| 595 |
+
return;
|
| 596 |
+
}
|
| 597 |
+
let body = node.body;
|
| 598 |
+
while (body.type === "TSModuleDeclaration") {
|
| 599 |
+
this.tokenChar(46);
|
| 600 |
+
this.print(body.id);
|
| 601 |
+
body = body.body;
|
| 602 |
+
}
|
| 603 |
+
this.space();
|
| 604 |
+
this.print(body);
|
| 605 |
+
}
|
| 606 |
+
function TSModuleBlock(node) {
|
| 607 |
+
printBraced(this, node, () => this.printSequence(node.body, true, true));
|
| 608 |
+
}
|
| 609 |
+
function TSImportType(node) {
|
| 610 |
+
const {
|
| 611 |
+
qualifier,
|
| 612 |
+
options
|
| 613 |
+
} = node;
|
| 614 |
+
this.word("import");
|
| 615 |
+
this.tokenChar(40);
|
| 616 |
+
this.print(node.argument);
|
| 617 |
+
if (options) {
|
| 618 |
+
this.tokenChar(44);
|
| 619 |
+
this.print(options);
|
| 620 |
+
}
|
| 621 |
+
this.tokenChar(41);
|
| 622 |
+
if (qualifier) {
|
| 623 |
+
this.tokenChar(46);
|
| 624 |
+
this.print(qualifier);
|
| 625 |
+
}
|
| 626 |
+
const typeArguments = node.typeParameters;
|
| 627 |
+
if (typeArguments) {
|
| 628 |
+
this.print(typeArguments);
|
| 629 |
+
}
|
| 630 |
+
}
|
| 631 |
+
function TSImportEqualsDeclaration(node) {
|
| 632 |
+
const {
|
| 633 |
+
id,
|
| 634 |
+
moduleReference
|
| 635 |
+
} = node;
|
| 636 |
+
if (node.isExport) {
|
| 637 |
+
this.word("export");
|
| 638 |
+
this.space();
|
| 639 |
+
}
|
| 640 |
+
this.word("import");
|
| 641 |
+
this.space();
|
| 642 |
+
this.print(id);
|
| 643 |
+
this.space();
|
| 644 |
+
this.tokenChar(61);
|
| 645 |
+
this.space();
|
| 646 |
+
this.print(moduleReference);
|
| 647 |
+
this.semicolon();
|
| 648 |
+
}
|
| 649 |
+
function TSExternalModuleReference(node) {
|
| 650 |
+
this.token("require(");
|
| 651 |
+
this.print(node.expression);
|
| 652 |
+
this.tokenChar(41);
|
| 653 |
+
}
|
| 654 |
+
function TSNonNullExpression(node) {
|
| 655 |
+
this.print(node.expression);
|
| 656 |
+
this.tokenChar(33);
|
| 657 |
+
this.setLastChar(33);
|
| 658 |
+
}
|
| 659 |
+
function TSExportAssignment(node) {
|
| 660 |
+
this.word("export");
|
| 661 |
+
this.space();
|
| 662 |
+
this.tokenChar(61);
|
| 663 |
+
this.space();
|
| 664 |
+
this.print(node.expression);
|
| 665 |
+
this.semicolon();
|
| 666 |
+
}
|
| 667 |
+
function TSNamespaceExportDeclaration(node) {
|
| 668 |
+
this.word("export");
|
| 669 |
+
this.space();
|
| 670 |
+
this.word("as");
|
| 671 |
+
this.space();
|
| 672 |
+
this.word("namespace");
|
| 673 |
+
this.space();
|
| 674 |
+
this.print(node.id);
|
| 675 |
+
this.semicolon();
|
| 676 |
+
}
|
| 677 |
+
function tsPrintSignatureDeclarationBase(node) {
|
| 678 |
+
const {
|
| 679 |
+
typeParameters
|
| 680 |
+
} = node;
|
| 681 |
+
const parameters = node.parameters;
|
| 682 |
+
this.print(typeParameters);
|
| 683 |
+
this.tokenChar(40);
|
| 684 |
+
_methods._parameters.call(this, parameters, 41);
|
| 685 |
+
const returnType = node.typeAnnotation;
|
| 686 |
+
this.print(returnType);
|
| 687 |
+
}
|
| 688 |
+
function _tsPrintClassMemberModifiers(node) {
|
| 689 |
+
const isPrivateField = node.type === "ClassPrivateProperty";
|
| 690 |
+
const isPublicField = node.type === "ClassAccessorProperty" || node.type === "ClassProperty";
|
| 691 |
+
printModifiersList(this, node, [isPublicField && node.declare && "declare", !isPrivateField && node.accessibility]);
|
| 692 |
+
if (node.static) {
|
| 693 |
+
this.word("static");
|
| 694 |
+
this.space();
|
| 695 |
+
}
|
| 696 |
+
printModifiersList(this, node, [!isPrivateField && node.abstract && "abstract", !isPrivateField && node.override && "override", (isPublicField || isPrivateField) && node.readonly && "readonly"]);
|
| 697 |
+
}
|
| 698 |
+
function printBraced(printer, node, cb) {
|
| 699 |
+
printer.token("{");
|
| 700 |
+
const oldNoLineTerminatorAfterNode = printer.enterDelimited();
|
| 701 |
+
cb();
|
| 702 |
+
printer._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
| 703 |
+
printer.rightBrace(node);
|
| 704 |
+
}
|
| 705 |
+
function printModifiersList(printer, node, modifiers) {
|
| 706 |
+
var _printer$tokenMap2;
|
| 707 |
+
const modifiersSet = new Set();
|
| 708 |
+
for (const modifier of modifiers) {
|
| 709 |
+
if (modifier) modifiersSet.add(modifier);
|
| 710 |
+
}
|
| 711 |
+
(_printer$tokenMap2 = printer.tokenMap) == null || _printer$tokenMap2.find(node, tok => {
|
| 712 |
+
if (modifiersSet.has(tok.value)) {
|
| 713 |
+
printer.token(tok.value);
|
| 714 |
+
printer.space();
|
| 715 |
+
modifiersSet.delete(tok.value);
|
| 716 |
+
return modifiersSet.size === 0;
|
| 717 |
+
}
|
| 718 |
+
return false;
|
| 719 |
+
});
|
| 720 |
+
for (const modifier of modifiersSet) {
|
| 721 |
+
printer.word(modifier);
|
| 722 |
+
printer.space();
|
| 723 |
+
}
|
| 724 |
+
}
|
| 725 |
+
|
| 726 |
+
//# sourceMappingURL=typescript.js.map
|
node_modules/@babel/generator/lib/generators/typescript.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_methods","require","_classes","_templateLiterals","TSTypeAnnotation","node","parent","token","type","typeAnnotation","space","optional","print","TSTypeParameterInstantiation","printTrailingSeparator","params","length","tokenMap","start","end","find","t","matchesOriginal","shouldPrintTrailingComma","printList","TSTypeParameter","const","word","in","out","name","constraint","default","TSParameterProperty","accessibility","readonly","_param","call","parameter","TSDeclareFunction","declare","_functionHead","semicolon","TSDeclareMethod","_classMethodHead","TSQualifiedName","left","right","TSCallSignatureDeclaration","tsPrintSignatureDeclarationBase","maybePrintTrailingCommaOrSemicolon","printer","endMatches","TSConstructSignatureDeclaration","TSPropertySignature","tsPrintPropertyOrMethodName","computed","key","TSMethodSignature","kind","TSIndexSignature","static","isStatic","_parameters","parameters","TSAnyKeyword","TSBigIntKeyword","TSUnknownKeyword","TSNumberKeyword","TSObjectKeyword","TSBooleanKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSUndefinedKeyword","TSNullKeyword","TSNeverKeyword","TSIntrinsicKeyword","TSThisType","TSFunctionType","tsPrintFunctionOrConstructorType","TSConstructorType","abstract","typeParameters","returnType","TSTypeReference","typeArguments","typeName","TSTypePredicate","asserts","parameterName","TSTypeQuery","exprName","TSTypeLiteral","printBraced","printJoin","members","undefined","TSArrayType","elementType","TSTupleType","elementTypes","TSOptionalType","TSRestType","TSNamedTupleMember","label","TSUnionType","tsPrintUnionOrIntersectionType","TSIntersectionType","sep","_printer$tokenMap","hasLeadingToken","startMatches","types","i","TSConditionalType","checkType","extendsType","trueType","falseType","TSInferType","typeParameter","TSParenthesizedType","TSTypeOperator","operator","TSIndexedAccessType","objectType","indexType","TSMappedType","nameType","oldNoLineTerminatorAfterNode","enterDelimited","tokenIfPlusMinus","_noLineTerminatorAfterNode","self","tok","TSTemplateLiteralType","_printTemplate","TSLiteralType","literal","TSClassImplements","expression","TSInterfaceDeclaration","id","extends","extendz","body","TSInterfaceBody","TSTypeAliasDeclaration","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSInstantiationExpression","TSEnumDeclaration","isConst","TSEnumBody","_this$shouldPrintTrai","TSEnumMember","initializer","TSModuleDeclaration","global","TSModuleBlock","printSequence","TSImportType","qualifier","options","argument","TSImportEqualsDeclaration","moduleReference","isExport","TSExternalModuleReference","TSNonNullExpression","setLastChar","TSExportAssignment","TSNamespaceExportDeclaration","_tsPrintClassMemberModifiers","isPrivateField","isPublicField","printModifiersList","override","cb","rightBrace","modifiers","_printer$tokenMap2","modifiersSet","Set","modifier","add","has","value","delete","size"],"sources":["../../src/generators/typescript.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\nimport { _functionHead, _param, _parameters } from \"./methods.ts\";\nimport { _classMethodHead } from \"./classes.ts\";\nimport { _printTemplate } from \"./template-literals.ts\";\n\nexport function TSTypeAnnotation(\n this: Printer,\n node: t.TSTypeAnnotation,\n parent: t.Node,\n) {\n // TODO(@nicolo-ribaudo): investigate not including => in the range\n // of the return type of an arrow function type\n this.token(\n (parent.type === \"TSFunctionType\" || parent.type === \"TSConstructorType\") &&\n (process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n parent.returnType\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n parent.typeAnnotation) === node\n ? \"=>\"\n : \":\",\n );\n this.space();\n // @ts-expect-error todo(flow->ts) can this be removed? `.optional` looks to be not existing property\n if (node.optional) this.token(\"?\");\n this.print(node.typeAnnotation);\n}\n\nexport function TSTypeParameterInstantiation(\n this: Printer,\n node: t.TSTypeParameterInstantiation,\n parent: t.Node,\n): void {\n this.token(\"<\");\n\n let printTrailingSeparator: boolean | null =\n parent.type === \"ArrowFunctionExpression\" && node.params.length === 1;\n if (this.tokenMap && node.start != null && node.end != null) {\n // Only force the trailing comma for pre-existing nodes if they\n // already had a comma (either because they were multi-param, or\n // because they had a trailing comma)\n printTrailingSeparator &&= !!this.tokenMap.find(node, t =>\n this.tokenMap!.matchesOriginal(t, \",\"),\n );\n // Preserve the trailing comma if it was there before\n printTrailingSeparator ||= this.shouldPrintTrailingComma(\">\");\n }\n\n this.printList(node.params, printTrailingSeparator);\n this.token(\">\");\n}\n\nexport { TSTypeParameterInstantiation as TSTypeParameterDeclaration };\n\nexport function TSTypeParameter(this: Printer, node: t.TSTypeParameter) {\n if (node.const) {\n this.word(\"const\");\n this.space();\n }\n\n if (node.in) {\n this.word(\"in\");\n this.space();\n }\n\n if (node.out) {\n this.word(\"out\");\n this.space();\n }\n\n this.word(\n !process.env.BABEL_8_BREAKING\n ? (node.name as unknown as string)\n : (node.name as unknown as t.Identifier).name,\n );\n\n if (node.constraint) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.constraint);\n }\n\n if (node.default) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.default);\n }\n}\n\nexport function TSParameterProperty(\n this: Printer,\n node: t.TSParameterProperty,\n) {\n if (node.accessibility) {\n this.word(node.accessibility);\n this.space();\n }\n\n if (node.readonly) {\n this.word(\"readonly\");\n this.space();\n }\n\n _param.call(this, node.parameter);\n}\n\nexport function TSDeclareFunction(\n this: Printer,\n node: t.TSDeclareFunction,\n parent: t.ParentMaps[\"TSDeclareFunction\"],\n) {\n if (node.declare) {\n this.word(\"declare\");\n this.space();\n }\n _functionHead.call(this, node, parent, false);\n this.semicolon();\n}\n\nexport function TSDeclareMethod(this: Printer, node: t.TSDeclareMethod) {\n _classMethodHead.call(this, node);\n this.semicolon();\n}\n\nexport function TSQualifiedName(this: Printer, node: t.TSQualifiedName) {\n this.print(node.left);\n this.token(\".\");\n this.print(node.right);\n}\n\nexport function TSCallSignatureDeclaration(\n this: Printer,\n node: t.TSCallSignatureDeclaration,\n) {\n tsPrintSignatureDeclarationBase.call(this, node);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nfunction maybePrintTrailingCommaOrSemicolon(printer: Printer, node: t.Node) {\n if (!printer.tokenMap || !node.start || !node.end) {\n printer.semicolon();\n return;\n }\n\n if (printer.tokenMap.endMatches(node, \",\")) {\n printer.token(\",\");\n } else if (printer.tokenMap.endMatches(node, \";\")) {\n printer.semicolon();\n }\n}\n\nexport function TSConstructSignatureDeclaration(\n this: Printer,\n node: t.TSConstructSignatureDeclaration,\n) {\n this.word(\"new\");\n this.space();\n tsPrintSignatureDeclarationBase.call(this, node);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nexport function TSPropertySignature(\n this: Printer,\n node: t.TSPropertySignature,\n) {\n const { readonly } = node;\n if (readonly) {\n this.word(\"readonly\");\n this.space();\n }\n tsPrintPropertyOrMethodName.call(this, node);\n this.print(node.typeAnnotation);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nfunction tsPrintPropertyOrMethodName(\n this: Printer,\n node: t.TSPropertySignature | t.TSMethodSignature,\n) {\n if (node.computed) {\n this.token(\"[\");\n }\n this.print(node.key);\n if (node.computed) {\n this.token(\"]\");\n }\n if (node.optional) {\n this.token(\"?\");\n }\n}\n\nexport function TSMethodSignature(this: Printer, node: t.TSMethodSignature) {\n const { kind } = node;\n if (kind === \"set\" || kind === \"get\") {\n this.word(kind);\n this.space();\n }\n tsPrintPropertyOrMethodName.call(this, node);\n tsPrintSignatureDeclarationBase.call(this, node);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nexport function TSIndexSignature(this: Printer, node: t.TSIndexSignature) {\n const { readonly, static: isStatic } = node;\n if (isStatic) {\n this.word(\"static\");\n this.space();\n }\n if (readonly) {\n this.word(\"readonly\");\n this.space();\n }\n this.token(\"[\");\n _parameters.call(this, node.parameters, charCodes.rightSquareBracket);\n this.print(node.typeAnnotation);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nexport function TSAnyKeyword(this: Printer) {\n this.word(\"any\");\n}\nexport function TSBigIntKeyword(this: Printer) {\n this.word(\"bigint\");\n}\nexport function TSUnknownKeyword(this: Printer) {\n this.word(\"unknown\");\n}\nexport function TSNumberKeyword(this: Printer) {\n this.word(\"number\");\n}\nexport function TSObjectKeyword(this: Printer) {\n this.word(\"object\");\n}\nexport function TSBooleanKeyword(this: Printer) {\n this.word(\"boolean\");\n}\nexport function TSStringKeyword(this: Printer) {\n this.word(\"string\");\n}\nexport function TSSymbolKeyword(this: Printer) {\n this.word(\"symbol\");\n}\nexport function TSVoidKeyword(this: Printer) {\n this.word(\"void\");\n}\nexport function TSUndefinedKeyword(this: Printer) {\n this.word(\"undefined\");\n}\nexport function TSNullKeyword(this: Printer) {\n this.word(\"null\");\n}\nexport function TSNeverKeyword(this: Printer) {\n this.word(\"never\");\n}\nexport function TSIntrinsicKeyword(this: Printer) {\n this.word(\"intrinsic\");\n}\n\nexport function TSThisType(this: Printer) {\n this.word(\"this\");\n}\n\nexport function TSFunctionType(this: Printer, node: t.TSFunctionType) {\n tsPrintFunctionOrConstructorType.call(this, node);\n}\n\nexport function TSConstructorType(this: Printer, node: t.TSConstructorType) {\n if (node.abstract) {\n this.word(\"abstract\");\n this.space();\n }\n this.word(\"new\");\n this.space();\n tsPrintFunctionOrConstructorType.call(this, node);\n}\n\nfunction tsPrintFunctionOrConstructorType(\n this: Printer,\n node: t.TSFunctionType | t.TSConstructorType,\n) {\n const { typeParameters } = node;\n const parameters = process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n node.params\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n node.parameters;\n this.print(typeParameters);\n this.token(\"(\");\n _parameters.call(this, parameters, charCodes.rightParenthesis);\n this.space();\n const returnType = process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n node.returnType\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n node.typeAnnotation;\n this.print(returnType);\n}\n\nexport function TSTypeReference(this: Printer, node: t.TSTypeReference) {\n const typeArguments = process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n node.typeArguments\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n node.typeParameters;\n this.print(node.typeName, !!typeArguments);\n this.print(typeArguments);\n}\n\nexport function TSTypePredicate(this: Printer, node: t.TSTypePredicate) {\n if (node.asserts) {\n this.word(\"asserts\");\n this.space();\n }\n this.print(node.parameterName);\n if (node.typeAnnotation) {\n this.space();\n this.word(\"is\");\n this.space();\n this.print(node.typeAnnotation.typeAnnotation);\n }\n}\n\nexport function TSTypeQuery(this: Printer, node: t.TSTypeQuery) {\n this.word(\"typeof\");\n this.space();\n this.print(node.exprName);\n\n const typeArguments = process.env.BABEL_8_BREAKING\n ? //@ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n node.typeArguments\n : //@ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node.typeParameters;\n if (typeArguments) {\n this.print(typeArguments);\n }\n}\n\nexport function TSTypeLiteral(this: Printer, node: t.TSTypeLiteral) {\n printBraced(this, node, () =>\n this.printJoin(node.members, true, true, undefined, undefined, true),\n );\n}\n\nexport function TSArrayType(this: Printer, node: t.TSArrayType) {\n this.print(node.elementType, true);\n\n this.token(\"[\");\n this.token(\"]\");\n}\n\nexport function TSTupleType(this: Printer, node: t.TSTupleType) {\n this.token(\"[\");\n this.printList(node.elementTypes, this.shouldPrintTrailingComma(\"]\"));\n this.token(\"]\");\n}\n\nexport function TSOptionalType(this: Printer, node: t.TSOptionalType) {\n this.print(node.typeAnnotation);\n this.token(\"?\");\n}\n\nexport function TSRestType(this: Printer, node: t.TSRestType) {\n this.token(\"...\");\n this.print(node.typeAnnotation);\n}\n\nexport function TSNamedTupleMember(this: Printer, node: t.TSNamedTupleMember) {\n this.print(node.label);\n if (node.optional) this.token(\"?\");\n this.token(\":\");\n this.space();\n this.print(node.elementType);\n}\n\nexport function TSUnionType(this: Printer, node: t.TSUnionType) {\n tsPrintUnionOrIntersectionType(this, node, \"|\");\n}\n\nexport function TSIntersectionType(this: Printer, node: t.TSIntersectionType) {\n tsPrintUnionOrIntersectionType(this, node, \"&\");\n}\n\nfunction tsPrintUnionOrIntersectionType(\n printer: Printer,\n node: t.TSUnionType | t.TSIntersectionType,\n sep: \"|\" | \"&\",\n) {\n let hasLeadingToken = 0;\n if (printer.tokenMap?.startMatches(node, sep)) {\n hasLeadingToken = 1;\n printer.token(sep);\n }\n\n printer.printJoin(node.types, undefined, undefined, function (i) {\n this.space();\n this.token(sep, undefined, i + hasLeadingToken);\n this.space();\n });\n}\n\nexport function TSConditionalType(this: Printer, node: t.TSConditionalType) {\n this.print(node.checkType);\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.extendsType);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.trueType);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.falseType);\n}\n\nexport function TSInferType(this: Printer, node: t.TSInferType) {\n this.word(\"infer\");\n this.print(node.typeParameter);\n}\n\nexport function TSParenthesizedType(\n this: Printer,\n node: t.TSParenthesizedType,\n) {\n this.token(\"(\");\n this.print(node.typeAnnotation);\n this.token(\")\");\n}\n\nexport function TSTypeOperator(this: Printer, node: t.TSTypeOperator) {\n this.word(node.operator);\n this.space();\n this.print(node.typeAnnotation);\n}\n\nexport function TSIndexedAccessType(\n this: Printer,\n node: t.TSIndexedAccessType,\n) {\n this.print(node.objectType, true);\n this.token(\"[\");\n this.print(node.indexType);\n this.token(\"]\");\n}\n\nexport function TSMappedType(this: Printer, node: t.TSMappedType) {\n const { nameType, optional, readonly, typeAnnotation } = node;\n this.token(\"{\");\n const oldNoLineTerminatorAfterNode = this.enterDelimited();\n this.space();\n if (readonly) {\n tokenIfPlusMinus(this, readonly);\n this.word(\"readonly\");\n this.space();\n }\n\n this.token(\"[\");\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n this.word(node.key.name);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n this.word(node.typeParameter.name);\n }\n\n this.space();\n this.word(\"in\");\n this.space();\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n this.print(node.constraint, undefined, true);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n this.print(node.typeParameter.constraint, undefined, true);\n }\n\n if (nameType) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(nameType, undefined, true);\n }\n\n this.token(\"]\");\n\n if (optional) {\n tokenIfPlusMinus(this, optional);\n this.token(\"?\");\n }\n\n if (typeAnnotation) {\n this.token(\":\");\n this.space();\n this.print(typeAnnotation, undefined, true);\n }\n this.space();\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n this.token(\"}\");\n}\n\nfunction tokenIfPlusMinus(self: Printer, tok: true | \"+\" | \"-\") {\n if (tok !== true) {\n self.token(tok);\n }\n}\n\nexport function TSTemplateLiteralType(\n this: Printer,\n node: t.TSTemplateLiteralType,\n) {\n _printTemplate.call(this, node, node.types);\n}\n\nexport function TSLiteralType(this: Printer, node: t.TSLiteralType) {\n this.print(node.literal);\n}\n\nexport function TSClassImplements(\n this: Printer,\n // TODO(Babel 8): Just use t.TSClassImplements\n node: t.Node & {\n expression: t.TSEntityName;\n typeArguments?: t.TSTypeParameterInstantiation;\n },\n) {\n this.print(node.expression);\n this.print(node.typeArguments);\n}\n\nexport { TSClassImplements as TSInterfaceHeritage };\n\nexport function TSInterfaceDeclaration(\n this: Printer,\n node: t.TSInterfaceDeclaration,\n) {\n const { declare, id, typeParameters, extends: extendz, body } = node;\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"interface\");\n this.space();\n this.print(id);\n this.print(typeParameters);\n if (extendz?.length) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.printList(extendz);\n }\n this.space();\n this.print(body);\n}\n\nexport function TSInterfaceBody(this: Printer, node: t.TSInterfaceBody) {\n printBraced(this, node, () =>\n this.printJoin(node.body, true, true, undefined, undefined, true),\n );\n}\n\nexport function TSTypeAliasDeclaration(\n this: Printer,\n node: t.TSTypeAliasDeclaration,\n) {\n const { declare, id, typeParameters, typeAnnotation } = node;\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"type\");\n this.space();\n this.print(id);\n this.print(typeParameters);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(typeAnnotation);\n this.semicolon();\n}\n\nexport function TSAsExpression(this: Printer, node: t.TSAsExpression) {\n const { expression, typeAnnotation } = node;\n this.print(expression, true);\n this.space();\n this.word(\"as\");\n this.space();\n this.print(typeAnnotation);\n}\n\nexport function TSSatisfiesExpression(\n this: Printer,\n node: t.TSSatisfiesExpression,\n) {\n const { expression, typeAnnotation } = node;\n this.print(expression, true);\n this.space();\n this.word(\"satisfies\");\n this.space();\n this.print(typeAnnotation);\n}\n\nexport function TSTypeAssertion(this: Printer, node: t.TSTypeAssertion) {\n const { typeAnnotation, expression } = node;\n this.token(\"<\");\n this.print(typeAnnotation);\n this.token(\">\");\n this.space();\n this.print(expression);\n}\n\nexport function TSInstantiationExpression(\n this: Printer,\n node: t.TSInstantiationExpression,\n) {\n this.print(node.expression);\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n this.print(node.typeArguments);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters);\n }\n}\n\nexport function TSEnumDeclaration(this: Printer, node: t.TSEnumDeclaration) {\n const { declare, const: isConst, id } = node;\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n if (isConst) {\n this.word(\"const\");\n this.space();\n }\n this.word(\"enum\");\n this.space();\n this.print(id);\n this.space();\n\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n this.print(node.body);\n } else {\n // cast to TSEnumBody for Babel 7 AST\n TSEnumBody.call(this, node as unknown as t.TSEnumBody);\n }\n}\n\nexport function TSEnumBody(this: Printer, node: t.TSEnumBody) {\n printBraced(this, node, () =>\n this.printList(\n node.members,\n this.shouldPrintTrailingComma(\"}\") ??\n (process.env.BABEL_8_BREAKING ? false : true),\n true,\n true,\n undefined,\n true,\n ),\n );\n}\n\nexport function TSEnumMember(this: Printer, node: t.TSEnumMember) {\n const { id, initializer } = node;\n this.print(id);\n if (initializer) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(initializer);\n }\n}\n\nexport function TSModuleDeclaration(\n this: Printer,\n node: t.TSModuleDeclaration,\n) {\n const { declare, id, kind } = node;\n\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n\n if (process.env.BABEL_8_BREAKING) {\n if (kind !== \"global\") {\n this.word(kind);\n this.space();\n }\n\n this.print(node.id);\n if (!node.body) {\n this.semicolon();\n return;\n }\n this.space();\n this.print(node.body);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n if (!node.global) {\n this.word(kind ?? (id.type === \"Identifier\" ? \"namespace\" : \"module\"));\n this.space();\n }\n\n this.print(id);\n\n if (!node.body) {\n this.semicolon();\n return;\n }\n\n let body = node.body;\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n while (body.type === \"TSModuleDeclaration\") {\n this.token(\".\");\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n this.print(body.id);\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n body = body.body;\n }\n\n this.space();\n this.print(body);\n }\n}\n\nexport function TSModuleBlock(this: Printer, node: t.TSModuleBlock) {\n printBraced(this, node, () => this.printSequence(node.body, true, true));\n}\n\nexport function TSImportType(this: Printer, node: t.TSImportType) {\n const { qualifier, options } = node;\n this.word(\"import\");\n this.token(\"(\");\n this.print(\n //@ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n process.env.BABEL_8_BREAKING ? node.source : node.argument,\n );\n if (options) {\n this.token(\",\");\n this.print(options);\n }\n this.token(\")\");\n if (qualifier) {\n this.token(\".\");\n this.print(qualifier);\n }\n const typeArguments = process.env.BABEL_8_BREAKING\n ? //@ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n node.typeArguments\n : //@ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node.typeParameters;\n if (typeArguments) {\n this.print(typeArguments);\n }\n}\n\nexport function TSImportEqualsDeclaration(\n this: Printer,\n node: t.TSImportEqualsDeclaration,\n) {\n const { id, moduleReference } = node;\n if (\n !process.env.BABEL_8_BREAKING &&\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node.isExport\n ) {\n this.word(\"export\");\n this.space();\n }\n this.word(\"import\");\n this.space();\n this.print(id);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(moduleReference);\n this.semicolon();\n}\n\nexport function TSExternalModuleReference(\n this: Printer,\n node: t.TSExternalModuleReference,\n) {\n this.token(\"require(\");\n this.print(node.expression);\n this.token(\")\");\n}\n\nexport function TSNonNullExpression(\n this: Printer,\n node: t.TSNonNullExpression,\n) {\n this.print(node.expression);\n this.token(\"!\");\n this.setLastChar(charCodes.exclamationMark);\n}\n\nexport function TSExportAssignment(this: Printer, node: t.TSExportAssignment) {\n this.word(\"export\");\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.expression);\n this.semicolon();\n}\n\nexport function TSNamespaceExportDeclaration(\n this: Printer,\n node: t.TSNamespaceExportDeclaration,\n) {\n this.word(\"export\");\n this.space();\n this.word(\"as\");\n this.space();\n this.word(\"namespace\");\n this.space();\n this.print(node.id);\n this.semicolon();\n}\n\nfunction tsPrintSignatureDeclarationBase(this: Printer, node: any) {\n const { typeParameters } = node;\n const parameters = process.env.BABEL_8_BREAKING\n ? node.params\n : node.parameters;\n this.print(typeParameters);\n this.token(\"(\");\n _parameters.call(this, parameters, charCodes.rightParenthesis);\n const returnType = process.env.BABEL_8_BREAKING\n ? node.returnType\n : node.typeAnnotation;\n this.print(returnType);\n}\n\nexport function _tsPrintClassMemberModifiers(\n this: Printer,\n node:\n | t.ClassProperty\n | t.ClassAccessorProperty\n | t.ClassPrivateProperty\n | t.ClassMethod\n | t.ClassPrivateMethod\n | t.TSDeclareMethod,\n) {\n const isPrivateField = node.type === \"ClassPrivateProperty\";\n const isPublicField =\n node.type === \"ClassAccessorProperty\" || node.type === \"ClassProperty\";\n printModifiersList(this, node, [\n isPublicField && node.declare && \"declare\",\n !isPrivateField && node.accessibility,\n ]);\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n printModifiersList(this, node, [\n !isPrivateField && node.abstract && \"abstract\",\n !isPrivateField && node.override && \"override\",\n (isPublicField || isPrivateField) && node.readonly && \"readonly\",\n ]);\n}\n\nfunction printBraced(printer: Printer, node: t.Node, cb: () => void) {\n printer.token(\"{\");\n const oldNoLineTerminatorAfterNode = printer.enterDelimited();\n cb();\n printer._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n printer.rightBrace(node);\n}\n\nfunction printModifiersList(\n printer: Printer,\n node: t.Node,\n modifiers: (string | false | null | undefined)[],\n) {\n const modifiersSet = new Set<string>();\n for (const modifier of modifiers) {\n if (modifier) modifiersSet.add(modifier);\n }\n\n printer.tokenMap?.find(node, tok => {\n if (modifiersSet.has(tok.value)) {\n printer.token(tok.value);\n printer.space();\n modifiersSet.delete(tok.value);\n return modifiersSet.size === 0;\n }\n return false;\n });\n\n for (const modifier of modifiersSet) {\n printer.word(modifier);\n printer.space();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = void 0;
|
| 7 |
+
exports.generate = generate;
|
| 8 |
+
var _sourceMap = require("./source-map.js");
|
| 9 |
+
var _printer = require("./printer.js");
|
| 10 |
+
function normalizeOptions(code, opts, ast) {
|
| 11 |
+
var _opts$recordAndTupleS;
|
| 12 |
+
if (opts.experimental_preserveFormat) {
|
| 13 |
+
if (typeof code !== "string") {
|
| 14 |
+
throw new Error("`experimental_preserveFormat` requires the original `code` to be passed to @babel/generator as a string");
|
| 15 |
+
}
|
| 16 |
+
if (!opts.retainLines) {
|
| 17 |
+
throw new Error("`experimental_preserveFormat` requires `retainLines` to be set to `true`");
|
| 18 |
+
}
|
| 19 |
+
if (opts.compact && opts.compact !== "auto") {
|
| 20 |
+
throw new Error("`experimental_preserveFormat` is not compatible with the `compact` option");
|
| 21 |
+
}
|
| 22 |
+
if (opts.minified) {
|
| 23 |
+
throw new Error("`experimental_preserveFormat` is not compatible with the `minified` option");
|
| 24 |
+
}
|
| 25 |
+
if (opts.jsescOption) {
|
| 26 |
+
throw new Error("`experimental_preserveFormat` is not compatible with the `jsescOption` option");
|
| 27 |
+
}
|
| 28 |
+
if (!Array.isArray(ast.tokens)) {
|
| 29 |
+
throw new Error("`experimental_preserveFormat` requires the AST to have attached the token of the input code. Make sure to enable the `tokens: true` parser option.");
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
const format = {
|
| 33 |
+
auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
|
| 34 |
+
auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
|
| 35 |
+
shouldPrintComment: opts.shouldPrintComment,
|
| 36 |
+
preserveFormat: opts.experimental_preserveFormat,
|
| 37 |
+
retainLines: opts.retainLines,
|
| 38 |
+
retainFunctionParens: opts.retainFunctionParens,
|
| 39 |
+
comments: opts.comments == null || opts.comments,
|
| 40 |
+
compact: opts.compact,
|
| 41 |
+
minified: opts.minified,
|
| 42 |
+
concise: opts.concise,
|
| 43 |
+
indent: {
|
| 44 |
+
adjustMultilineComment: true,
|
| 45 |
+
style: " "
|
| 46 |
+
},
|
| 47 |
+
jsescOption: Object.assign({
|
| 48 |
+
quotes: "double",
|
| 49 |
+
wrap: true,
|
| 50 |
+
minimal: false
|
| 51 |
+
}, opts.jsescOption),
|
| 52 |
+
topicToken: opts.topicToken
|
| 53 |
+
};
|
| 54 |
+
format.decoratorsBeforeExport = opts.decoratorsBeforeExport;
|
| 55 |
+
format.jsescOption.json = opts.jsonCompatibleStrings;
|
| 56 |
+
format.recordAndTupleSyntaxType = (_opts$recordAndTupleS = opts.recordAndTupleSyntaxType) != null ? _opts$recordAndTupleS : "hash";
|
| 57 |
+
format.importAttributesKeyword = opts.importAttributesKeyword;
|
| 58 |
+
if (format.minified) {
|
| 59 |
+
format.compact = true;
|
| 60 |
+
format.shouldPrintComment = format.shouldPrintComment || (() => format.comments);
|
| 61 |
+
} else {
|
| 62 |
+
format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.includes("@license") || value.includes("@preserve"));
|
| 63 |
+
}
|
| 64 |
+
if (format.compact === "auto") {
|
| 65 |
+
format.compact = typeof code === "string" && code.length > 500000;
|
| 66 |
+
if (format.compact) {
|
| 67 |
+
console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`);
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
if (format.compact || format.preserveFormat) {
|
| 71 |
+
format.indent.adjustMultilineComment = false;
|
| 72 |
+
}
|
| 73 |
+
const {
|
| 74 |
+
auxiliaryCommentBefore,
|
| 75 |
+
auxiliaryCommentAfter,
|
| 76 |
+
shouldPrintComment
|
| 77 |
+
} = format;
|
| 78 |
+
if (auxiliaryCommentBefore && !shouldPrintComment(auxiliaryCommentBefore)) {
|
| 79 |
+
format.auxiliaryCommentBefore = undefined;
|
| 80 |
+
}
|
| 81 |
+
if (auxiliaryCommentAfter && !shouldPrintComment(auxiliaryCommentAfter)) {
|
| 82 |
+
format.auxiliaryCommentAfter = undefined;
|
| 83 |
+
}
|
| 84 |
+
return format;
|
| 85 |
+
}
|
| 86 |
+
exports.CodeGenerator = class CodeGenerator {
|
| 87 |
+
constructor(ast, opts = {}, code) {
|
| 88 |
+
this._ast = void 0;
|
| 89 |
+
this._format = void 0;
|
| 90 |
+
this._map = void 0;
|
| 91 |
+
this._ast = ast;
|
| 92 |
+
this._format = normalizeOptions(code, opts, ast);
|
| 93 |
+
this._map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
|
| 94 |
+
}
|
| 95 |
+
generate() {
|
| 96 |
+
const printer = new _printer.default(this._format, this._map);
|
| 97 |
+
return printer.generate(this._ast);
|
| 98 |
+
}
|
| 99 |
+
};
|
| 100 |
+
function generate(ast, opts = {}, code) {
|
| 101 |
+
const format = normalizeOptions(code, opts, ast);
|
| 102 |
+
const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
|
| 103 |
+
const printer = new _printer.default(format, map, ast.tokens, typeof code === "string" ? code : null);
|
| 104 |
+
return printer.generate(ast);
|
| 105 |
+
}
|
| 106 |
+
var _default = exports.default = generate;
|
| 107 |
+
|
| 108 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/generator/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_sourceMap","require","_printer","normalizeOptions","code","opts","ast","_opts$recordAndTupleS","experimental_preserveFormat","Error","retainLines","compact","minified","jsescOption","Array","isArray","tokens","format","auxiliaryCommentBefore","auxiliaryCommentAfter","shouldPrintComment","preserveFormat","retainFunctionParens","comments","concise","indent","adjustMultilineComment","style","Object","assign","quotes","wrap","minimal","topicToken","decoratorsBeforeExport","json","jsonCompatibleStrings","recordAndTupleSyntaxType","importAttributesKeyword","value","includes","length","console","error","filename","undefined","exports","CodeGenerator","constructor","_ast","_format","_map","sourceMaps","SourceMap","generate","printer","Printer","map","_default","default"],"sources":["../src/index.ts"],"sourcesContent":["import SourceMap from \"./source-map.ts\";\nimport Printer from \"./printer.ts\";\nimport type * as t from \"@babel/types\";\nimport type { Opts as jsescOptions } from \"jsesc\";\nimport type { Format } from \"./printer.ts\";\nimport type {\n EncodedSourceMap,\n DecodedSourceMap,\n Mapping,\n} from \"@jridgewell/gen-mapping\";\n\n/**\n * Normalize generator options, setting defaults.\n *\n * - Detects code indentation.\n * - If `opts.compact = \"auto\"` and the code is over 500KB, `compact` will be set to `true`.\n */\n\nfunction normalizeOptions(\n code: string | Record<string, string> | undefined,\n opts: GeneratorOptions,\n ast: t.Node,\n): Format {\n if (opts.experimental_preserveFormat) {\n if (typeof code !== \"string\") {\n throw new Error(\n \"`experimental_preserveFormat` requires the original `code` to be passed to @babel/generator as a string\",\n );\n }\n if (!opts.retainLines) {\n throw new Error(\n \"`experimental_preserveFormat` requires `retainLines` to be set to `true`\",\n );\n }\n if (opts.compact && opts.compact !== \"auto\") {\n throw new Error(\n \"`experimental_preserveFormat` is not compatible with the `compact` option\",\n );\n }\n if (opts.minified) {\n throw new Error(\n \"`experimental_preserveFormat` is not compatible with the `minified` option\",\n );\n }\n if (opts.jsescOption) {\n throw new Error(\n \"`experimental_preserveFormat` is not compatible with the `jsescOption` option\",\n );\n }\n if (!Array.isArray((ast as any).tokens)) {\n throw new Error(\n \"`experimental_preserveFormat` requires the AST to have attached the token of the input code. Make sure to enable the `tokens: true` parser option.\",\n );\n }\n }\n\n const format: Format = {\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n // @ts-expect-error define it later\n shouldPrintComment: opts.shouldPrintComment,\n preserveFormat: opts.experimental_preserveFormat,\n retainLines: opts.retainLines,\n retainFunctionParens: opts.retainFunctionParens,\n comments: opts.comments == null || opts.comments,\n compact: opts.compact,\n minified: opts.minified,\n concise: opts.concise,\n indent: {\n adjustMultilineComment: true,\n style: \" \",\n },\n jsescOption: {\n quotes: \"double\",\n wrap: true,\n minimal: process.env.BABEL_8_BREAKING ? true : false,\n ...opts.jsescOption,\n },\n topicToken: opts.topicToken,\n };\n\n if (!process.env.BABEL_8_BREAKING) {\n format.decoratorsBeforeExport = opts.decoratorsBeforeExport;\n format.jsescOption.json = opts.jsonCompatibleStrings;\n format.recordAndTupleSyntaxType = opts.recordAndTupleSyntaxType ?? \"hash\";\n format.importAttributesKeyword = opts.importAttributesKeyword;\n }\n\n if (format.minified) {\n format.compact = true;\n\n format.shouldPrintComment =\n format.shouldPrintComment || (() => format.comments);\n } else {\n format.shouldPrintComment =\n format.shouldPrintComment ||\n (value =>\n format.comments ||\n value.includes(\"@license\") ||\n value.includes(\"@preserve\"));\n }\n\n if (format.compact === \"auto\") {\n format.compact = typeof code === \"string\" && code.length > 500_000; // 500KB\n\n if (format.compact) {\n console.error(\n \"[BABEL] Note: The code generator has deoptimised the styling of \" +\n `${opts.filename} as it exceeds the max of ${\"500KB\"}.`,\n );\n }\n }\n\n if (format.compact || format.preserveFormat) {\n format.indent.adjustMultilineComment = false;\n }\n\n const { auxiliaryCommentBefore, auxiliaryCommentAfter, shouldPrintComment } =\n format;\n\n if (auxiliaryCommentBefore && !shouldPrintComment(auxiliaryCommentBefore)) {\n format.auxiliaryCommentBefore = undefined;\n }\n if (auxiliaryCommentAfter && !shouldPrintComment(auxiliaryCommentAfter)) {\n format.auxiliaryCommentAfter = undefined;\n }\n\n return format;\n}\n\nexport interface GeneratorOptions {\n /**\n * Optional string to add as a block comment at the start of the output file.\n */\n auxiliaryCommentBefore?: string;\n\n /**\n * Optional string to add as a block comment at the end of the output file.\n */\n auxiliaryCommentAfter?: string;\n\n /**\n * Function that takes a comment (as a string) and returns true if the comment should be included in the output.\n * By default, comments are included if `opts.comments` is `true` or if `opts.minified` is `false` and the comment\n * contains `@preserve` or `@license`.\n */\n shouldPrintComment?(comment: string): boolean;\n\n /**\n * Preserve the input code format while printing the transformed code.\n * This is experimental, and may have breaking changes in future\n * patch releases. It will be removed in a future minor release,\n * when it will graduate to stable.\n */\n experimental_preserveFormat?: boolean;\n\n /**\n * Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces).\n * Defaults to `false`.\n */\n retainLines?: boolean;\n\n /**\n * Retain parens around function expressions (could be used to change engine parsing behavior)\n * Defaults to `false`.\n */\n retainFunctionParens?: boolean;\n\n /**\n * Should comments be included in output? Defaults to `true`.\n */\n comments?: boolean;\n\n /**\n * Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`.\n */\n compact?: boolean | \"auto\";\n\n /**\n * Should the output be minified. Defaults to `false`.\n */\n minified?: boolean;\n\n /**\n * Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`.\n */\n concise?: boolean;\n\n /**\n * Used in warning messages\n */\n filename?: string;\n\n /**\n * Enable generating source maps. Defaults to `false`.\n */\n sourceMaps?: boolean;\n\n inputSourceMap?: any;\n\n /**\n * A root for all relative URLs in the source map.\n */\n sourceRoot?: string;\n\n /**\n * The filename for the source code (i.e. the code in the `code` argument).\n * This will only be used if `code` is a string.\n */\n sourceFileName?: string;\n\n /**\n * Set to true to run jsesc with \"json\": true to print \"\\u00A9\" vs. \"©\";\n * @deprecated use `jsescOptions: { json: true }` instead\n */\n jsonCompatibleStrings?: boolean;\n\n /**\n * Set to true to enable support for experimental decorators syntax before\n * module exports. If not specified, decorators will be printed in the same\n * position as they were in the input source code.\n * @deprecated Removed in Babel 8\n */\n decoratorsBeforeExport?: boolean;\n\n /**\n * Options for outputting jsesc representation.\n */\n jsescOption?: jsescOptions;\n\n /**\n * For use with the recordAndTuple token.\n * @deprecated It will be removed in Babel 8.\n */\n recordAndTupleSyntaxType?: \"bar\" | \"hash\";\n\n /**\n * For use with the Hack-style pipe operator.\n * Changes what token is used for pipe bodies’ topic references.\n */\n topicToken?: \"%\" | \"#\" | \"@@\" | \"^^\" | \"^\";\n\n /**\n * The import attributes syntax style:\n * - \"with\" : `import { a } from \"b\" with { type: \"json\" };`\n * - \"assert\" : `import { a } from \"b\" assert { type: \"json\" };`\n * - \"with-legacy\" : `import { a } from \"b\" with type: \"json\";`\n * @deprecated Removed in Babel 8.\n */\n importAttributesKeyword?: \"with\" | \"assert\" | \"with-legacy\";\n}\n\nexport interface GeneratorResult {\n code: string;\n map: EncodedSourceMap | null;\n decodedMap: DecodedSourceMap | undefined;\n rawMappings: Mapping[] | undefined;\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n /**\n * We originally exported the Generator class above, but to make it extra clear that it is a private API,\n * we have moved that to an internal class instance and simplified the interface to the two public methods\n * that we wish to support.\n */\n\n // eslint-disable-next-line no-restricted-globals\n exports.CodeGenerator = class CodeGenerator {\n private _ast: t.Node;\n private _format: Format;\n private _map: SourceMap | null;\n constructor(ast: t.Node, opts: GeneratorOptions = {}, code?: string) {\n this._ast = ast;\n this._format = normalizeOptions(code, opts, ast);\n this._map = opts.sourceMaps ? new SourceMap(opts, code) : null;\n }\n generate(): GeneratorResult {\n const printer = new Printer(this._format, this._map);\n\n return printer.generate(this._ast);\n }\n };\n}\n\n/**\n * Turns an AST into code, maintaining sourcemaps, user preferences, and valid output.\n * @param ast - the abstract syntax tree from which to generate output code.\n * @param opts - used for specifying options for code generation.\n * @param code - the original source code, used for source maps.\n * @returns - an object containing the output code and source map.\n */\nexport function generate(\n ast: t.Node,\n opts: GeneratorOptions = {},\n code?: string | Record<string, string>,\n): GeneratorResult {\n const format = normalizeOptions(code, opts, ast);\n const map = opts.sourceMaps ? new SourceMap(opts, code) : null;\n\n const printer = new Printer(\n format,\n map,\n (ast as any).tokens,\n typeof code === \"string\" ? code : null,\n );\n\n return printer.generate(ast);\n}\n\nexport default generate;\n"],"mappings":";;;;;;;AAAA,IAAAA,U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|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.TokenContext = void 0;
|
| 7 |
+
exports.isLastChild = isLastChild;
|
| 8 |
+
exports.parentNeedsParens = parentNeedsParens;
|
| 9 |
+
var parens = require("./parentheses.js");
|
| 10 |
+
var _t = require("@babel/types");
|
| 11 |
+
var _nodes = require("../nodes.js");
|
| 12 |
+
const {
|
| 13 |
+
VISITOR_KEYS
|
| 14 |
+
} = _t;
|
| 15 |
+
const TokenContext = exports.TokenContext = {
|
| 16 |
+
normal: 0,
|
| 17 |
+
expressionStatement: 1,
|
| 18 |
+
arrowBody: 2,
|
| 19 |
+
exportDefault: 4,
|
| 20 |
+
arrowFlowReturnType: 8,
|
| 21 |
+
forInitHead: 16,
|
| 22 |
+
forInHead: 32,
|
| 23 |
+
forOfHead: 64,
|
| 24 |
+
forInOrInitHeadAccumulate: 128,
|
| 25 |
+
forInOrInitHeadAccumulatePassThroughMask: 128
|
| 26 |
+
};
|
| 27 |
+
for (const type of Object.keys(parens)) {
|
| 28 |
+
const func = parens[type];
|
| 29 |
+
if (_nodes.generatorInfosMap.has(type)) {
|
| 30 |
+
_nodes.generatorInfosMap.get(type)[2] = func;
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
function newCalleeNeedsParens(node) {
|
| 34 |
+
let current = node;
|
| 35 |
+
while (true) {
|
| 36 |
+
switch (current.type) {
|
| 37 |
+
case "CallExpression":
|
| 38 |
+
case "ImportExpression":
|
| 39 |
+
case "OptionalCallExpression":
|
| 40 |
+
case "OptionalMemberExpression":
|
| 41 |
+
return true;
|
| 42 |
+
case "MemberExpression":
|
| 43 |
+
current = current.object;
|
| 44 |
+
break;
|
| 45 |
+
case "TaggedTemplateExpression":
|
| 46 |
+
current = current.tag;
|
| 47 |
+
break;
|
| 48 |
+
case "TSNonNullExpression":
|
| 49 |
+
current = current.expression;
|
| 50 |
+
break;
|
| 51 |
+
default:
|
| 52 |
+
return false;
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
function parentNeedsParens(node, parent, parentId) {
|
| 57 |
+
switch (parentId) {
|
| 58 |
+
case 112:
|
| 59 |
+
if (parent.callee === node) {
|
| 60 |
+
return newCalleeNeedsParens(node);
|
| 61 |
+
}
|
| 62 |
+
break;
|
| 63 |
+
case 42:
|
| 64 |
+
return !isDecoratorMemberExpression(node) && !(node.type === "CallExpression" && isDecoratorMemberExpression(node.callee)) && node.type !== "ParenthesizedExpression";
|
| 65 |
+
}
|
| 66 |
+
return false;
|
| 67 |
+
}
|
| 68 |
+
function isDecoratorMemberExpression(node) {
|
| 69 |
+
switch (node.type) {
|
| 70 |
+
case "Identifier":
|
| 71 |
+
return true;
|
| 72 |
+
case "MemberExpression":
|
| 73 |
+
return !node.computed && node.property.type === "Identifier" && isDecoratorMemberExpression(node.object);
|
| 74 |
+
default:
|
| 75 |
+
return false;
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
function isLastChild(parent, child) {
|
| 79 |
+
const visitorKeys = VISITOR_KEYS[parent.type];
|
| 80 |
+
for (let i = visitorKeys.length - 1; i >= 0; i--) {
|
| 81 |
+
const val = parent[visitorKeys[i]];
|
| 82 |
+
if (val === child) {
|
| 83 |
+
return true;
|
| 84 |
+
} else if (Array.isArray(val)) {
|
| 85 |
+
let j = val.length - 1;
|
| 86 |
+
while (j >= 0 && val[j] === null) j--;
|
| 87 |
+
return j >= 0 && val[j] === child;
|
| 88 |
+
} else if (val) {
|
| 89 |
+
return false;
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
return false;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/generator/lib/node/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["parens","require","_t","_nodes","VISITOR_KEYS","TokenContext","exports","normal","expressionStatement","arrowBody","exportDefault","arrowFlowReturnType","forInitHead","forInHead","forOfHead","forInOrInitHeadAccumulate","forInOrInitHeadAccumulatePassThroughMask","type","Object","keys","func","generatorInfosMap","has","get","newCalleeNeedsParens","node","current","object","tag","expression","parentNeedsParens","parent","parentId","callee","isDecoratorMemberExpression","computed","property","isLastChild","child","visitorKeys","i","length","val","Array","isArray","j"],"sources":["../../src/node/index.ts"],"sourcesContent":["import * as parens from \"./parentheses.ts\";\nimport { VISITOR_KEYS } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nimport { generatorInfosMap } from \"../nodes.ts\";\n\nexport const enum TokenContext {\n normal = 0,\n expressionStatement = 1 << 0,\n arrowBody = 1 << 1,\n exportDefault = 1 << 2,\n arrowFlowReturnType = 1 << 3,\n forInitHead = 1 << 4,\n forInHead = 1 << 5,\n forOfHead = 1 << 6,\n // This flag lives across the token boundary, and will\n // be reset after forIn or forInit head is printed\n forInOrInitHeadAccumulate = 1 << 7,\n forInOrInitHeadAccumulatePassThroughMask = 0b10000000,\n}\n\nexport type NodeHandler<R> = (\n node: t.Node,\n // todo:\n // node: K extends keyof typeof t\n // ? Extract<typeof t[K], { type: \"string\" }>\n // : t.Node,\n parent: t.Node,\n parentId: number,\n tokenContext?: number,\n getRawIdentifier?: (node: t.Identifier) => string,\n) => R | undefined;\n\nfor (const type of Object.keys(parens) as (keyof typeof parens)[]) {\n const func = parens[type];\n if (generatorInfosMap.has(type)) {\n generatorInfosMap.get(type)![2] = func;\n }\n}\n\nfunction newCalleeNeedsParens(node: t.Node): boolean {\n let current: t.Node = node;\n while (true) {\n switch (current.type) {\n case \"CallExpression\":\n case \"ImportExpression\":\n case \"OptionalCallExpression\":\n case \"OptionalMemberExpression\":\n return true;\n case \"MemberExpression\":\n current = current.object;\n break;\n case \"TaggedTemplateExpression\":\n current = current.tag;\n break;\n case \"TSNonNullExpression\":\n current = current.expression;\n break;\n default:\n return false;\n }\n }\n}\n\nexport function parentNeedsParens(\n node: t.Node,\n parent: any,\n parentId: number,\n): boolean {\n switch (parentId) {\n case __node(\"NewExpression\"):\n if (parent.callee === node) {\n return newCalleeNeedsParens(node);\n }\n break;\n case __node(\"Decorator\"):\n return (\n !isDecoratorMemberExpression(node) &&\n !(\n node.type === \"CallExpression\" &&\n isDecoratorMemberExpression(node.callee)\n ) &&\n node.type !== \"ParenthesizedExpression\"\n );\n }\n return false;\n}\n\nfunction isDecoratorMemberExpression(node: t.Node): boolean {\n switch (node.type) {\n case \"Identifier\":\n return true;\n case \"MemberExpression\":\n return (\n !node.computed &&\n node.property.type === \"Identifier\" &&\n isDecoratorMemberExpression(node.object)\n );\n default:\n return false;\n }\n}\n\nexport function isLastChild(parent: t.Node, child: t.Node) {\n const visitorKeys = VISITOR_KEYS[parent.type];\n for (let i = visitorKeys.length - 1; i >= 0; i--) {\n const val = (parent as any)[visitorKeys[i]] as t.Node | t.Node[] | null;\n if (val === child) {\n return true;\n } else if (Array.isArray(val)) {\n let j = val.length - 1;\n while (j >= 0 && val[j] === null) j--;\n return j >= 0 && val[j] === child;\n } else if (val) {\n return false;\n }\n }\n return false;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAF,OAAA;AAAgD;EAHvCG;AAAY,IAAAF,EAAA;AAAA,MAKHG,YAAY,GAAAC,OAAA,CAAAD,YAAA;EAAAE,MAAA;EAAAC,mBAAA;EAAAC,SAAA;EAAAC,aAAA;EAAAC,mBAAA;EAAAC,WAAA;EAAAC,SAAA;EAAAC,SAAA;EAAAC,yBAAA;EAAAC,wCAAA;AAAA;AA2B9B,KAAK,MAAMC,IAAI,IAAIC,MAAM,CAACC,IAAI,CAACnB,MAAM,CAAC,EAA6B;EACjE,MAAMoB,IAAI,GAAGpB,MAAM,CAACiB,IAAI,CAAC;EACzB,IAAII,wBAAiB,CAACC,GAAG,CAAC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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.AssignmentExpression = AssignmentExpression;
|
| 7 |
+
exports.BinaryExpression = BinaryExpression;
|
| 8 |
+
exports.ClassExpression = ClassExpression;
|
| 9 |
+
exports.ArrowFunctionExpression = exports.ConditionalExpression = ConditionalExpression;
|
| 10 |
+
exports.DoExpression = DoExpression;
|
| 11 |
+
exports.FunctionExpression = FunctionExpression;
|
| 12 |
+
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
| 13 |
+
exports.Identifier = Identifier;
|
| 14 |
+
exports.LogicalExpression = LogicalExpression;
|
| 15 |
+
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
| 16 |
+
exports.ObjectExpression = ObjectExpression;
|
| 17 |
+
exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
|
| 18 |
+
exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression;
|
| 19 |
+
exports.SequenceExpression = SequenceExpression;
|
| 20 |
+
exports.TSSatisfiesExpression = exports.TSAsExpression = TSAsExpression;
|
| 21 |
+
exports.TSConditionalType = TSConditionalType;
|
| 22 |
+
exports.TSConstructorType = exports.TSFunctionType = TSFunctionType;
|
| 23 |
+
exports.TSInferType = TSInferType;
|
| 24 |
+
exports.TSInstantiationExpression = TSInstantiationExpression;
|
| 25 |
+
exports.TSIntersectionType = TSIntersectionType;
|
| 26 |
+
exports.SpreadElement = exports.UnaryExpression = exports.TSTypeAssertion = UnaryLike;
|
| 27 |
+
exports.TSTypeOperator = TSTypeOperator;
|
| 28 |
+
exports.TSUnionType = TSUnionType;
|
| 29 |
+
exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
| 30 |
+
exports.UpdateExpression = UpdateExpression;
|
| 31 |
+
exports.AwaitExpression = exports.YieldExpression = YieldExpression;
|
| 32 |
+
var _t = require("@babel/types");
|
| 33 |
+
var _index = require("./index.js");
|
| 34 |
+
const {
|
| 35 |
+
isMemberExpression,
|
| 36 |
+
isOptionalMemberExpression,
|
| 37 |
+
isYieldExpression,
|
| 38 |
+
isStatement
|
| 39 |
+
} = _t;
|
| 40 |
+
const PRECEDENCE = new Map([["||", 0], ["??", 1], ["&&", 2], ["|", 3], ["^", 4], ["&", 5], ["==", 6], ["===", 6], ["!=", 6], ["!==", 6], ["<", 7], [">", 7], ["<=", 7], [">=", 7], ["in", 7], ["instanceof", 7], [">>", 8], ["<<", 8], [">>>", 8], ["+", 9], ["-", 9], ["*", 10], ["/", 10], ["%", 10], ["**", 11]]);
|
| 41 |
+
function isTSTypeExpression(nodeId) {
|
| 42 |
+
return nodeId === 156 || nodeId === 201 || nodeId === 209;
|
| 43 |
+
}
|
| 44 |
+
const isClassExtendsClause = (node, parent, parentId) => {
|
| 45 |
+
return (parentId === 21 || parentId === 22) && parent.superClass === node;
|
| 46 |
+
};
|
| 47 |
+
const hasPostfixPart = (node, parent, parentId) => {
|
| 48 |
+
switch (parentId) {
|
| 49 |
+
case 108:
|
| 50 |
+
case 132:
|
| 51 |
+
return parent.object === node;
|
| 52 |
+
case 17:
|
| 53 |
+
case 130:
|
| 54 |
+
case 112:
|
| 55 |
+
return parent.callee === node;
|
| 56 |
+
case 222:
|
| 57 |
+
return parent.tag === node;
|
| 58 |
+
case 191:
|
| 59 |
+
return true;
|
| 60 |
+
}
|
| 61 |
+
return false;
|
| 62 |
+
};
|
| 63 |
+
function NullableTypeAnnotation(node, parent, parentId) {
|
| 64 |
+
return parentId === 4;
|
| 65 |
+
}
|
| 66 |
+
function FunctionTypeAnnotation(node, parent, parentId, tokenContext) {
|
| 67 |
+
return (parentId === 239 || parentId === 90 || parentId === 4 || (tokenContext & _index.TokenContext.arrowFlowReturnType) > 0
|
| 68 |
+
);
|
| 69 |
+
}
|
| 70 |
+
function UpdateExpression(node, parent, parentId) {
|
| 71 |
+
return hasPostfixPart(node, parent, parentId) || isClassExtendsClause(node, parent, parentId);
|
| 72 |
+
}
|
| 73 |
+
function needsParenBeforeExpressionBrace(tokenContext) {
|
| 74 |
+
return (tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.arrowBody)) > 0;
|
| 75 |
+
}
|
| 76 |
+
function ObjectExpression(node, parent, parentId, tokenContext) {
|
| 77 |
+
return needsParenBeforeExpressionBrace(tokenContext);
|
| 78 |
+
}
|
| 79 |
+
function DoExpression(node, parent, parentId, tokenContext) {
|
| 80 |
+
return (tokenContext & _index.TokenContext.expressionStatement) > 0 && !node.async;
|
| 81 |
+
}
|
| 82 |
+
function BinaryLike(node, parent, parentId, nodeType) {
|
| 83 |
+
if (isClassExtendsClause(node, parent, parentId)) {
|
| 84 |
+
return true;
|
| 85 |
+
}
|
| 86 |
+
if (hasPostfixPart(node, parent, parentId) || parentId === 238 || parentId === 145 || parentId === 8) {
|
| 87 |
+
return true;
|
| 88 |
+
}
|
| 89 |
+
let parentPos;
|
| 90 |
+
switch (parentId) {
|
| 91 |
+
case 10:
|
| 92 |
+
case 107:
|
| 93 |
+
parentPos = PRECEDENCE.get(parent.operator);
|
| 94 |
+
break;
|
| 95 |
+
case 156:
|
| 96 |
+
case 201:
|
| 97 |
+
parentPos = 7;
|
| 98 |
+
}
|
| 99 |
+
if (parentPos !== undefined) {
|
| 100 |
+
const nodePos = nodeType === 2 ? 7 : PRECEDENCE.get(node.operator);
|
| 101 |
+
if (parentPos > nodePos) return true;
|
| 102 |
+
if (parentPos === nodePos && parentId === 10 && (nodePos === 11 ? parent.left === node : parent.right === node)) {
|
| 103 |
+
return true;
|
| 104 |
+
}
|
| 105 |
+
if (nodeType === 1 && parentId === 107 && (nodePos === 1 && parentPos !== 1 || parentPos === 1 && nodePos !== 1)) {
|
| 106 |
+
return true;
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
return false;
|
| 110 |
+
}
|
| 111 |
+
function UnionTypeAnnotation(node, parent, parentId) {
|
| 112 |
+
switch (parentId) {
|
| 113 |
+
case 4:
|
| 114 |
+
case 115:
|
| 115 |
+
case 90:
|
| 116 |
+
case 239:
|
| 117 |
+
return true;
|
| 118 |
+
}
|
| 119 |
+
return false;
|
| 120 |
+
}
|
| 121 |
+
function OptionalIndexedAccessType(node, parent, parentId) {
|
| 122 |
+
return parentId === 84 && parent.objectType === node;
|
| 123 |
+
}
|
| 124 |
+
function TSAsExpression(node, parent, parentId) {
|
| 125 |
+
if ((parentId === 6 || parentId === 7) && parent.left === node) {
|
| 126 |
+
return true;
|
| 127 |
+
}
|
| 128 |
+
if (parentId === 10 && (parent.operator === "|" || parent.operator === "&") && node === parent.left) {
|
| 129 |
+
return true;
|
| 130 |
+
}
|
| 131 |
+
return BinaryLike(node, parent, parentId, 2);
|
| 132 |
+
}
|
| 133 |
+
function TSConditionalType(node, parent, parentId) {
|
| 134 |
+
switch (parentId) {
|
| 135 |
+
case 155:
|
| 136 |
+
case 195:
|
| 137 |
+
case 211:
|
| 138 |
+
case 212:
|
| 139 |
+
return true;
|
| 140 |
+
case 175:
|
| 141 |
+
return parent.objectType === node;
|
| 142 |
+
case 181:
|
| 143 |
+
case 219:
|
| 144 |
+
return parent.types[0] === node;
|
| 145 |
+
case 161:
|
| 146 |
+
return parent.checkType === node || parent.extendsType === node;
|
| 147 |
+
}
|
| 148 |
+
return false;
|
| 149 |
+
}
|
| 150 |
+
function TSUnionType(node, parent, parentId) {
|
| 151 |
+
switch (parentId) {
|
| 152 |
+
case 181:
|
| 153 |
+
case 211:
|
| 154 |
+
case 155:
|
| 155 |
+
case 195:
|
| 156 |
+
return true;
|
| 157 |
+
case 175:
|
| 158 |
+
return parent.objectType === node;
|
| 159 |
+
}
|
| 160 |
+
return false;
|
| 161 |
+
}
|
| 162 |
+
function TSIntersectionType(node, parent, parentId) {
|
| 163 |
+
return parentId === 211 || TSTypeOperator(node, parent, parentId);
|
| 164 |
+
}
|
| 165 |
+
function TSInferType(node, parent, parentId) {
|
| 166 |
+
if (TSTypeOperator(node, parent, parentId)) {
|
| 167 |
+
return true;
|
| 168 |
+
}
|
| 169 |
+
if ((parentId === 181 || parentId === 219) && node.typeParameter.constraint && parent.types[0] === node) {
|
| 170 |
+
return true;
|
| 171 |
+
}
|
| 172 |
+
return false;
|
| 173 |
+
}
|
| 174 |
+
function TSTypeOperator(node, parent, parentId) {
|
| 175 |
+
switch (parentId) {
|
| 176 |
+
case 155:
|
| 177 |
+
case 195:
|
| 178 |
+
return true;
|
| 179 |
+
case 175:
|
| 180 |
+
if (parent.objectType === node) {
|
| 181 |
+
return true;
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
return false;
|
| 185 |
+
}
|
| 186 |
+
function TSInstantiationExpression(node, parent, parentId) {
|
| 187 |
+
switch (parentId) {
|
| 188 |
+
case 17:
|
| 189 |
+
case 130:
|
| 190 |
+
case 112:
|
| 191 |
+
case 177:
|
| 192 |
+
return (parent.typeParameters
|
| 193 |
+
) != null;
|
| 194 |
+
}
|
| 195 |
+
return false;
|
| 196 |
+
}
|
| 197 |
+
function TSFunctionType(node, parent, parentId) {
|
| 198 |
+
if (TSUnionType(node, parent, parentId)) return true;
|
| 199 |
+
return parentId === 219 || parentId === 161 && (parent.checkType === node || parent.extendsType === node);
|
| 200 |
+
}
|
| 201 |
+
function BinaryExpression(node, parent, parentId, tokenContext) {
|
| 202 |
+
if (BinaryLike(node, parent, parentId, 0)) return true;
|
| 203 |
+
return (tokenContext & _index.TokenContext.forInOrInitHeadAccumulate) > 0 && node.operator === "in";
|
| 204 |
+
}
|
| 205 |
+
function LogicalExpression(node, parent, parentId) {
|
| 206 |
+
return BinaryLike(node, parent, parentId, 1);
|
| 207 |
+
}
|
| 208 |
+
function SequenceExpression(node, parent, parentId) {
|
| 209 |
+
if (parentId === 144 || parentId === 133 || parentId === 108 && parent.property === node || parentId === 132 && parent.property === node || parentId === 224) {
|
| 210 |
+
return false;
|
| 211 |
+
}
|
| 212 |
+
if (parentId === 21) {
|
| 213 |
+
return true;
|
| 214 |
+
}
|
| 215 |
+
if (parentId === 68) {
|
| 216 |
+
return parent.right === node;
|
| 217 |
+
}
|
| 218 |
+
if (parentId === 60) {
|
| 219 |
+
return true;
|
| 220 |
+
}
|
| 221 |
+
return !isStatement(parent);
|
| 222 |
+
}
|
| 223 |
+
function YieldExpression(node, parent, parentId) {
|
| 224 |
+
return parentId === 10 || parentId === 107 || parentId === 238 || parentId === 145 || hasPostfixPart(node, parent, parentId) || parentId === 8 && isYieldExpression(node) || parentId === 28 && node === parent.test || isClassExtendsClause(node, parent, parentId) || isTSTypeExpression(parentId);
|
| 225 |
+
}
|
| 226 |
+
function ClassExpression(node, parent, parentId, tokenContext) {
|
| 227 |
+
return (tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault)) > 0;
|
| 228 |
+
}
|
| 229 |
+
function UnaryLike(node, parent, parentId) {
|
| 230 |
+
return hasPostfixPart(node, parent, parentId) || parentId === 10 && parent.operator === "**" && parent.left === node || isClassExtendsClause(node, parent, parentId);
|
| 231 |
+
}
|
| 232 |
+
function FunctionExpression(node, parent, parentId, tokenContext) {
|
| 233 |
+
return (tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault)) > 0;
|
| 234 |
+
}
|
| 235 |
+
function ConditionalExpression(node, parent, parentId) {
|
| 236 |
+
switch (parentId) {
|
| 237 |
+
case 238:
|
| 238 |
+
case 145:
|
| 239 |
+
case 10:
|
| 240 |
+
case 107:
|
| 241 |
+
case 8:
|
| 242 |
+
return true;
|
| 243 |
+
case 28:
|
| 244 |
+
if (parent.test === node) {
|
| 245 |
+
return true;
|
| 246 |
+
}
|
| 247 |
+
}
|
| 248 |
+
if (isTSTypeExpression(parentId)) {
|
| 249 |
+
return true;
|
| 250 |
+
}
|
| 251 |
+
return UnaryLike(node, parent, parentId);
|
| 252 |
+
}
|
| 253 |
+
function OptionalMemberExpression(node, parent, parentId) {
|
| 254 |
+
switch (parentId) {
|
| 255 |
+
case 17:
|
| 256 |
+
return parent.callee === node;
|
| 257 |
+
case 108:
|
| 258 |
+
return parent.object === node;
|
| 259 |
+
}
|
| 260 |
+
return false;
|
| 261 |
+
}
|
| 262 |
+
function AssignmentExpression(node, parent, parentId, tokenContext) {
|
| 263 |
+
if (needsParenBeforeExpressionBrace(tokenContext) && node.left.type === "ObjectPattern") {
|
| 264 |
+
return true;
|
| 265 |
+
}
|
| 266 |
+
return ConditionalExpression(node, parent, parentId);
|
| 267 |
+
}
|
| 268 |
+
function Identifier(node, parent, parentId, tokenContext, getRawIdentifier) {
|
| 269 |
+
var _node$extra;
|
| 270 |
+
if (getRawIdentifier && getRawIdentifier(node) !== node.name) {
|
| 271 |
+
return false;
|
| 272 |
+
}
|
| 273 |
+
if (parentId === 6 && (_node$extra = node.extra) != null && _node$extra.parenthesized && parent.left === node) {
|
| 274 |
+
const rightType = parent.right.type;
|
| 275 |
+
if ((rightType === "FunctionExpression" || rightType === "ClassExpression") && parent.right.id == null) {
|
| 276 |
+
return true;
|
| 277 |
+
}
|
| 278 |
+
}
|
| 279 |
+
if (tokenContext & _index.TokenContext.forOfHead || (parentId === 108 || parentId === 132) && tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.forInitHead | _index.TokenContext.forInHead)) {
|
| 280 |
+
if (node.name === "let") {
|
| 281 |
+
const isFollowedByBracket = isMemberExpression(parent, {
|
| 282 |
+
object: node,
|
| 283 |
+
computed: true
|
| 284 |
+
}) || isOptionalMemberExpression(parent, {
|
| 285 |
+
object: node,
|
| 286 |
+
computed: true,
|
| 287 |
+
optional: false
|
| 288 |
+
});
|
| 289 |
+
if (isFollowedByBracket && tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.forInitHead | _index.TokenContext.forInHead)) {
|
| 290 |
+
return true;
|
| 291 |
+
}
|
| 292 |
+
return (tokenContext & _index.TokenContext.forOfHead) > 0;
|
| 293 |
+
}
|
| 294 |
+
}
|
| 295 |
+
return parentId === 68 && parent.left === node && node.name === "async" && !parent.await;
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
//# sourceMappingURL=parentheses.js.map
|
node_modules/@babel/generator/lib/node/parentheses.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_index","isMemberExpression","isOptionalMemberExpression","isYieldExpression","isStatement","PRECEDENCE","Map","isTSTypeExpression","nodeId","isClassExtendsClause","node","parent","parentId","superClass","hasPostfixPart","object","callee","tag","NullableTypeAnnotation","FunctionTypeAnnotation","tokenContext","TokenContext","arrowFlowReturnType","UpdateExpression","needsParenBeforeExpressionBrace","expressionStatement","arrowBody","ObjectExpression","DoExpression","async","BinaryLike","nodeType","parentPos","get","operator","undefined","nodePos","left","right","UnionTypeAnnotation","OptionalIndexedAccessType","objectType","TSAsExpression","TSConditionalType","types","checkType","extendsType","TSUnionType","TSIntersectionType","TSTypeOperator","TSInferType","typeParameter","constraint","TSInstantiationExpression","typeParameters","TSFunctionType","BinaryExpression","forInOrInitHeadAccumulate","LogicalExpression","SequenceExpression","property","YieldExpression","test","ClassExpression","exportDefault","UnaryLike","FunctionExpression","ConditionalExpression","OptionalMemberExpression","AssignmentExpression","type","Identifier","getRawIdentifier","_node$extra","name","extra","parenthesized","rightType","id","forOfHead","forInitHead","forInHead","isFollowedByBracket","computed","optional","await"],"sources":["../../src/node/parentheses.ts"],"sourcesContent":["import {\n isMemberExpression,\n isOptionalMemberExpression,\n isYieldExpression,\n isStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nimport { TokenContext } from \"./index.ts\";\n\nconst PRECEDENCE = new Map([\n [\"||\", 0],\n [\"??\", 1],\n [\"&&\", 2],\n [\"|\", 3],\n [\"^\", 4],\n [\"&\", 5],\n [\"==\", 6],\n [\"===\", 6],\n [\"!=\", 6],\n [\"!==\", 6],\n [\"<\", 7],\n [\">\", 7],\n [\"<=\", 7],\n [\">=\", 7],\n [\"in\", 7],\n [\"instanceof\", 7],\n [\">>\", 8],\n [\"<<\", 8],\n [\">>>\", 8],\n [\"+\", 9],\n [\"-\", 9],\n [\"*\", 10],\n [\"/\", 10],\n [\"%\", 10],\n [\"**\", 11],\n]);\n\nfunction isTSTypeExpression(nodeId: number) {\n return (\n nodeId === __node(\"TSAsExpression\") ||\n nodeId === __node(\"TSSatisfiesExpression\") ||\n nodeId === __node(\"TSTypeAssertion\")\n );\n}\n\nconst isClassExtendsClause = (\n node: t.Node,\n parent: any,\n parentId: number,\n): parent is t.Class => {\n return (\n (parentId === __node(\"ClassDeclaration\") ||\n parentId === __node(\"ClassExpression\")) &&\n parent.superClass === node\n );\n};\n\nconst hasPostfixPart = (node: t.Node, parent: any, parentId: number) => {\n switch (parentId) {\n case __node(\"MemberExpression\"):\n case __node(\"OptionalMemberExpression\"):\n return parent.object === node;\n case __node(\"CallExpression\"):\n case __node(\"OptionalCallExpression\"):\n case __node(\"NewExpression\"):\n return parent.callee === node;\n case __node(\"TaggedTemplateExpression\"):\n return parent.tag === node;\n case __node(\"TSNonNullExpression\"):\n return true;\n }\n\n return false;\n};\n\nexport function NullableTypeAnnotation(\n node: t.NullableTypeAnnotation,\n parent: any,\n parentId: number,\n): boolean {\n return parentId === __node(\"ArrayTypeAnnotation\");\n}\n\nexport function FunctionTypeAnnotation(\n node: t.FunctionTypeAnnotation,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n return (\n // (() => A) | (() => B)\n parentId === __node(\"UnionTypeAnnotation\") ||\n // (() => A) & (() => B)\n parentId === __node(\"IntersectionTypeAnnotation\") ||\n // (() => A)[]\n parentId === __node(\"ArrayTypeAnnotation\") ||\n (tokenContext & TokenContext.arrowFlowReturnType) > 0\n );\n}\n\nexport function UpdateExpression(\n node: t.UpdateExpression,\n parent: any,\n parentId: number,\n): boolean {\n return (\n hasPostfixPart(node, parent, parentId) ||\n isClassExtendsClause(node, parent, parentId)\n );\n}\n\nfunction needsParenBeforeExpressionBrace(tokenContext: number) {\n return (\n (tokenContext &\n (TokenContext.expressionStatement | TokenContext.arrowBody)) >\n 0\n );\n}\n\nexport function ObjectExpression(\n node: t.ObjectExpression,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n return needsParenBeforeExpressionBrace(tokenContext);\n}\n\nexport function DoExpression(\n node: t.DoExpression,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n // `async do` can start an expression statement\n return (tokenContext & TokenContext.expressionStatement) > 0 && !node.async;\n}\n\nconst enum BinaryLikeType {\n Binary = 0,\n Logical = 1,\n TypeScript = 2,\n}\n\nfunction BinaryLike(\n node: t.Binary | t.TSAsExpression | t.TSSatisfiesExpression,\n parent: any,\n parentId: number,\n nodeType: BinaryLikeType,\n): boolean {\n if (isClassExtendsClause(node, parent, parentId)) {\n return true;\n }\n\n if (\n hasPostfixPart(node, parent, parentId) ||\n parentId === __node(\"UnaryExpression\") ||\n parentId === __node(\"SpreadElement\") ||\n parentId === __node(\"AwaitExpression\")\n ) {\n return true;\n }\n let parentPos: number | undefined;\n switch (parentId) {\n case __node(\"BinaryExpression\"):\n case __node(\"LogicalExpression\"):\n parentPos = PRECEDENCE.get(parent.operator);\n break;\n case __node(\"TSAsExpression\"):\n case __node(\"TSSatisfiesExpression\"):\n parentPos = 7; /* in */\n }\n if (parentPos !== undefined) {\n const nodePos =\n nodeType === BinaryLikeType.TypeScript\n ? 7 /* in */\n : PRECEDENCE.get((node as t.Binary).operator)!;\n if (parentPos > nodePos) return true;\n if (\n parentPos === nodePos &&\n parentId === __node(\"BinaryExpression\") &&\n (nodePos === 11 /* ** */ ? parent.left === node : parent.right === node)\n ) {\n return true;\n }\n if (\n nodeType === BinaryLikeType.Logical &&\n parentId === __node(\"LogicalExpression\") &&\n // 1: ??\n ((nodePos === 1 && parentPos !== 1) || (parentPos === 1 && nodePos !== 1))\n ) {\n return true;\n }\n }\n return false;\n}\n\nexport function UnionTypeAnnotation(\n node: t.UnionTypeAnnotation | t.IntersectionTypeAnnotation,\n parent: any,\n parentId: number,\n): boolean {\n switch (parentId) {\n case __node(\"ArrayTypeAnnotation\"):\n case __node(\"NullableTypeAnnotation\"):\n case __node(\"IntersectionTypeAnnotation\"):\n case __node(\"UnionTypeAnnotation\"):\n return true;\n }\n return false;\n}\n\nexport { UnionTypeAnnotation as IntersectionTypeAnnotation };\n\nexport function OptionalIndexedAccessType(\n node: t.OptionalIndexedAccessType,\n parent: any,\n parentId: number,\n): boolean {\n return parentId === __node(\"IndexedAccessType\") && parent.objectType === node;\n}\n\nexport function TSAsExpression(\n node: t.TSAsExpression | t.TSSatisfiesExpression,\n parent: any,\n parentId: number,\n): boolean {\n if (\n (parentId === __node(\"AssignmentExpression\") ||\n parentId === __node(\"AssignmentPattern\")) &&\n parent.left === node\n ) {\n return true;\n }\n if (\n parentId === __node(\"BinaryExpression\") &&\n (parent.operator === \"|\" || parent.operator === \"&\") &&\n node === parent.left\n ) {\n return true;\n }\n return BinaryLike(node, parent, parentId, BinaryLikeType.TypeScript);\n}\n\nexport { TSAsExpression as TSSatisfiesExpression };\n\nexport { UnaryLike as TSTypeAssertion };\n\nexport function TSConditionalType(\n node: t.TSConditionalType,\n parent: any,\n parentId: number,\n): boolean {\n switch (parentId) {\n case __node(\"TSArrayType\"):\n case __node(\"TSOptionalType\"):\n case __node(\"TSTypeOperator\"):\n // for `infer K extends (L extends M ? M : ...)`\n // fallthrough\n case __node(\"TSTypeParameter\"):\n return true;\n case __node(\"TSIndexedAccessType\"):\n return parent.objectType === node;\n case __node(\"TSIntersectionType\"):\n case __node(\"TSUnionType\"):\n return parent.types[0] === node;\n case __node(\"TSConditionalType\"):\n return parent.checkType === node || parent.extendsType === node;\n }\n return false;\n}\n\nexport function TSUnionType(\n node: t.TSUnionType | t.TSFunctionType,\n parent: any,\n parentId: number,\n): boolean {\n switch (parentId) {\n case __node(\"TSIntersectionType\"):\n case __node(\"TSTypeOperator\"):\n case __node(\"TSArrayType\"):\n case __node(\"TSOptionalType\"):\n return true;\n case __node(\"TSIndexedAccessType\"):\n return parent.objectType === node;\n }\n return false;\n}\n\nexport function TSIntersectionType(\n node: t.TSUnionType,\n parent: any,\n parentId: number,\n): boolean {\n return (\n parentId === __node(\"TSTypeOperator\") ||\n TSTypeOperator(node, parent, parentId)\n );\n}\n\nexport function TSInferType(\n node: t.TSInferType,\n parent: any,\n parentId: number,\n): boolean {\n if (TSTypeOperator(node, parent, parentId)) {\n return true;\n }\n if (\n (parentId === __node(\"TSIntersectionType\") ||\n parentId === __node(\"TSUnionType\")) &&\n node.typeParameter.constraint &&\n parent.types[0] === node\n ) {\n return true;\n }\n return false;\n}\n\nexport function TSTypeOperator(\n node: t.TSTypeOperator | t.TSUnionType | t.TSInferType,\n parent: any,\n parentId: number,\n): boolean {\n switch (parentId) {\n case __node(\"TSArrayType\"):\n case __node(\"TSOptionalType\"):\n return true;\n case __node(\"TSIndexedAccessType\"):\n if (parent.objectType === node) {\n return true;\n }\n }\n return false;\n}\n\nexport function TSInstantiationExpression(\n node: t.TSInstantiationExpression,\n parent: any,\n parentId: number,\n) {\n switch (parentId) {\n case __node(\"CallExpression\"):\n case __node(\"OptionalCallExpression\"):\n case __node(\"NewExpression\"):\n case __node(\"TSInstantiationExpression\"):\n return (\n (process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n parent.typeArguments\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n parent.typeParameters) != null\n );\n }\n\n return false;\n}\n\nexport function TSFunctionType(\n node: t.TSFunctionType,\n parent: any,\n parentId: number,\n): boolean {\n if (TSUnionType(node, parent, parentId)) return true;\n\n return (\n parentId === __node(\"TSUnionType\") ||\n (parentId === __node(\"TSConditionalType\") &&\n (parent.checkType === node || parent.extendsType === node))\n );\n}\n\nexport { TSFunctionType as TSConstructorType };\n\nexport function BinaryExpression(\n node: t.BinaryExpression,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n if (BinaryLike(node, parent, parentId, BinaryLikeType.Binary)) return true;\n\n // for ((1 in []);;);\n // for (var x = (1 in []) in 2);\n return (\n (tokenContext & TokenContext.forInOrInitHeadAccumulate) > 0 &&\n node.operator === \"in\"\n );\n}\n\nexport function LogicalExpression(\n node: t.LogicalExpression,\n parent: any,\n parentId: number,\n): boolean {\n return BinaryLike(node, parent, parentId, BinaryLikeType.Logical);\n}\n\nexport function SequenceExpression(\n node: t.SequenceExpression,\n parent: any,\n parentId: number,\n): boolean {\n if (\n parentId === __node(\"SequenceExpression\") ||\n parentId === __node(\"ParenthesizedExpression\") ||\n (parentId === __node(\"MemberExpression\") && parent.property === node) ||\n (parentId === __node(\"OptionalMemberExpression\") &&\n parent.property === node) ||\n parentId === __node(\"TemplateLiteral\")\n ) {\n return false;\n }\n if (parentId === __node(\"ClassDeclaration\")) {\n return true;\n }\n if (parentId === __node(\"ForOfStatement\")) {\n return parent.right === node;\n }\n if (parentId === __node(\"ExportDefaultDeclaration\")) {\n return true;\n }\n\n return !isStatement(parent);\n}\n\nexport function YieldExpression(\n node: t.YieldExpression,\n parent: any,\n parentId: number,\n): boolean {\n return (\n parentId === __node(\"BinaryExpression\") ||\n parentId === __node(\"LogicalExpression\") ||\n parentId === __node(\"UnaryExpression\") ||\n parentId === __node(\"SpreadElement\") ||\n hasPostfixPart(node, parent, parentId) ||\n (parentId === __node(\"AwaitExpression\") && isYieldExpression(node)) ||\n (parentId === __node(\"ConditionalExpression\") && node === parent.test) ||\n isClassExtendsClause(node, parent, parentId) ||\n isTSTypeExpression(parentId)\n );\n}\n\nexport { YieldExpression as AwaitExpression };\n\nexport function ClassExpression(\n node: t.ClassExpression,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n return (\n (tokenContext &\n (TokenContext.expressionStatement | TokenContext.exportDefault)) >\n 0\n );\n}\n\nfunction UnaryLike(\n node:\n | t.UnaryLike\n | t.TSTypeAssertion\n | t.ArrowFunctionExpression\n | t.ConditionalExpression\n | t.AssignmentExpression,\n parent: any,\n parentId: number,\n): boolean {\n return (\n hasPostfixPart(node, parent, parentId) ||\n (parentId === __node(\"BinaryExpression\") &&\n parent.operator === \"**\" &&\n parent.left === node) ||\n isClassExtendsClause(node, parent, parentId)\n );\n}\n\nexport { UnaryLike as UnaryExpression, UnaryLike as SpreadElement };\n\nexport function FunctionExpression(\n node: t.FunctionExpression,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n return (\n (tokenContext &\n (TokenContext.expressionStatement | TokenContext.exportDefault)) >\n 0\n );\n}\n\nexport function ConditionalExpression(\n node:\n | t.ConditionalExpression\n | t.ArrowFunctionExpression\n | t.AssignmentExpression,\n parent: any,\n parentId: number,\n): boolean {\n switch (parentId) {\n case __node(\"UnaryExpression\"):\n case __node(\"SpreadElement\"):\n case __node(\"BinaryExpression\"):\n case __node(\"LogicalExpression\"):\n case __node(\"AwaitExpression\"):\n return true;\n case __node(\"ConditionalExpression\"):\n if (parent.test === node) {\n return true;\n }\n }\n\n if (isTSTypeExpression(parentId)) {\n return true;\n }\n\n return UnaryLike(node, parent, parentId);\n}\n\nexport { ConditionalExpression as ArrowFunctionExpression };\n\nexport function OptionalMemberExpression(\n node: t.OptionalMemberExpression,\n parent: any,\n parentId: number,\n): boolean {\n switch (parentId) {\n case __node(\"CallExpression\"):\n return parent.callee === node;\n case __node(\"MemberExpression\"):\n return parent.object === node;\n }\n return false;\n}\n\nexport { OptionalMemberExpression as OptionalCallExpression };\n\nexport function AssignmentExpression(\n node: t.AssignmentExpression,\n parent: any,\n parentId: number,\n tokenContext: number,\n): boolean {\n if (\n needsParenBeforeExpressionBrace(tokenContext) &&\n node.left.type === \"ObjectPattern\"\n ) {\n return true;\n }\n return ConditionalExpression(node, parent, parentId);\n}\n\nexport function Identifier(\n node: t.Identifier,\n parent: any,\n parentId: number,\n tokenContext: number,\n getRawIdentifier: (node: t.Identifier) => string,\n): boolean {\n if (getRawIdentifier && getRawIdentifier(node) !== node.name) {\n return false;\n }\n\n // 13.15.2 AssignmentExpression RS: Evaluation\n // (fn) = function () {};\n if (\n parentId === __node(\"AssignmentExpression\") &&\n node.extra?.parenthesized &&\n parent.left === node\n ) {\n const rightType = parent.right.type;\n if (\n (rightType === \"FunctionExpression\" || rightType === \"ClassExpression\") &&\n parent.right.id == null\n ) {\n return true;\n }\n }\n\n // fast path\n if (\n tokenContext & TokenContext.forOfHead ||\n ((parentId === __node(\"MemberExpression\") ||\n parentId === __node(\"OptionalMemberExpression\")) &&\n tokenContext &\n (TokenContext.expressionStatement |\n TokenContext.forInitHead |\n TokenContext.forInHead))\n ) {\n // Non-strict code allows the identifier `let`, but it cannot occur as-is in\n // certain contexts to avoid ambiguity with contextual keyword `let`.\n if (node.name === \"let\") {\n // Some contexts only forbid `let [`, so check if the next token would\n // be the left bracket of a computed member expression.\n const isFollowedByBracket =\n isMemberExpression(parent, {\n object: node,\n computed: true,\n }) ||\n isOptionalMemberExpression(parent, {\n object: node,\n computed: true,\n optional: false,\n });\n if (\n isFollowedByBracket &&\n tokenContext &\n (TokenContext.expressionStatement |\n TokenContext.forInitHead |\n TokenContext.forInHead)\n ) {\n return true;\n }\n return (tokenContext & TokenContext.forOfHead) > 0;\n }\n }\n\n // ECMAScript specifically forbids a for-of loop from starting with the\n // token sequence `for (async of`, because it would be ambiguous with\n // `for (async of => {};;)`, so we need to add extra parentheses.\n return (\n parentId === __node(\"ForOfStatement\") &&\n parent.left === node &&\n node.name === \"async\" &&\n !parent.await\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAD,OAAA;AAA0C;EAPxCE,kBAAkB;EAClBC,0BAA0B;EAC1BC,iBAAiB;EACjBC;AAAW,IAAAN,EAAA;AAMb,MAAMO,UAAU,GAAG,IAAIC,GAAG,CAAC,CACzB,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,GAAG,EAAE,CAAC,CAAC,EACR,CAAC,GAAG,EAAE,CAAC,CAAC,EACR,CAAC,GAAG,EAAE,CAAC,CAAC,EACR,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,KAAK,EAAE,CAAC,CAAC,EACV,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,KAAK,EAAE,CAAC,CAAC,EACV,CAAC,GAAG,EAAE,CAAC,CAAC,EACR,CAAC,GAAG,EAAE,CAAC,CAAC,EACR,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,YAAY,EAAE,CAAC,CAAC,EACjB,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,IAAI,EAAE,CAAC,CAAC,EACT,CAAC,KAAK,EAAE,CAAC,CAAC,EACV,CAAC,GAAG,EAAE,CAAC,CAAC,EACR,CAAC,GAAG,EAAE,CAAC,CAAC,EACR,CAAC,GAAG,EAAE,EAAE,CAAC,EACT,CAAC,GAAG,EAAE,EAAE,CAAC,EACT,CAAC,GAAG,EAAE,EAAE,CAAC,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1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.generatorInfosMap = void 0;
|
| 7 |
+
var generatorFunctions = require("./generators/index.js");
|
| 8 |
+
var deprecatedGeneratorFunctions = require("./generators/deprecated.js");
|
| 9 |
+
const generatorInfosMap = exports.generatorInfosMap = new Map();
|
| 10 |
+
let index = 0;
|
| 11 |
+
for (const key of Object.keys(generatorFunctions).sort()) {
|
| 12 |
+
if (key.startsWith("_")) continue;
|
| 13 |
+
generatorInfosMap.set(key, [generatorFunctions[key], index++, undefined]);
|
| 14 |
+
}
|
| 15 |
+
for (const key of Object.keys(deprecatedGeneratorFunctions)) {
|
| 16 |
+
generatorInfosMap.set(key, [deprecatedGeneratorFunctions[key], index++, undefined]);
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
//# sourceMappingURL=nodes.js.map
|
node_modules/@babel/generator/lib/nodes.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["generatorFunctions","require","deprecatedGeneratorFunctions","generatorInfosMap","exports","Map","index","key","Object","keys","sort","startsWith","set","undefined"],"sources":["../src/nodes.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\n\nimport * as generatorFunctions from \"./generators/index.ts\";\nimport * as deprecatedGeneratorFunctions from \"./generators/deprecated.ts\";\nimport type { NodeHandler } from \"./node/index.ts\";\nimport type Printer from \"./printer.ts\";\n\ndeclare global {\n function __node(type: t.Node[\"type\"]): number;\n}\n\nconst generatorInfosMap = new Map<\n string,\n [\n (this: Printer, node: t.Node, parent?: t.Node | null) => void,\n number,\n NodeHandler<boolean> | undefined,\n ]\n>();\nlet index = 0;\n\nfor (const key of Object.keys(generatorFunctions).sort() as Exclude<\n keyof typeof generatorFunctions,\n `_${string}`\n>[]) {\n if (key.startsWith(\"_\")) continue;\n generatorInfosMap.set(key, [generatorFunctions[key], index++, undefined]);\n}\nif (!process.env.BABEL_8_BREAKING) {\n for (const key of Object.keys(\n deprecatedGeneratorFunctions,\n ) as (keyof typeof deprecatedGeneratorFunctions)[]) {\n generatorInfosMap.set(key, [\n deprecatedGeneratorFunctions[key],\n index++,\n undefined,\n ]);\n }\n}\n\nexport { generatorInfosMap };\n"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAD,OAAA;AAQA,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAIE,GAAG,CAO/B,CAAC;AACH,IAAIC,KAAK,GAAG,CAAC;AAEb,KAAK,MAAMC,GAAG,IAAIC,MAAM,CAACC,IAAI,CAACT,kBAAkB,CAAC,CAACU,IAAI,CAAC,CAAC,EAGnD;EACH,IAAIH,GAAG,CAACI,UAAU,CAAC,GAAG,CAAC,EAAE;EACzBR,iBAAiB,CAACS,GAAG,CAACL,GAAG,EAAE,CAACP,kBAAkB,CAACO,GAAG,CAAC,EAAED,KAAK,EAAE,EAAEO,SAAS,CAAC,CAAC;AAC3E;AAEE,KAAK,MAAMN,GAAG,IAAIC,MAAM,CAACC,IAAI,CAC3BP,4BACF,CAAC,EAAmD;EAClDC,iBAAiB,CAACS,GAAG,CAACL,GAAG,EAAE,CACzBL,4BAA4B,CAACK,GAAG,CAAC,EACjCD,KAAK,EAAE,EACPO,SAAS,CACV,CAAC;AACJ","ignoreList":[]}
|
node_modules/@babel/generator/lib/printer.js
ADDED
|
@@ -0,0 +1,783 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = void 0;
|
| 7 |
+
var _buffer = require("./buffer.js");
|
| 8 |
+
var _index = require("./node/index.js");
|
| 9 |
+
var _nodes = require("./nodes.js");
|
| 10 |
+
var _t = require("@babel/types");
|
| 11 |
+
var _tokenMap = require("./token-map.js");
|
| 12 |
+
var _types2 = require("./generators/types.js");
|
| 13 |
+
const {
|
| 14 |
+
isExpression,
|
| 15 |
+
isFunction,
|
| 16 |
+
isStatement,
|
| 17 |
+
isClassBody,
|
| 18 |
+
isTSInterfaceBody,
|
| 19 |
+
isTSEnumMember
|
| 20 |
+
} = _t;
|
| 21 |
+
const SCIENTIFIC_NOTATION = /e/i;
|
| 22 |
+
const ZERO_DECIMAL_INTEGER = /\.0+$/;
|
| 23 |
+
const HAS_NEWLINE = /[\n\r\u2028\u2029]/;
|
| 24 |
+
const HAS_NEWLINE_OR_BlOCK_COMMENT_END = /[\n\r\u2028\u2029]|\*\//;
|
| 25 |
+
function commentIsNewline(c) {
|
| 26 |
+
return c.type === "CommentLine" || HAS_NEWLINE.test(c.value);
|
| 27 |
+
}
|
| 28 |
+
class Printer {
|
| 29 |
+
constructor(format, map, tokens = null, originalCode = null) {
|
| 30 |
+
this.tokenContext = _index.TokenContext.normal;
|
| 31 |
+
this._tokens = null;
|
| 32 |
+
this._originalCode = null;
|
| 33 |
+
this._currentNode = null;
|
| 34 |
+
this._currentTypeId = null;
|
| 35 |
+
this._indent = 0;
|
| 36 |
+
this._indentRepeat = 0;
|
| 37 |
+
this._insideAux = false;
|
| 38 |
+
this._noLineTerminator = false;
|
| 39 |
+
this._noLineTerminatorAfterNode = null;
|
| 40 |
+
this._printAuxAfterOnNextUserNode = false;
|
| 41 |
+
this._printedComments = new Set();
|
| 42 |
+
this._lastCommentLine = 0;
|
| 43 |
+
this._innerCommentsState = 0;
|
| 44 |
+
this._flags = 0;
|
| 45 |
+
this.tokenMap = null;
|
| 46 |
+
this._boundGetRawIdentifier = null;
|
| 47 |
+
this._printSemicolonBeforeNextNode = -1;
|
| 48 |
+
this._printSemicolonBeforeNextToken = -1;
|
| 49 |
+
this.format = format;
|
| 50 |
+
this._tokens = tokens;
|
| 51 |
+
this._originalCode = originalCode;
|
| 52 |
+
this._indentRepeat = format.indent.style.length;
|
| 53 |
+
this._inputMap = (map == null ? void 0 : map._inputMap) || null;
|
| 54 |
+
this._buf = new _buffer.default(map, format.indent.style[0]);
|
| 55 |
+
const {
|
| 56 |
+
preserveFormat,
|
| 57 |
+
compact,
|
| 58 |
+
concise,
|
| 59 |
+
retainLines,
|
| 60 |
+
retainFunctionParens
|
| 61 |
+
} = format;
|
| 62 |
+
if (preserveFormat) {
|
| 63 |
+
this._flags |= 1;
|
| 64 |
+
}
|
| 65 |
+
if (compact) {
|
| 66 |
+
this._flags |= 2;
|
| 67 |
+
}
|
| 68 |
+
if (concise) {
|
| 69 |
+
this._flags |= 4;
|
| 70 |
+
}
|
| 71 |
+
if (retainLines) {
|
| 72 |
+
this._flags |= 8;
|
| 73 |
+
}
|
| 74 |
+
if (retainFunctionParens) {
|
| 75 |
+
this._flags |= 16;
|
| 76 |
+
}
|
| 77 |
+
if (format.auxiliaryCommentBefore || format.auxiliaryCommentAfter) {
|
| 78 |
+
this._flags |= 32;
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
enterDelimited() {
|
| 82 |
+
const oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
|
| 83 |
+
if (oldNoLineTerminatorAfterNode !== null) {
|
| 84 |
+
this._noLineTerminatorAfterNode = null;
|
| 85 |
+
}
|
| 86 |
+
return oldNoLineTerminatorAfterNode;
|
| 87 |
+
}
|
| 88 |
+
generate(ast) {
|
| 89 |
+
if (this.format.preserveFormat) {
|
| 90 |
+
this.tokenMap = new _tokenMap.TokenMap(ast, this._tokens, this._originalCode);
|
| 91 |
+
this._boundGetRawIdentifier = _types2._getRawIdentifier.bind(this);
|
| 92 |
+
}
|
| 93 |
+
this.print(ast);
|
| 94 |
+
this._maybeAddAuxComment();
|
| 95 |
+
return this._buf.get();
|
| 96 |
+
}
|
| 97 |
+
indent(flags = this._flags) {
|
| 98 |
+
if (flags & (1 | 2 | 4)) {
|
| 99 |
+
return;
|
| 100 |
+
}
|
| 101 |
+
this._indent += this._indentRepeat;
|
| 102 |
+
}
|
| 103 |
+
dedent(flags = this._flags) {
|
| 104 |
+
if (flags & (1 | 2 | 4)) {
|
| 105 |
+
return;
|
| 106 |
+
}
|
| 107 |
+
this._indent -= this._indentRepeat;
|
| 108 |
+
}
|
| 109 |
+
semicolon(force = false) {
|
| 110 |
+
const flags = this._flags;
|
| 111 |
+
if (flags & 32) {
|
| 112 |
+
this._maybeAddAuxComment();
|
| 113 |
+
}
|
| 114 |
+
if (flags & 1) {
|
| 115 |
+
const node = this._currentNode;
|
| 116 |
+
if (node.start != null && node.end != null) {
|
| 117 |
+
if (!this.tokenMap.endMatches(node, ";")) {
|
| 118 |
+
this._printSemicolonBeforeNextNode = this._buf.getCurrentLine();
|
| 119 |
+
return;
|
| 120 |
+
}
|
| 121 |
+
const indexes = this.tokenMap.getIndexes(this._currentNode);
|
| 122 |
+
this._catchUpTo(this._tokens[indexes[indexes.length - 1]].loc.start);
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
if (force) {
|
| 126 |
+
this._appendChar(59);
|
| 127 |
+
} else {
|
| 128 |
+
this._queue(59);
|
| 129 |
+
}
|
| 130 |
+
this._noLineTerminator = false;
|
| 131 |
+
}
|
| 132 |
+
rightBrace(node) {
|
| 133 |
+
if (this.format.minified) {
|
| 134 |
+
this._buf.removeLastSemicolon();
|
| 135 |
+
}
|
| 136 |
+
this.sourceWithOffset("end", node.loc, -1);
|
| 137 |
+
this.tokenChar(125);
|
| 138 |
+
}
|
| 139 |
+
rightParens(node) {
|
| 140 |
+
this.sourceWithOffset("end", node.loc, -1);
|
| 141 |
+
this.tokenChar(41);
|
| 142 |
+
}
|
| 143 |
+
space(force = false) {
|
| 144 |
+
if (this._flags & (1 | 2)) {
|
| 145 |
+
return;
|
| 146 |
+
}
|
| 147 |
+
if (force) {
|
| 148 |
+
this._space();
|
| 149 |
+
} else {
|
| 150 |
+
const lastCp = this.getLastChar(true);
|
| 151 |
+
if (lastCp !== 0 && lastCp !== 32 && lastCp !== 10) {
|
| 152 |
+
this._space();
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
word(str, noLineTerminatorAfter = false) {
|
| 157 |
+
this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask;
|
| 158 |
+
this._maybePrintInnerComments(str);
|
| 159 |
+
const flags = this._flags;
|
| 160 |
+
if (flags & 32) {
|
| 161 |
+
this._maybeAddAuxComment();
|
| 162 |
+
}
|
| 163 |
+
if (flags & 1) this._catchUpToCurrentToken(str);
|
| 164 |
+
const lastChar = this.getLastChar();
|
| 165 |
+
if (lastChar === -2 || lastChar === -3 || lastChar === 47 && str.charCodeAt(0) === 47) {
|
| 166 |
+
this._space();
|
| 167 |
+
}
|
| 168 |
+
this._append(str, false);
|
| 169 |
+
this.setLastChar(-3);
|
| 170 |
+
this._noLineTerminator = noLineTerminatorAfter;
|
| 171 |
+
}
|
| 172 |
+
number(str, number) {
|
| 173 |
+
function isNonDecimalLiteral(str) {
|
| 174 |
+
if (str.length > 2 && str.charCodeAt(0) === 48) {
|
| 175 |
+
const secondChar = str.charCodeAt(1);
|
| 176 |
+
return secondChar === 98 || secondChar === 111 || secondChar === 120;
|
| 177 |
+
}
|
| 178 |
+
return false;
|
| 179 |
+
}
|
| 180 |
+
this.word(str);
|
| 181 |
+
if (Number.isInteger(number) && !isNonDecimalLiteral(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46) {
|
| 182 |
+
this.setLastChar(-2);
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
+
token(str, maybeNewline = false, occurrenceCount = 0, mayNeedSpace = false) {
|
| 186 |
+
this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask;
|
| 187 |
+
this._maybePrintInnerComments(str, occurrenceCount);
|
| 188 |
+
const flags = this._flags;
|
| 189 |
+
if (flags & 32) {
|
| 190 |
+
this._maybeAddAuxComment();
|
| 191 |
+
}
|
| 192 |
+
if (flags & 1) {
|
| 193 |
+
this._catchUpToCurrentToken(str, occurrenceCount);
|
| 194 |
+
}
|
| 195 |
+
if (mayNeedSpace) {
|
| 196 |
+
const strFirst = str.charCodeAt(0);
|
| 197 |
+
if ((strFirst === 45 && str === "--" || strFirst === 61) && this.getLastChar() === 33 || strFirst === 43 && this.getLastChar() === 43 || strFirst === 45 && this.getLastChar() === 45 || strFirst === 46 && this.getLastChar() === -2) {
|
| 198 |
+
this._space();
|
| 199 |
+
}
|
| 200 |
+
}
|
| 201 |
+
this._append(str, maybeNewline);
|
| 202 |
+
this._noLineTerminator = false;
|
| 203 |
+
}
|
| 204 |
+
tokenChar(char, occurrenceCount = 0) {
|
| 205 |
+
this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask;
|
| 206 |
+
this._maybePrintInnerComments(char, occurrenceCount);
|
| 207 |
+
const flags = this._flags;
|
| 208 |
+
if (flags & 32) {
|
| 209 |
+
this._maybeAddAuxComment();
|
| 210 |
+
}
|
| 211 |
+
if (flags & 1) {
|
| 212 |
+
this._catchUpToCurrentToken(char, occurrenceCount);
|
| 213 |
+
}
|
| 214 |
+
if (char === 43 && this.getLastChar() === 43 || char === 45 && this.getLastChar() === 45 || char === 46 && this.getLastChar() === -2) {
|
| 215 |
+
this._space();
|
| 216 |
+
}
|
| 217 |
+
this._appendChar(char);
|
| 218 |
+
this._noLineTerminator = false;
|
| 219 |
+
}
|
| 220 |
+
newline(i = 1, flags = this._flags) {
|
| 221 |
+
if (i <= 0) return;
|
| 222 |
+
if (flags & (8 | 2)) {
|
| 223 |
+
return;
|
| 224 |
+
}
|
| 225 |
+
if (flags & 4) {
|
| 226 |
+
this.space();
|
| 227 |
+
return;
|
| 228 |
+
}
|
| 229 |
+
if (i > 2) i = 2;
|
| 230 |
+
i -= this._buf.getNewlineCount();
|
| 231 |
+
for (let j = 0; j < i; j++) {
|
| 232 |
+
this._newline();
|
| 233 |
+
}
|
| 234 |
+
}
|
| 235 |
+
endsWith(char) {
|
| 236 |
+
return this.getLastChar(true) === char;
|
| 237 |
+
}
|
| 238 |
+
getLastChar(checkQueue) {
|
| 239 |
+
return this._buf.getLastChar(checkQueue);
|
| 240 |
+
}
|
| 241 |
+
setLastChar(char) {
|
| 242 |
+
this._buf._last = char;
|
| 243 |
+
}
|
| 244 |
+
exactSource(loc, cb) {
|
| 245 |
+
if (!loc) {
|
| 246 |
+
cb();
|
| 247 |
+
return;
|
| 248 |
+
}
|
| 249 |
+
this._catchUp("start", loc);
|
| 250 |
+
this._buf.exactSource(loc, cb);
|
| 251 |
+
}
|
| 252 |
+
source(prop, loc) {
|
| 253 |
+
if (!loc) return;
|
| 254 |
+
this._catchUp(prop, loc);
|
| 255 |
+
this._buf.source(prop, loc);
|
| 256 |
+
}
|
| 257 |
+
sourceWithOffset(prop, loc, columnOffset) {
|
| 258 |
+
if (!loc || this.format.preserveFormat) return;
|
| 259 |
+
this._catchUp(prop, loc);
|
| 260 |
+
this._buf.sourceWithOffset(prop, loc, columnOffset);
|
| 261 |
+
}
|
| 262 |
+
sourceIdentifierName(identifierName, pos) {
|
| 263 |
+
if (!this._buf._canMarkIdName) return;
|
| 264 |
+
const sourcePosition = this._buf._sourcePosition;
|
| 265 |
+
sourcePosition.identifierNamePos = pos;
|
| 266 |
+
sourcePosition.identifierName = identifierName;
|
| 267 |
+
}
|
| 268 |
+
_space() {
|
| 269 |
+
this._queue(32);
|
| 270 |
+
}
|
| 271 |
+
_newline() {
|
| 272 |
+
if (this._buf._queuedChar === 32) this._buf._queuedChar = 0;
|
| 273 |
+
this._appendChar(10, true);
|
| 274 |
+
}
|
| 275 |
+
_catchUpToCurrentToken(str, occurrenceCount = 0) {
|
| 276 |
+
const token = this.tokenMap.findMatching(this._currentNode, str, occurrenceCount);
|
| 277 |
+
if (token) this._catchUpTo(token.loc.start);
|
| 278 |
+
if (this._printSemicolonBeforeNextToken !== -1 && this._printSemicolonBeforeNextToken === this._buf.getCurrentLine()) {
|
| 279 |
+
this._appendChar(59, true);
|
| 280 |
+
}
|
| 281 |
+
this._printSemicolonBeforeNextToken = -1;
|
| 282 |
+
this._printSemicolonBeforeNextNode = -1;
|
| 283 |
+
}
|
| 284 |
+
_append(str, maybeNewline) {
|
| 285 |
+
this._maybeIndent();
|
| 286 |
+
this._buf.append(str, maybeNewline);
|
| 287 |
+
}
|
| 288 |
+
_appendChar(char, noIndent) {
|
| 289 |
+
if (!noIndent) {
|
| 290 |
+
this._maybeIndent();
|
| 291 |
+
}
|
| 292 |
+
this._buf.appendChar(char);
|
| 293 |
+
}
|
| 294 |
+
_queue(char) {
|
| 295 |
+
this._buf.queue(char);
|
| 296 |
+
this.setLastChar(-1);
|
| 297 |
+
}
|
| 298 |
+
_maybeIndent() {
|
| 299 |
+
const indent = this._shouldIndent();
|
| 300 |
+
if (indent > 0) {
|
| 301 |
+
this._buf._appendChar(-1, indent, false);
|
| 302 |
+
}
|
| 303 |
+
}
|
| 304 |
+
_shouldIndent() {
|
| 305 |
+
return this.endsWith(10) ? this._indent : 0;
|
| 306 |
+
}
|
| 307 |
+
catchUp(line) {
|
| 308 |
+
if (!this.format.retainLines) return;
|
| 309 |
+
const count = line - this._buf.getCurrentLine();
|
| 310 |
+
for (let i = 0; i < count; i++) {
|
| 311 |
+
this._newline();
|
| 312 |
+
}
|
| 313 |
+
}
|
| 314 |
+
_catchUp(prop, loc) {
|
| 315 |
+
const flags = this._flags;
|
| 316 |
+
if ((flags & 1) === 0) {
|
| 317 |
+
if (flags & 8 && loc != null && loc[prop]) {
|
| 318 |
+
this.catchUp(loc[prop].line);
|
| 319 |
+
}
|
| 320 |
+
return;
|
| 321 |
+
}
|
| 322 |
+
const pos = loc == null ? void 0 : loc[prop];
|
| 323 |
+
if (pos != null) this._catchUpTo(pos);
|
| 324 |
+
}
|
| 325 |
+
_catchUpTo({
|
| 326 |
+
line,
|
| 327 |
+
column,
|
| 328 |
+
index
|
| 329 |
+
}) {
|
| 330 |
+
const count = line - this._buf.getCurrentLine();
|
| 331 |
+
if (count > 0 && this._noLineTerminator) {
|
| 332 |
+
return;
|
| 333 |
+
}
|
| 334 |
+
for (let i = 0; i < count; i++) {
|
| 335 |
+
this._newline();
|
| 336 |
+
}
|
| 337 |
+
const spacesCount = count > 0 ? column : column - this._buf.getCurrentColumn();
|
| 338 |
+
if (spacesCount > 0) {
|
| 339 |
+
const spaces = this._originalCode ? this._originalCode.slice(index - spacesCount, index).replace(/[^\t\x0B\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]/gu, " ") : " ".repeat(spacesCount);
|
| 340 |
+
this._buf.append(spaces, false, true);
|
| 341 |
+
this._buf.setSourcePosition(line, column);
|
| 342 |
+
this.setLastChar(32);
|
| 343 |
+
}
|
| 344 |
+
}
|
| 345 |
+
printTerminatorless(node) {
|
| 346 |
+
this._noLineTerminator = true;
|
| 347 |
+
this.print(node);
|
| 348 |
+
}
|
| 349 |
+
print(node, noLineTerminatorAfter = false, resetTokenContext = false, trailingCommentsLineOffset) {
|
| 350 |
+
var _node$leadingComments, _node$leadingComments2;
|
| 351 |
+
if (!node) return;
|
| 352 |
+
this._innerCommentsState = 0;
|
| 353 |
+
const {
|
| 354 |
+
type,
|
| 355 |
+
loc,
|
| 356 |
+
extra
|
| 357 |
+
} = node;
|
| 358 |
+
const flags = this._flags;
|
| 359 |
+
let changedFlags = false;
|
| 360 |
+
if (node._compact) {
|
| 361 |
+
this._flags |= 4;
|
| 362 |
+
changedFlags = true;
|
| 363 |
+
}
|
| 364 |
+
const nodeInfo = _nodes.generatorInfosMap.get(type);
|
| 365 |
+
if (nodeInfo === undefined) {
|
| 366 |
+
throw new ReferenceError(`unknown node of type ${JSON.stringify(type)} with constructor ${JSON.stringify(node.constructor.name)}`);
|
| 367 |
+
}
|
| 368 |
+
const [printMethod, nodeId, needsParens] = nodeInfo;
|
| 369 |
+
const parent = this._currentNode;
|
| 370 |
+
const parentId = this._currentTypeId;
|
| 371 |
+
this._currentNode = node;
|
| 372 |
+
this._currentTypeId = nodeId;
|
| 373 |
+
if (flags & 1) {
|
| 374 |
+
this._printSemicolonBeforeNextToken = this._printSemicolonBeforeNextNode;
|
| 375 |
+
}
|
| 376 |
+
let oldInAux;
|
| 377 |
+
if (flags & 32) {
|
| 378 |
+
oldInAux = this._insideAux;
|
| 379 |
+
this._insideAux = loc == null;
|
| 380 |
+
this._maybeAddAuxComment(this._insideAux && !oldInAux);
|
| 381 |
+
}
|
| 382 |
+
let oldTokenContext = 0;
|
| 383 |
+
if (resetTokenContext) {
|
| 384 |
+
oldTokenContext = this.tokenContext;
|
| 385 |
+
if (oldTokenContext & _index.TokenContext.forInOrInitHeadAccumulate) {
|
| 386 |
+
this.tokenContext = 0;
|
| 387 |
+
} else {
|
| 388 |
+
oldTokenContext = 0;
|
| 389 |
+
}
|
| 390 |
+
}
|
| 391 |
+
const parenthesized = extra != null && extra.parenthesized;
|
| 392 |
+
let shouldPrintParens = parenthesized && flags & 1 || parenthesized && flags & 16 && nodeId === 71 || parent && ((0, _index.parentNeedsParens)(node, parent, parentId) || needsParens != null && needsParens(node, parent, parentId, this.tokenContext, flags & 1 ? this._boundGetRawIdentifier : undefined));
|
| 393 |
+
if (!shouldPrintParens && parenthesized && (_node$leadingComments = node.leadingComments) != null && _node$leadingComments.length && node.leadingComments[0].type === "CommentBlock") {
|
| 394 |
+
switch (parentId) {
|
| 395 |
+
case 65:
|
| 396 |
+
case 243:
|
| 397 |
+
case 6:
|
| 398 |
+
case 143:
|
| 399 |
+
break;
|
| 400 |
+
case 17:
|
| 401 |
+
case 130:
|
| 402 |
+
case 112:
|
| 403 |
+
if (parent.callee !== node) break;
|
| 404 |
+
default:
|
| 405 |
+
shouldPrintParens = true;
|
| 406 |
+
}
|
| 407 |
+
}
|
| 408 |
+
let indentParenthesized = false;
|
| 409 |
+
if (!shouldPrintParens && this._noLineTerminator && ((_node$leadingComments2 = node.leadingComments) != null && _node$leadingComments2.some(commentIsNewline) || flags & 8 && loc && loc.start.line > this._buf.getCurrentLine())) {
|
| 410 |
+
shouldPrintParens = true;
|
| 411 |
+
indentParenthesized = true;
|
| 412 |
+
}
|
| 413 |
+
let oldNoLineTerminatorAfterNode;
|
| 414 |
+
if (!shouldPrintParens) {
|
| 415 |
+
noLineTerminatorAfter || (noLineTerminatorAfter = !!parent && this._noLineTerminatorAfterNode === parent && (0, _index.isLastChild)(parent, node));
|
| 416 |
+
if (noLineTerminatorAfter) {
|
| 417 |
+
var _node$trailingComment;
|
| 418 |
+
if ((_node$trailingComment = node.trailingComments) != null && _node$trailingComment.some(commentIsNewline)) {
|
| 419 |
+
if (isExpression(node)) shouldPrintParens = true;
|
| 420 |
+
} else {
|
| 421 |
+
oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
|
| 422 |
+
this._noLineTerminatorAfterNode = node;
|
| 423 |
+
}
|
| 424 |
+
}
|
| 425 |
+
}
|
| 426 |
+
if (shouldPrintParens) {
|
| 427 |
+
this.tokenChar(40);
|
| 428 |
+
if (indentParenthesized) this.indent();
|
| 429 |
+
this._innerCommentsState = 0;
|
| 430 |
+
if (!resetTokenContext) {
|
| 431 |
+
oldTokenContext = this.tokenContext;
|
| 432 |
+
}
|
| 433 |
+
if (oldTokenContext & _index.TokenContext.forInOrInitHeadAccumulate) {
|
| 434 |
+
this.tokenContext = 0;
|
| 435 |
+
}
|
| 436 |
+
oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
|
| 437 |
+
this._noLineTerminatorAfterNode = null;
|
| 438 |
+
}
|
| 439 |
+
this._printLeadingComments(node, parent);
|
| 440 |
+
this.exactSource(nodeId === 139 || nodeId === 66 ? null : loc, printMethod.bind(this, node, parent));
|
| 441 |
+
if (shouldPrintParens) {
|
| 442 |
+
this._printTrailingComments(node, parent);
|
| 443 |
+
if (indentParenthesized) {
|
| 444 |
+
this.dedent();
|
| 445 |
+
this.newline();
|
| 446 |
+
}
|
| 447 |
+
this.tokenChar(41);
|
| 448 |
+
this._noLineTerminator = noLineTerminatorAfter;
|
| 449 |
+
} else if (noLineTerminatorAfter && !this._noLineTerminator) {
|
| 450 |
+
this._noLineTerminator = true;
|
| 451 |
+
this._printTrailingComments(node, parent);
|
| 452 |
+
} else {
|
| 453 |
+
this._printTrailingComments(node, parent, trailingCommentsLineOffset);
|
| 454 |
+
}
|
| 455 |
+
if (oldTokenContext) this.tokenContext = oldTokenContext;
|
| 456 |
+
this._currentNode = parent;
|
| 457 |
+
this._currentTypeId = parentId;
|
| 458 |
+
if (changedFlags) {
|
| 459 |
+
this._flags = flags;
|
| 460 |
+
}
|
| 461 |
+
if (flags & 32) {
|
| 462 |
+
this._insideAux = oldInAux;
|
| 463 |
+
}
|
| 464 |
+
if (oldNoLineTerminatorAfterNode != null) {
|
| 465 |
+
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
| 466 |
+
}
|
| 467 |
+
this._innerCommentsState = 0;
|
| 468 |
+
}
|
| 469 |
+
_maybeAddAuxComment(enteredPositionlessNode) {
|
| 470 |
+
if (enteredPositionlessNode) this._printAuxBeforeComment();
|
| 471 |
+
if (!this._insideAux) this._printAuxAfterComment();
|
| 472 |
+
}
|
| 473 |
+
_printAuxBeforeComment() {
|
| 474 |
+
if (this._printAuxAfterOnNextUserNode) return;
|
| 475 |
+
this._printAuxAfterOnNextUserNode = true;
|
| 476 |
+
const comment = this.format.auxiliaryCommentBefore;
|
| 477 |
+
if (comment) {
|
| 478 |
+
this._printComment({
|
| 479 |
+
type: "CommentBlock",
|
| 480 |
+
value: comment
|
| 481 |
+
}, 0);
|
| 482 |
+
}
|
| 483 |
+
}
|
| 484 |
+
_printAuxAfterComment() {
|
| 485 |
+
if (!this._printAuxAfterOnNextUserNode) return;
|
| 486 |
+
this._printAuxAfterOnNextUserNode = false;
|
| 487 |
+
const comment = this.format.auxiliaryCommentAfter;
|
| 488 |
+
if (comment) {
|
| 489 |
+
this._printComment({
|
| 490 |
+
type: "CommentBlock",
|
| 491 |
+
value: comment
|
| 492 |
+
}, 0);
|
| 493 |
+
}
|
| 494 |
+
}
|
| 495 |
+
getPossibleRaw(node) {
|
| 496 |
+
const extra = node.extra;
|
| 497 |
+
if ((extra == null ? void 0 : extra.raw) != null && extra.rawValue != null && node.value === extra.rawValue) {
|
| 498 |
+
return extra.raw;
|
| 499 |
+
}
|
| 500 |
+
}
|
| 501 |
+
printJoin(nodes, statement, indent, separator, printTrailingSeparator, resetTokenContext, trailingCommentsLineOffset) {
|
| 502 |
+
if (!(nodes != null && nodes.length)) return;
|
| 503 |
+
const flags = this._flags;
|
| 504 |
+
if (indent == null && flags & 8) {
|
| 505 |
+
var _nodes$0$loc;
|
| 506 |
+
const startLine = (_nodes$0$loc = nodes[0].loc) == null ? void 0 : _nodes$0$loc.start.line;
|
| 507 |
+
if (startLine != null && startLine !== this._buf.getCurrentLine()) {
|
| 508 |
+
indent = true;
|
| 509 |
+
}
|
| 510 |
+
}
|
| 511 |
+
if (indent) this.indent(flags);
|
| 512 |
+
const len = nodes.length;
|
| 513 |
+
for (let i = 0; i < len; i++) {
|
| 514 |
+
const node = nodes[i];
|
| 515 |
+
if (!node) continue;
|
| 516 |
+
if (statement && i === 0 && this._buf.hasContent()) {
|
| 517 |
+
this.newline(1, flags);
|
| 518 |
+
}
|
| 519 |
+
this.print(node, false, resetTokenContext, trailingCommentsLineOffset || 0);
|
| 520 |
+
if (separator != null) {
|
| 521 |
+
if (i < len - 1) separator.call(this, i, false);else if (printTrailingSeparator) separator.call(this, i, true);
|
| 522 |
+
}
|
| 523 |
+
if (statement) {
|
| 524 |
+
if (i + 1 === len) {
|
| 525 |
+
this.newline(1, flags);
|
| 526 |
+
} else {
|
| 527 |
+
const lastCommentLine = this._lastCommentLine;
|
| 528 |
+
if (lastCommentLine > 0) {
|
| 529 |
+
var _nodes$loc;
|
| 530 |
+
const offset = (((_nodes$loc = nodes[i + 1].loc) == null ? void 0 : _nodes$loc.start.line) || 0) - lastCommentLine;
|
| 531 |
+
if (offset >= 0) {
|
| 532 |
+
this.newline(offset || 1, flags);
|
| 533 |
+
continue;
|
| 534 |
+
}
|
| 535 |
+
}
|
| 536 |
+
this.newline(1, flags);
|
| 537 |
+
}
|
| 538 |
+
}
|
| 539 |
+
}
|
| 540 |
+
if (indent) this.dedent(flags);
|
| 541 |
+
}
|
| 542 |
+
printAndIndentOnComments(node) {
|
| 543 |
+
const indent = node.leadingComments && node.leadingComments.length > 0;
|
| 544 |
+
if (indent) this.indent();
|
| 545 |
+
this.print(node);
|
| 546 |
+
if (indent) this.dedent();
|
| 547 |
+
}
|
| 548 |
+
printBlock(body) {
|
| 549 |
+
if (body.type !== "EmptyStatement") {
|
| 550 |
+
this.space();
|
| 551 |
+
}
|
| 552 |
+
this.print(body);
|
| 553 |
+
}
|
| 554 |
+
_printTrailingComments(node, parent, lineOffset) {
|
| 555 |
+
const {
|
| 556 |
+
innerComments,
|
| 557 |
+
trailingComments
|
| 558 |
+
} = node;
|
| 559 |
+
if (innerComments != null && innerComments.length) {
|
| 560 |
+
this._printComments(2, innerComments, node, parent, lineOffset);
|
| 561 |
+
}
|
| 562 |
+
if (trailingComments != null && trailingComments.length) {
|
| 563 |
+
this._printComments(2, trailingComments, node, parent, lineOffset);
|
| 564 |
+
} else {
|
| 565 |
+
this._lastCommentLine = 0;
|
| 566 |
+
}
|
| 567 |
+
}
|
| 568 |
+
_printLeadingComments(node, parent) {
|
| 569 |
+
const comments = node.leadingComments;
|
| 570 |
+
if (!(comments != null && comments.length)) return;
|
| 571 |
+
this._printComments(0, comments, node, parent);
|
| 572 |
+
}
|
| 573 |
+
_maybePrintInnerComments(nextTokenStr, nextTokenOccurrenceCount) {
|
| 574 |
+
var _this$tokenMap;
|
| 575 |
+
const state = this._innerCommentsState;
|
| 576 |
+
switch (state & 3) {
|
| 577 |
+
case 0:
|
| 578 |
+
this._innerCommentsState = 1 | 4;
|
| 579 |
+
return;
|
| 580 |
+
case 1:
|
| 581 |
+
this.printInnerComments((state & 4) > 0, (_this$tokenMap = this.tokenMap) == null ? void 0 : _this$tokenMap.findMatching(this._currentNode, nextTokenStr, nextTokenOccurrenceCount));
|
| 582 |
+
}
|
| 583 |
+
}
|
| 584 |
+
printInnerComments(indent = true, nextToken) {
|
| 585 |
+
const node = this._currentNode;
|
| 586 |
+
const comments = node.innerComments;
|
| 587 |
+
if (!(comments != null && comments.length)) {
|
| 588 |
+
this._innerCommentsState = 2;
|
| 589 |
+
return;
|
| 590 |
+
}
|
| 591 |
+
const hasSpace = this.endsWith(32);
|
| 592 |
+
if (indent) this.indent();
|
| 593 |
+
switch (this._printComments(1, comments, node, undefined, undefined, nextToken)) {
|
| 594 |
+
case 2:
|
| 595 |
+
this._innerCommentsState = 2;
|
| 596 |
+
case 1:
|
| 597 |
+
if (hasSpace) this.space();
|
| 598 |
+
}
|
| 599 |
+
if (indent) this.dedent();
|
| 600 |
+
}
|
| 601 |
+
noIndentInnerCommentsHere() {
|
| 602 |
+
this._innerCommentsState &= ~4;
|
| 603 |
+
}
|
| 604 |
+
printSequence(nodes, indent, resetTokenContext, trailingCommentsLineOffset) {
|
| 605 |
+
this.printJoin(nodes, true, indent != null ? indent : false, undefined, undefined, resetTokenContext, trailingCommentsLineOffset);
|
| 606 |
+
}
|
| 607 |
+
printList(items, printTrailingSeparator, statement, indent, separator, resetTokenContext) {
|
| 608 |
+
this.printJoin(items, statement, indent, separator != null ? separator : commaSeparator, printTrailingSeparator, resetTokenContext);
|
| 609 |
+
}
|
| 610 |
+
shouldPrintTrailingComma(listEnd) {
|
| 611 |
+
if (!this.tokenMap) return null;
|
| 612 |
+
const listEndIndex = this.tokenMap.findLastIndex(this._currentNode, token => this.tokenMap.matchesOriginal(token, typeof listEnd === "number" ? String.fromCharCode(listEnd) : listEnd));
|
| 613 |
+
if (listEndIndex <= 0) return null;
|
| 614 |
+
return this.tokenMap.matchesOriginal(this._tokens[listEndIndex - 1], ",");
|
| 615 |
+
}
|
| 616 |
+
_shouldPrintComment(comment, nextToken) {
|
| 617 |
+
if (comment.ignore) return 0;
|
| 618 |
+
if (this._printedComments.has(comment)) return 0;
|
| 619 |
+
if (this._noLineTerminator && HAS_NEWLINE_OR_BlOCK_COMMENT_END.test(comment.value)) {
|
| 620 |
+
return 2;
|
| 621 |
+
}
|
| 622 |
+
if (nextToken && this.tokenMap) {
|
| 623 |
+
const commentTok = this.tokenMap.find(this._currentNode, token => token.value === comment.value);
|
| 624 |
+
if (commentTok && commentTok.start > nextToken.start) {
|
| 625 |
+
return 2;
|
| 626 |
+
}
|
| 627 |
+
}
|
| 628 |
+
this._printedComments.add(comment);
|
| 629 |
+
if (!this.format.shouldPrintComment(comment.value)) {
|
| 630 |
+
return 0;
|
| 631 |
+
}
|
| 632 |
+
return 1;
|
| 633 |
+
}
|
| 634 |
+
_printComment(comment, skipNewLines) {
|
| 635 |
+
const noLineTerminator = this._noLineTerminator;
|
| 636 |
+
const isBlockComment = comment.type === "CommentBlock";
|
| 637 |
+
const printNewLines = isBlockComment && skipNewLines !== 1 && !noLineTerminator;
|
| 638 |
+
if (printNewLines && this._buf.hasContent() && skipNewLines !== 2) {
|
| 639 |
+
this.newline(1);
|
| 640 |
+
}
|
| 641 |
+
switch (this.getLastChar(true)) {
|
| 642 |
+
case 47:
|
| 643 |
+
this._space();
|
| 644 |
+
case 91:
|
| 645 |
+
case 123:
|
| 646 |
+
case 40:
|
| 647 |
+
break;
|
| 648 |
+
default:
|
| 649 |
+
this.space();
|
| 650 |
+
}
|
| 651 |
+
let val;
|
| 652 |
+
if (isBlockComment) {
|
| 653 |
+
val = `/*${comment.value}*/`;
|
| 654 |
+
if (this.format.indent.adjustMultilineComment) {
|
| 655 |
+
var _comment$loc;
|
| 656 |
+
const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;
|
| 657 |
+
if (offset) {
|
| 658 |
+
const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
|
| 659 |
+
val = val.replace(newlineRegex, "\n");
|
| 660 |
+
}
|
| 661 |
+
if (this._flags & 4) {
|
| 662 |
+
val = val.replace(/\n(?!$)/g, `\n`);
|
| 663 |
+
} else {
|
| 664 |
+
let indentSize = this.format.retainLines ? 0 : this._buf.getCurrentColumn();
|
| 665 |
+
if (this._shouldIndent() || this.format.retainLines) {
|
| 666 |
+
indentSize += this._indent;
|
| 667 |
+
}
|
| 668 |
+
val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`);
|
| 669 |
+
}
|
| 670 |
+
}
|
| 671 |
+
} else if (!noLineTerminator) {
|
| 672 |
+
val = `//${comment.value}`;
|
| 673 |
+
} else {
|
| 674 |
+
val = `/*${comment.value}*/`;
|
| 675 |
+
}
|
| 676 |
+
this.source("start", comment.loc);
|
| 677 |
+
this._append(val, isBlockComment);
|
| 678 |
+
if (!isBlockComment && !noLineTerminator) {
|
| 679 |
+
this._newline();
|
| 680 |
+
}
|
| 681 |
+
if (printNewLines && skipNewLines !== 3) {
|
| 682 |
+
this.newline(1);
|
| 683 |
+
}
|
| 684 |
+
}
|
| 685 |
+
_printComments(type, comments, node, parent, lineOffset = 0, nextToken) {
|
| 686 |
+
const nodeLoc = node.loc;
|
| 687 |
+
const len = comments.length;
|
| 688 |
+
let hasLoc = !!nodeLoc;
|
| 689 |
+
const nodeStartLine = hasLoc ? nodeLoc.start.line : 0;
|
| 690 |
+
const nodeEndLine = hasLoc ? nodeLoc.end.line : 0;
|
| 691 |
+
let lastLine = 0;
|
| 692 |
+
let leadingCommentNewline = 0;
|
| 693 |
+
const {
|
| 694 |
+
_noLineTerminator,
|
| 695 |
+
_flags
|
| 696 |
+
} = this;
|
| 697 |
+
for (let i = 0; i < len; i++) {
|
| 698 |
+
const comment = comments[i];
|
| 699 |
+
const shouldPrint = this._shouldPrintComment(comment, nextToken);
|
| 700 |
+
if (shouldPrint === 2) {
|
| 701 |
+
return i === 0 ? 0 : 1;
|
| 702 |
+
}
|
| 703 |
+
if (hasLoc && comment.loc && shouldPrint === 1) {
|
| 704 |
+
const commentStartLine = comment.loc.start.line;
|
| 705 |
+
const commentEndLine = comment.loc.end.line;
|
| 706 |
+
if (type === 0) {
|
| 707 |
+
let offset = 0;
|
| 708 |
+
if (i === 0) {
|
| 709 |
+
if (this._buf.hasContent() && (comment.type === "CommentLine" || commentStartLine !== commentEndLine)) {
|
| 710 |
+
offset = leadingCommentNewline = 1;
|
| 711 |
+
}
|
| 712 |
+
} else {
|
| 713 |
+
offset = commentStartLine - lastLine;
|
| 714 |
+
}
|
| 715 |
+
lastLine = commentEndLine;
|
| 716 |
+
if (offset > 0 && !_noLineTerminator) {
|
| 717 |
+
this.newline(offset, _flags);
|
| 718 |
+
}
|
| 719 |
+
this._printComment(comment, 1);
|
| 720 |
+
if (i + 1 === len) {
|
| 721 |
+
const count = Math.max(nodeStartLine - lastLine, leadingCommentNewline);
|
| 722 |
+
if (count > 0 && !_noLineTerminator) {
|
| 723 |
+
this.newline(count, _flags);
|
| 724 |
+
}
|
| 725 |
+
lastLine = nodeStartLine;
|
| 726 |
+
}
|
| 727 |
+
} else if (type === 1) {
|
| 728 |
+
const offset = commentStartLine - (i === 0 ? nodeStartLine : lastLine);
|
| 729 |
+
lastLine = commentEndLine;
|
| 730 |
+
if (offset > 0 && !_noLineTerminator) {
|
| 731 |
+
this.newline(offset, _flags);
|
| 732 |
+
}
|
| 733 |
+
this._printComment(comment, 1);
|
| 734 |
+
if (i + 1 === len) {
|
| 735 |
+
const count = Math.min(1, nodeEndLine - lastLine);
|
| 736 |
+
if (count > 0 && !_noLineTerminator) {
|
| 737 |
+
this.newline(count, _flags);
|
| 738 |
+
}
|
| 739 |
+
lastLine = nodeEndLine;
|
| 740 |
+
}
|
| 741 |
+
} else {
|
| 742 |
+
const offset = commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine);
|
| 743 |
+
lastLine = commentEndLine;
|
| 744 |
+
if (offset > 0 && !_noLineTerminator) {
|
| 745 |
+
this.newline(offset, _flags);
|
| 746 |
+
}
|
| 747 |
+
this._printComment(comment, 1);
|
| 748 |
+
}
|
| 749 |
+
} else {
|
| 750 |
+
hasLoc = false;
|
| 751 |
+
if (shouldPrint !== 1) {
|
| 752 |
+
continue;
|
| 753 |
+
}
|
| 754 |
+
if (len === 1) {
|
| 755 |
+
const singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value);
|
| 756 |
+
const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent) && !isTSEnumMember(node);
|
| 757 |
+
if (type === 0) {
|
| 758 |
+
this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction(parent) && parent.body === node ? 1 : 0);
|
| 759 |
+
} else if (shouldSkipNewline && type === 2) {
|
| 760 |
+
this._printComment(comment, 1);
|
| 761 |
+
} else {
|
| 762 |
+
this._printComment(comment, 0);
|
| 763 |
+
}
|
| 764 |
+
} else if (type === 1 && !(node.type === "ObjectExpression" && node.properties.length > 1) && node.type !== "ClassBody" && node.type !== "TSInterfaceBody") {
|
| 765 |
+
this._printComment(comment, i === 0 ? 2 : i === len - 1 ? 3 : 0);
|
| 766 |
+
} else {
|
| 767 |
+
this._printComment(comment, 0);
|
| 768 |
+
}
|
| 769 |
+
}
|
| 770 |
+
}
|
| 771 |
+
if (type === 2 && hasLoc && lastLine) {
|
| 772 |
+
this._lastCommentLine = lastLine;
|
| 773 |
+
}
|
| 774 |
+
return 2;
|
| 775 |
+
}
|
| 776 |
+
}
|
| 777 |
+
var _default = exports.default = Printer;
|
| 778 |
+
function commaSeparator(occurrenceCount, last) {
|
| 779 |
+
this.tokenChar(44, occurrenceCount);
|
| 780 |
+
if (!last) this.space();
|
| 781 |
+
}
|
| 782 |
+
|
| 783 |
+
//# sourceMappingURL=printer.js.map
|
node_modules/@babel/generator/lib/printer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_buffer","require","_index","_nodes","_t","_tokenMap","_types2","isExpression","isFunction","isStatement","isClassBody","isTSInterfaceBody","isTSEnumMember","SCIENTIFIC_NOTATION","ZERO_DECIMAL_INTEGER","HAS_NEWLINE","HAS_NEWLINE_OR_BlOCK_COMMENT_END","commentIsNewline","c","type","test","value","Printer","constructor","format","map","tokens","originalCode","tokenContext","TokenContext","normal","_tokens","_originalCode","_currentNode","_currentTypeId","_indent","_indentRepeat","_insideAux","_noLineTerminator","_noLineTerminatorAfterNode","_printAuxAfterOnNextUserNode","_printedComments","Set","_lastCommentLine","_innerCommentsState","_flags","tokenMap","_boundGetRawIdentifier","_printSemicolonBeforeNextNode","_printSemicolonBeforeNextToken","indent","style","length","_inputMap","_buf","Buffer","preserveFormat","compact","concise","retainLines","retainFunctionParens","auxiliaryCommentBefore","auxiliaryCommentAfter","enterDelimited","oldNoLineTerminatorAfterNode","generate","ast","TokenMap","_getRawIdentifier","bind","print","_maybeAddAuxComment","get","flags","dedent","semicolon","force","node","start","end","endMatches","getCurrentLine","indexes","getIndexes","_catchUpTo","loc","_appendChar","_queue","rightBrace","minified","removeLastSemicolon","sourceWithOffset","token","rightParens","space","_space","lastCp","getLastChar","word","str","noLineTerminatorAfter","forInOrInitHeadAccumulatePassThroughMask","_maybePrintInnerComments","_catchUpToCurrentToken","lastChar","charCodeAt","_append","setLastChar","number","isNonDecimalLiteral","secondChar","Number","isInteger","maybeNewline","occurrenceCount","mayNeedSpace","strFirst","tokenChar","char","newline","i","getNewlineCount","j","_newline","endsWith","checkQueue","_last","exactSource","cb","_catchUp","source","prop","columnOffset","sourceIdentifierName","identifierName","pos","_canMarkIdName","sourcePosition","_sourcePosition","identifierNamePos","_queuedChar","findMatching","_maybeIndent","append","noIndent","appendChar","queue","_shouldIndent","catchUp","line","count","column","index","spacesCount","getCurrentColumn","spaces","slice","replace","repeat","setSourcePosition","printTerminatorless","resetTokenContext","trailingCommentsLineOffset","_node$leadingComments","_node$leadingComments2","extra","changedFlags","_compact","nodeInfo","generatorInfosMap","undefined","ReferenceError","JSON","stringify","name","printMethod","nodeId","needsParens","parent","parentId","oldInAux","oldTokenContext","forInOrInitHeadAccumulate","parenthesized","shouldPrintParens","parentNeedsParens","leadingComments","callee","indentParenthesized","some","isLastChild","_node$trailingComment","trailingComments","_printLeadingComments","_printTrailingComments","enteredPositionlessNode","_printAuxBeforeComment","_printAuxAfterComment","comment","_printComment","getPossibleRaw","raw","rawValue","printJoin","nodes","statement","separator","printTrailingSeparator","_nodes$0$loc","startLine","len","hasContent","call","lastCommentLine","_nodes$loc","offset","printAndIndentOnComments","printBlock","body","lineOffset","innerComments","_printComments","comments","nextTokenStr","nextTokenOccurrenceCount","_this$tokenMap","state","printInnerComments","nextToken","hasSpace","noIndentInnerCommentsHere","printSequence","printList","items","commaSeparator","shouldPrintTrailingComma","listEnd","listEndIndex","findLastIndex","matchesOriginal","String","fromCharCode","_shouldPrintComment","ignore","has","commentTok","find","add","shouldPrintComment","skipNewLines","noLineTerminator","isBlockComment","printNewLines","val","adjustMultilineComment","_comment$loc","newlineRegex","RegExp","indentSize","nodeLoc","hasLoc","nodeStartLine","nodeEndLine","lastLine","leadingCommentNewline","shouldPrint","commentStartLine","commentEndLine","Math","max","min","singleLine","shouldSkipNewline","properties","_default","exports","default","last"],"sources":["../src/printer.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */\n\nimport Buffer from \"./buffer.ts\";\nimport type { Loc, Pos } from \"./buffer.ts\";\nimport { isLastChild, parentNeedsParens } from \"./node/index.ts\";\nimport { generatorInfosMap } from \"./nodes.ts\";\nimport type * as t from \"@babel/types\";\nimport {\n isExpression,\n isFunction,\n isStatement,\n isClassBody,\n isTSInterfaceBody,\n isTSEnumMember,\n} from \"@babel/types\";\nimport type { Opts as jsescOptions } from \"jsesc\";\n\nimport { TokenMap } from \"./token-map.ts\";\n\nimport type { GeneratorOptions } from \"./index.ts\";\nimport type SourceMap from \"./source-map.ts\";\nimport type { TraceMap } from \"@jridgewell/trace-mapping\";\nimport type { Token } from \"@babel/parser\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\nconst SCIENTIFIC_NOTATION = /e/i;\nconst ZERO_DECIMAL_INTEGER = /\\.0+$/;\nconst HAS_NEWLINE = /[\\n\\r\\u2028\\u2029]/;\nconst HAS_NEWLINE_OR_BlOCK_COMMENT_END = /[\\n\\r\\u2028\\u2029]|\\*\\//;\n\nfunction commentIsNewline(c: t.Comment) {\n return c.type === \"CommentLine\" || HAS_NEWLINE.test(c.value);\n}\n\nimport { TokenContext } from \"./node/index.ts\";\nimport { _getRawIdentifier } from \"./generators/types.ts\";\n\nconst enum COMMENT_TYPE {\n LEADING,\n INNER,\n TRAILING,\n}\n\nconst enum COMMENT_SKIP_NEWLINE {\n DEFAULT,\n ALL,\n LEADING,\n TRAILING,\n}\n\nconst enum PRINT_COMMENT_HINT {\n SKIP,\n ALLOW,\n DEFER,\n}\n\nconst enum PRINTER_FLAGS {\n EMPTY = 0,\n PRESERVE_FORMAT = 1 << 0,\n COMPACT = 1 << 1,\n CONCISE = 1 << 2,\n RETAIN_LINES = 1 << 3,\n RETAIN_FUNCTION_PARENS = 1 << 4,\n AUX_COMMENTS = 1 << 5,\n}\n\nconst enum LAST_CHAR_KINDS {\n EMPTY = 0,\n NORMAL = -1,\n INTEGER = -2,\n WORD = -3,\n}\n\nconst enum INNER_COMMENTS_STATE {\n DISALLOWED = 0,\n ALLOWED = 1,\n PRINTED = 2,\n\n WITH_INDENT = 4,\n MASK = 3,\n}\n\nconst enum PRINT_COMMENTS_RESULT {\n PRINTED_NONE = 0,\n PRINTED_SOME = 1,\n PRINTED_ALL = 2,\n}\n\nexport type Format = {\n shouldPrintComment: (comment: string) => boolean;\n preserveFormat: boolean | undefined;\n retainLines: boolean | undefined;\n retainFunctionParens: boolean | undefined;\n comments: boolean | undefined;\n auxiliaryCommentBefore: string | undefined;\n auxiliaryCommentAfter: string | undefined;\n compact: boolean | \"auto\" | undefined;\n minified: boolean | undefined;\n concise: boolean | undefined;\n indent: {\n adjustMultilineComment: boolean;\n style: string;\n };\n /**\n * @deprecated Removed in Babel 8, syntax type is always 'hash'\n */\n recordAndTupleSyntaxType?: GeneratorOptions[\"recordAndTupleSyntaxType\"];\n jsescOption: jsescOptions;\n /**\n * @deprecated Removed in Babel 8, use `jsescOption` instead\n */\n jsonCompatibleStrings?: boolean;\n /**\n * For use with the Hack-style pipe operator.\n * Changes what token is used for pipe bodies’ topic references.\n */\n topicToken?: GeneratorOptions[\"topicToken\"];\n /**\n * @deprecated Removed in Babel 8\n */\n decoratorsBeforeExport?: boolean;\n /**\n * The import attributes syntax style:\n * - \"with\" : `import { a } from \"b\" with { type: \"json\" };`\n * - \"assert\" : `import { a } from \"b\" assert { type: \"json\" };`\n * - \"with-legacy\" : `import { a } from \"b\" with type: \"json\";`\n * @deprecated Removed in Babel 8.\n */\n importAttributesKeyword?: \"with\" | \"assert\" | \"with-legacy\";\n};\n\ninterface PrintSequenceOptions {\n statement?: boolean;\n indent?: boolean;\n trailingCommentsLineOffset?: number;\n}\n\ninterface PrintListOptions {\n separator?: (this: Printer, occurrenceCount: number, last: boolean) => void;\n statement?: boolean;\n indent?: boolean;\n printTrailingSeparator?: boolean;\n}\n\nexport type PrintJoinOptions = PrintListOptions & PrintSequenceOptions;\nclass Printer {\n constructor(\n format: Format,\n map: SourceMap | null,\n tokens: Token[] | null = null,\n originalCode: string | null = null,\n ) {\n this.format = format;\n\n this._tokens = tokens;\n this._originalCode = originalCode;\n\n this._indentRepeat = format.indent.style.length;\n\n this._inputMap = map?._inputMap || null;\n\n this._buf = new Buffer(map, format.indent.style[0]);\n\n const {\n preserveFormat,\n compact,\n concise,\n retainLines,\n retainFunctionParens,\n } = format;\n if (preserveFormat) {\n this._flags |= PRINTER_FLAGS.PRESERVE_FORMAT;\n }\n if (compact) {\n this._flags |= PRINTER_FLAGS.COMPACT;\n }\n if (concise) {\n this._flags |= PRINTER_FLAGS.CONCISE;\n }\n if (retainLines) {\n this._flags |= PRINTER_FLAGS.RETAIN_LINES;\n }\n if (retainFunctionParens) {\n this._flags |= PRINTER_FLAGS.RETAIN_FUNCTION_PARENS;\n }\n if (format.auxiliaryCommentBefore || format.auxiliaryCommentAfter) {\n this._flags |= PRINTER_FLAGS.AUX_COMMENTS;\n }\n }\n declare _inputMap: TraceMap | null;\n\n declare format: Format;\n\n enterDelimited() {\n const oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;\n if (oldNoLineTerminatorAfterNode !== null) {\n this._noLineTerminatorAfterNode = null;\n }\n return oldNoLineTerminatorAfterNode;\n }\n\n tokenContext: number = TokenContext.normal;\n\n _tokens: Token[] | null = null;\n _originalCode: string | null = null;\n\n declare _buf: Buffer;\n _currentNode: t.Node | null = null;\n _currentTypeId: number | null = null;\n _indent: number = 0;\n _indentRepeat: number = 0;\n _insideAux: boolean = false;\n _noLineTerminator: boolean = false;\n _noLineTerminatorAfterNode: t.Node | null = null;\n _printAuxAfterOnNextUserNode: boolean = false;\n _printedComments = new Set<t.Comment>();\n _lastCommentLine = 0;\n _innerCommentsState = INNER_COMMENTS_STATE.DISALLOWED;\n _flags = PRINTER_FLAGS.EMPTY;\n\n tokenMap: TokenMap | null = null;\n\n _boundGetRawIdentifier: ((node: t.Identifier) => string) | null = null;\n\n generate(ast: t.Node) {\n if (this.format.preserveFormat) {\n this.tokenMap = new TokenMap(ast, this._tokens!, this._originalCode!);\n this._boundGetRawIdentifier = _getRawIdentifier.bind(this);\n }\n this.print(ast);\n this._maybeAddAuxComment();\n\n return this._buf.get();\n }\n\n /**\n * Increment indent size.\n */\n\n indent(flags = this._flags): void {\n if (\n flags &\n (PRINTER_FLAGS.PRESERVE_FORMAT |\n PRINTER_FLAGS.COMPACT |\n PRINTER_FLAGS.CONCISE)\n ) {\n return;\n }\n\n this._indent += this._indentRepeat;\n }\n\n /**\n * Decrement indent size.\n */\n\n dedent(flags = this._flags): void {\n if (\n flags &\n (PRINTER_FLAGS.PRESERVE_FORMAT |\n PRINTER_FLAGS.COMPACT |\n PRINTER_FLAGS.CONCISE)\n ) {\n return;\n }\n\n this._indent -= this._indentRepeat;\n }\n\n /**\n * If the next token is on the same line, we must first print a semicolon.\n * This option is only used in `preserveFormat` node, for semicolons that\n * might have omitted due to them being absent in the original code (thanks\n * to ASI).\n *\n * We need both *NextToken and *NextNode because we only want to insert the\n * semicolon when the next token starts a new node, and not in cases like\n * foo} (where } is not starting a new node). So we first set *NextNode, and\n * then the print() method will move it to *NextToken.\n */\n _printSemicolonBeforeNextNode: number = -1;\n _printSemicolonBeforeNextToken: number = -1;\n\n /**\n * Add a semicolon to the buffer.\n */\n semicolon(force: boolean = false): void {\n const flags = this._flags;\n if (flags & PRINTER_FLAGS.AUX_COMMENTS) {\n this._maybeAddAuxComment();\n }\n if (flags & PRINTER_FLAGS.PRESERVE_FORMAT) {\n const node = this._currentNode!;\n if (node.start != null && node.end != null) {\n if (!this.tokenMap!.endMatches(node, \";\")) {\n // no semicolon\n this._printSemicolonBeforeNextNode = this._buf.getCurrentLine();\n return;\n }\n const indexes = this.tokenMap!.getIndexes(this._currentNode!)!;\n this._catchUpTo(this._tokens![indexes[indexes.length - 1]].loc.start);\n }\n }\n if (force) {\n this._appendChar(charCodes.semicolon);\n } else {\n this._queue(charCodes.semicolon);\n }\n this._noLineTerminator = false;\n }\n\n /**\n * Add a right brace to the buffer.\n */\n\n rightBrace(node: t.Node): void {\n if (this.format.minified) {\n this._buf.removeLastSemicolon();\n }\n this.sourceWithOffset(\"end\", node.loc, -1);\n this.token(\"}\");\n }\n\n rightParens(node: t.Node): void {\n this.sourceWithOffset(\"end\", node.loc, -1);\n this.token(\")\");\n }\n\n /**\n * Add a space to the buffer unless it is compact.\n */\n\n space(force: boolean = false): void {\n if (this._flags & (PRINTER_FLAGS.PRESERVE_FORMAT | PRINTER_FLAGS.COMPACT)) {\n return;\n }\n\n if (force) {\n this._space();\n } else {\n const lastCp = this.getLastChar(true);\n if (\n lastCp !== 0 &&\n lastCp !== charCodes.space &&\n lastCp !== charCodes.lineFeed\n ) {\n this._space();\n }\n }\n }\n\n /**\n * Writes a token that can't be safely parsed without taking whitespace into account.\n */\n\n word(str: string, noLineTerminatorAfter: boolean = false): void {\n this.tokenContext &= TokenContext.forInOrInitHeadAccumulatePassThroughMask;\n\n this._maybePrintInnerComments(str);\n\n const flags = this._flags;\n if (flags & PRINTER_FLAGS.AUX_COMMENTS) {\n this._maybeAddAuxComment();\n }\n\n if (flags & PRINTER_FLAGS.PRESERVE_FORMAT) this._catchUpToCurrentToken(str);\n\n const lastChar = this.getLastChar();\n\n if (\n lastChar === LAST_CHAR_KINDS.INTEGER ||\n lastChar === LAST_CHAR_KINDS.WORD ||\n // prevent concatenating words and creating // comment out of division and regex\n (lastChar === charCodes.slash && str.charCodeAt(0) === charCodes.slash)\n ) {\n this._space();\n }\n this._append(str, false);\n\n this.setLastChar(-3);\n this._noLineTerminator = noLineTerminatorAfter;\n }\n\n /**\n * Writes a number token so that we can validate if it is an integer.\n */\n\n number(str: string, number?: number): void {\n // const NON_DECIMAL_LITERAL = /^0[box]/;\n function isNonDecimalLiteral(str: string) {\n if (str.length > 2 && str.charCodeAt(0) === charCodes.digit0) {\n const secondChar = str.charCodeAt(1);\n return (\n secondChar === charCodes.lowercaseB ||\n secondChar === charCodes.lowercaseO ||\n secondChar === charCodes.lowercaseX\n );\n }\n return false;\n }\n this.word(str);\n\n // Integer tokens need special handling because they cannot have '.'s inserted immediately after them.\n if (\n Number.isInteger(number) &&\n !isNonDecimalLiteral(str) &&\n !SCIENTIFIC_NOTATION.test(str) &&\n !ZERO_DECIMAL_INTEGER.test(str) &&\n str.charCodeAt(str.length - 1) !== charCodes.dot\n ) {\n this.setLastChar(LAST_CHAR_KINDS.INTEGER);\n }\n }\n\n /**\n * Writes a simple token.\n *\n * @param {string} str The string to append.\n * @param {boolean} [maybeNewline=false] Wether `str` might potentially\n * contain a line terminator or not.\n * @param {number} [occurrenceCount=0] The occurrence count of this token in\n * the current node. This is used when printing in `preserveFormat` mode,\n * to know which token we should map to (for example, to disambiguate the\n * commas in an array literal).\n */\n token(\n str: string,\n maybeNewline = false,\n occurrenceCount = 0,\n mayNeedSpace: boolean = false,\n ): void {\n this.tokenContext &= TokenContext.forInOrInitHeadAccumulatePassThroughMask;\n\n this._maybePrintInnerComments(str, occurrenceCount);\n\n const flags = this._flags;\n\n if (flags & PRINTER_FLAGS.AUX_COMMENTS) {\n this._maybeAddAuxComment();\n }\n\n if (flags & PRINTER_FLAGS.PRESERVE_FORMAT) {\n this._catchUpToCurrentToken(str, occurrenceCount);\n }\n\n if (mayNeedSpace) {\n const strFirst = str.charCodeAt(0);\n if (\n // space is mandatory to avoid outputting <!--\n // http://javascript.spec.whatwg.org/#comment-syntax\n (((strFirst === charCodes.dash && str === \"--\") ||\n // Needs spaces to avoid changing a! == 0 to a!== 0\n strFirst === charCodes.equalsTo) &&\n this.getLastChar() === charCodes.exclamationMark) ||\n // Need spaces for operators of the same kind to avoid: `a+++b`\n (strFirst === charCodes.plusSign &&\n this.getLastChar() === charCodes.plusSign) ||\n (strFirst === charCodes.dash &&\n this.getLastChar() === charCodes.dash) ||\n // Needs spaces to avoid changing '34' to '34.', which would still be a valid number.\n (strFirst === charCodes.dot &&\n this.getLastChar() === LAST_CHAR_KINDS.INTEGER)\n ) {\n this._space();\n }\n }\n this._append(str, maybeNewline);\n this._noLineTerminator = false;\n }\n\n tokenChar(char: number, occurrenceCount = 0): void {\n this.tokenContext &= TokenContext.forInOrInitHeadAccumulatePassThroughMask;\n\n this._maybePrintInnerComments(char, occurrenceCount);\n\n const flags = this._flags;\n\n if (flags & PRINTER_FLAGS.AUX_COMMENTS) {\n this._maybeAddAuxComment();\n }\n\n if (flags & PRINTER_FLAGS.PRESERVE_FORMAT) {\n this._catchUpToCurrentToken(char, occurrenceCount);\n }\n\n if (\n // Need spaces for operators of the same kind to avoid: `a+++b`\n (char === charCodes.plusSign &&\n this.getLastChar() === charCodes.plusSign) ||\n (char === charCodes.dash && this.getLastChar() === charCodes.dash) ||\n // Needs spaces to avoid changing '34' to '34.', which would still be a valid number.\n (char === charCodes.dot && this.getLastChar() === LAST_CHAR_KINDS.INTEGER)\n ) {\n this._space();\n }\n this._appendChar(char);\n this._noLineTerminator = false;\n }\n\n /**\n * Add a newline (or many newlines), maintaining formatting.\n * This function checks the number of newlines in the queue and subtracts them.\n * It currently has some limitations.\n * @see {Buffer#getNewlineCount}\n */\n newline(i: number = 1, flags = this._flags): void {\n if (i <= 0) return;\n\n if (flags & (PRINTER_FLAGS.RETAIN_LINES | PRINTER_FLAGS.COMPACT)) {\n return;\n }\n\n if (flags & PRINTER_FLAGS.CONCISE) {\n this.space();\n return;\n }\n\n if (i > 2) i = 2; // Max two lines\n\n i -= this._buf.getNewlineCount();\n\n for (let j = 0; j < i; j++) {\n this._newline();\n }\n }\n\n endsWith(char: number): boolean {\n return this.getLastChar(true) === char;\n }\n\n getLastChar(checkQueue?: boolean): number {\n return this._buf.getLastChar(checkQueue);\n }\n\n setLastChar(char: number) {\n this._buf._last = char;\n }\n\n exactSource(loc: Loc | null | undefined, cb: () => void) {\n if (!loc) {\n cb();\n return;\n }\n\n this._catchUp(\"start\", loc);\n\n this._buf.exactSource(loc, cb);\n }\n\n source(prop: \"start\" | \"end\", loc: Loc | undefined): void {\n if (!loc) return;\n\n this._catchUp(prop, loc);\n\n this._buf.source(prop, loc);\n }\n\n sourceWithOffset(\n prop: \"start\" | \"end\",\n loc: Loc | null | undefined,\n columnOffset: number,\n ): void {\n if (!loc || this.format.preserveFormat) return;\n\n this._catchUp(prop, loc);\n\n this._buf.sourceWithOffset(prop, loc, columnOffset);\n }\n\n sourceIdentifierName(identifierName: string, pos?: Pos): void {\n if (!this._buf._canMarkIdName) return;\n\n const sourcePosition = this._buf._sourcePosition;\n sourcePosition.identifierNamePos = pos;\n sourcePosition.identifierName = identifierName;\n }\n\n _space(): void {\n this._queue(charCodes.space);\n }\n\n _newline(): void {\n // Drop trailing spaces when a newline is inserted.\n if (this._buf._queuedChar === charCodes.space) this._buf._queuedChar = 0;\n\n this._appendChar(charCodes.lineFeed, true);\n }\n\n _catchUpToCurrentToken(\n str: string | number,\n occurrenceCount: number = 0,\n ): void {\n // Assert: this.tokenMap\n\n const token = this.tokenMap!.findMatching(\n this._currentNode!,\n str,\n occurrenceCount,\n );\n if (token) this._catchUpTo(token.loc.start);\n\n if (\n this._printSemicolonBeforeNextToken !== -1 &&\n this._printSemicolonBeforeNextToken === this._buf.getCurrentLine()\n ) {\n this._appendChar(charCodes.semicolon, true);\n }\n this._printSemicolonBeforeNextToken = -1;\n this._printSemicolonBeforeNextNode = -1;\n }\n\n _append(str: string, maybeNewline: boolean): void {\n this._maybeIndent();\n\n this._buf.append(str, maybeNewline);\n }\n\n _appendChar(char: number, noIndent?: boolean): void {\n if (!noIndent) {\n this._maybeIndent();\n }\n\n this._buf.appendChar(char);\n }\n\n _queue(char: typeof charCodes.space | typeof charCodes.semicolon): void {\n this._buf.queue(char);\n\n this.setLastChar(-1);\n }\n\n _maybeIndent(): void {\n const indent = this._shouldIndent();\n if (indent > 0) {\n this._buf._appendChar(-1, indent, false);\n }\n }\n\n _shouldIndent() {\n // we've got a newline before us so prepend on the indentation\n return this.endsWith(charCodes.lineFeed) ? this._indent : 0;\n }\n\n catchUp(line: number) {\n if (!this.format.retainLines) return;\n\n // catch up to this nodes newline if we're behind\n const count = line - this._buf.getCurrentLine();\n\n for (let i = 0; i < count; i++) {\n this._newline();\n }\n }\n\n _catchUp(prop: \"start\" | \"end\", loc?: Loc) {\n const flags = this._flags;\n if ((flags & PRINTER_FLAGS.PRESERVE_FORMAT) === 0) {\n if (flags & PRINTER_FLAGS.RETAIN_LINES && loc?.[prop]) {\n this.catchUp(loc[prop].line);\n }\n return;\n }\n\n // catch up to this nodes newline if we're behind\n const pos = loc?.[prop];\n if (pos != null) this._catchUpTo(pos);\n }\n\n _catchUpTo({ line, column, index }: Pos) {\n const count = line - this._buf.getCurrentLine();\n if (count > 0 && this._noLineTerminator) {\n // We cannot inject new lines when _noLineTemrinator is set\n // to `true`, or we would generate invalid code.\n return;\n }\n\n for (let i = 0; i < count; i++) {\n this._newline();\n }\n\n const spacesCount =\n count > 0 ? column : column - this._buf.getCurrentColumn();\n if (spacesCount > 0) {\n const spaces = this._originalCode\n ? this._originalCode\n .slice(index - spacesCount, index)\n // https://tc39.es/ecma262/#sec-white-space\n .replace(/[^\\t\\v\\f\\uFEFF\\p{Space_Separator}]/gu, \" \")\n : \" \".repeat(spacesCount);\n this._buf.append(spaces, false, true);\n this._buf.setSourcePosition(line, column);\n this.setLastChar(charCodes.space);\n }\n }\n\n printTerminatorless(node: t.Node) {\n /**\n * Set some state that will be modified if a newline has been inserted before any\n * non-space characters.\n *\n * This is to prevent breaking semantics for terminatorless separator nodes. eg:\n *\n * return foo;\n *\n * returns `foo`. But if we do:\n *\n * return\n * foo;\n *\n * `undefined` will be returned and not `foo` due to the terminator.\n */\n this._noLineTerminator = true;\n this.print(node);\n }\n\n print(\n node: t.Node | null | undefined,\n noLineTerminatorAfter: boolean = false,\n resetTokenContext: boolean = false,\n // trailingCommentsLineOffset also used to check if called from printJoin\n // it will be ignored if `noLineTerminatorAfter||this._noLineTerminator`\n trailingCommentsLineOffset?: number,\n ) {\n if (!node) return;\n\n this._innerCommentsState = INNER_COMMENTS_STATE.DISALLOWED;\n\n const { type, loc, extra } = node;\n\n const flags = this._flags;\n let changedFlags = false;\n if (\n // @ts-expect-error document _compact AST properties\n node._compact\n ) {\n this._flags |= PRINTER_FLAGS.CONCISE;\n changedFlags = true;\n }\n\n const nodeInfo = generatorInfosMap.get(type);\n if (nodeInfo === undefined) {\n throw new ReferenceError(\n `unknown node of type ${JSON.stringify(\n type,\n )} with constructor ${JSON.stringify(node.constructor.name)}`,\n );\n }\n\n const [printMethod, nodeId, needsParens] = nodeInfo;\n\n const parent = this._currentNode;\n const parentId = this._currentTypeId;\n this._currentNode = node;\n this._currentTypeId = nodeId;\n\n if (flags & PRINTER_FLAGS.PRESERVE_FORMAT) {\n this._printSemicolonBeforeNextToken = this._printSemicolonBeforeNextNode;\n }\n\n let oldInAux;\n if (flags & PRINTER_FLAGS.AUX_COMMENTS) {\n oldInAux = this._insideAux;\n this._insideAux = loc == null;\n this._maybeAddAuxComment(this._insideAux && !oldInAux);\n }\n\n let oldTokenContext = 0;\n if (resetTokenContext) {\n oldTokenContext = this.tokenContext;\n if (oldTokenContext & TokenContext.forInOrInitHeadAccumulate) {\n this.tokenContext = 0;\n } else {\n oldTokenContext = 0;\n }\n }\n\n const parenthesized =\n extra != null && (extra.parenthesized as boolean | undefined);\n let shouldPrintParens =\n (parenthesized && flags & PRINTER_FLAGS.PRESERVE_FORMAT) ||\n (parenthesized &&\n flags & PRINTER_FLAGS.RETAIN_FUNCTION_PARENS &&\n nodeId === __node(\"FunctionExpression\")) ||\n (parent &&\n (parentNeedsParens(node, parent, parentId!) ||\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n (needsParens != null &&\n needsParens(\n node,\n parent,\n parentId!,\n this.tokenContext,\n flags & PRINTER_FLAGS.PRESERVE_FORMAT\n ? this._boundGetRawIdentifier!\n : undefined,\n ))));\n\n if (\n !shouldPrintParens &&\n parenthesized &&\n node.leadingComments?.length &&\n node.leadingComments[0].type === \"CommentBlock\"\n ) {\n switch (parentId) {\n case __node(\"ExpressionStatement\"):\n case __node(\"VariableDeclarator\"):\n case __node(\"AssignmentExpression\"):\n case __node(\"ReturnStatement\"):\n break;\n case __node(\"CallExpression\"):\n case __node(\"OptionalCallExpression\"):\n case __node(\"NewExpression\"):\n // @ts-expect-error checked by parentTypeId\n if (parent.callee !== node) break;\n // falls through\n default:\n shouldPrintParens = true;\n }\n }\n\n let indentParenthesized = false;\n if (\n !shouldPrintParens &&\n this._noLineTerminator &&\n (node.leadingComments?.some(commentIsNewline) ||\n (flags & PRINTER_FLAGS.RETAIN_LINES &&\n loc &&\n loc.start.line > this._buf.getCurrentLine()))\n ) {\n shouldPrintParens = true;\n indentParenthesized = true;\n }\n\n let oldNoLineTerminatorAfterNode;\n if (!shouldPrintParens) {\n noLineTerminatorAfter ||=\n !!parent &&\n this._noLineTerminatorAfterNode === parent &&\n isLastChild(parent, node);\n if (noLineTerminatorAfter) {\n if (node.trailingComments?.some(commentIsNewline)) {\n if (isExpression(node)) shouldPrintParens = true;\n } else {\n oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;\n this._noLineTerminatorAfterNode = node;\n }\n }\n }\n\n if (shouldPrintParens) {\n this.token(\"(\");\n if (indentParenthesized) this.indent();\n this._innerCommentsState = INNER_COMMENTS_STATE.DISALLOWED;\n if (!resetTokenContext) {\n oldTokenContext = this.tokenContext;\n }\n if (oldTokenContext & TokenContext.forInOrInitHeadAccumulate) {\n this.tokenContext = 0;\n }\n oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;\n this._noLineTerminatorAfterNode = null;\n }\n\n this._printLeadingComments(node, parent);\n\n this.exactSource(\n nodeId === __node(\"Program\") || nodeId === __node(\"File\") ? null : loc,\n printMethod.bind(this, node, parent),\n );\n\n if (shouldPrintParens) {\n this._printTrailingComments(node, parent);\n if (indentParenthesized) {\n this.dedent();\n this.newline();\n }\n this.token(\")\");\n this._noLineTerminator = noLineTerminatorAfter;\n } else if (noLineTerminatorAfter && !this._noLineTerminator) {\n this._noLineTerminator = true;\n this._printTrailingComments(node, parent);\n } else {\n this._printTrailingComments(node, parent, trailingCommentsLineOffset);\n }\n if (oldTokenContext) this.tokenContext = oldTokenContext;\n\n // end\n this._currentNode = parent;\n this._currentTypeId = parentId;\n if (changedFlags) {\n this._flags = flags;\n }\n if (flags & PRINTER_FLAGS.AUX_COMMENTS) {\n this._insideAux = oldInAux!;\n }\n\n if (oldNoLineTerminatorAfterNode != null) {\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n }\n\n this._innerCommentsState = INNER_COMMENTS_STATE.DISALLOWED;\n }\n\n _maybeAddAuxComment(enteredPositionlessNode?: boolean) {\n if (enteredPositionlessNode) this._printAuxBeforeComment();\n if (!this._insideAux) this._printAuxAfterComment();\n }\n\n _printAuxBeforeComment() {\n if (this._printAuxAfterOnNextUserNode) return;\n this._printAuxAfterOnNextUserNode = true;\n\n const comment = this.format.auxiliaryCommentBefore;\n if (comment) {\n this._printComment(\n {\n type: \"CommentBlock\",\n value: comment,\n },\n COMMENT_SKIP_NEWLINE.DEFAULT,\n );\n }\n }\n\n _printAuxAfterComment() {\n if (!this._printAuxAfterOnNextUserNode) return;\n this._printAuxAfterOnNextUserNode = false;\n\n const comment = this.format.auxiliaryCommentAfter;\n if (comment) {\n this._printComment(\n {\n type: \"CommentBlock\",\n value: comment,\n },\n COMMENT_SKIP_NEWLINE.DEFAULT,\n );\n }\n }\n\n getPossibleRaw(\n node:\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral\n | t.DirectiveLiteral\n | t.JSXText,\n ): string | undefined {\n const extra = node.extra;\n if (\n extra?.raw != null &&\n extra.rawValue != null &&\n node.value === extra.rawValue\n ) {\n // @ts-expect-error: The extra.raw of these AST node types must be a string\n return extra.raw;\n }\n }\n\n printJoin(\n nodes: t.Node[] | undefined | null,\n statement?: boolean,\n indent?: boolean,\n separator?: PrintJoinOptions[\"separator\"] | null,\n printTrailingSeparator?: boolean | null,\n resetTokenContext?: boolean,\n trailingCommentsLineOffset?: number,\n ) {\n if (!nodes?.length) return;\n\n const flags = this._flags;\n\n if (indent == null && flags & PRINTER_FLAGS.RETAIN_LINES) {\n const startLine = nodes[0].loc?.start.line;\n if (startLine != null && startLine !== this._buf.getCurrentLine()) {\n indent = true;\n }\n }\n\n if (indent) this.indent(flags);\n\n const len = nodes.length;\n for (let i = 0; i < len; i++) {\n const node = nodes[i];\n if (!node) continue;\n\n // don't add newlines at the beginning of the file\n if (statement && i === 0 && this._buf.hasContent()) {\n this.newline(1, flags);\n }\n\n this.print(\n node,\n false,\n resetTokenContext,\n trailingCommentsLineOffset || 0,\n );\n\n if (separator != null) {\n if (i < len - 1) separator.call(this, i, false);\n else if (printTrailingSeparator) separator.call(this, i, true);\n }\n\n if (statement) {\n if (i + 1 === len) {\n this.newline(1, flags);\n } else {\n const lastCommentLine = this._lastCommentLine;\n if (lastCommentLine > 0) {\n const offset =\n (nodes[i + 1].loc?.start.line || 0) - lastCommentLine;\n if (offset >= 0) {\n this.newline(offset || 1, flags);\n continue;\n }\n }\n\n this.newline(1, flags);\n }\n }\n }\n\n if (indent) this.dedent(flags);\n }\n\n printAndIndentOnComments(node: t.Node) {\n const indent = node.leadingComments && node.leadingComments.length > 0;\n if (indent) this.indent();\n this.print(node);\n if (indent) this.dedent();\n }\n\n printBlock(body: t.Statement) {\n if (body.type !== \"EmptyStatement\") {\n this.space();\n }\n\n this.print(body);\n }\n\n _printTrailingComments(\n node: t.Node,\n parent?: t.Node | null,\n lineOffset?: number,\n ) {\n const { innerComments, trailingComments } = node;\n // We print inner comments here, so that if for some reason they couldn't\n // be printed in earlier locations they are still printed *somewhere*,\n // even if at the end of the node.\n if (innerComments?.length) {\n this._printComments(\n COMMENT_TYPE.TRAILING,\n innerComments,\n node,\n parent,\n lineOffset,\n );\n }\n if (trailingComments?.length) {\n this._printComments(\n COMMENT_TYPE.TRAILING,\n trailingComments,\n node,\n parent,\n lineOffset,\n );\n } else {\n this._lastCommentLine = 0;\n }\n }\n\n _printLeadingComments(node: t.Node, parent: t.Node | null) {\n const comments = node.leadingComments;\n if (!comments?.length) return;\n this._printComments(COMMENT_TYPE.LEADING, comments, node, parent);\n }\n\n _maybePrintInnerComments(\n nextTokenStr: string | number,\n nextTokenOccurrenceCount?: number,\n ) {\n const state = this._innerCommentsState;\n switch (state & INNER_COMMENTS_STATE.MASK) {\n case INNER_COMMENTS_STATE.DISALLOWED:\n this._innerCommentsState =\n INNER_COMMENTS_STATE.ALLOWED | INNER_COMMENTS_STATE.WITH_INDENT;\n return;\n case INNER_COMMENTS_STATE.ALLOWED:\n this.printInnerComments(\n (state & INNER_COMMENTS_STATE.WITH_INDENT) > 0,\n this.tokenMap?.findMatching(\n this._currentNode!,\n nextTokenStr,\n nextTokenOccurrenceCount,\n ),\n );\n }\n }\n\n printInnerComments(indent = true, nextToken?: Token | null) {\n const node = this._currentNode!;\n const comments = node.innerComments;\n if (!comments?.length) {\n this._innerCommentsState = INNER_COMMENTS_STATE.PRINTED;\n return;\n }\n\n const hasSpace = this.endsWith(charCodes.space);\n if (indent) this.indent();\n\n switch (\n this._printComments(\n COMMENT_TYPE.INNER,\n comments,\n node,\n undefined,\n undefined,\n nextToken,\n )\n ) {\n case PRINT_COMMENTS_RESULT.PRINTED_ALL:\n this._innerCommentsState = INNER_COMMENTS_STATE.PRINTED;\n // falls through\n case PRINT_COMMENTS_RESULT.PRINTED_SOME:\n if (hasSpace) this.space();\n }\n\n if (indent) this.dedent();\n }\n\n noIndentInnerCommentsHere() {\n this._innerCommentsState &= ~INNER_COMMENTS_STATE.WITH_INDENT;\n }\n\n printSequence(\n nodes: t.Node[],\n indent?: boolean,\n resetTokenContext?: boolean,\n trailingCommentsLineOffset?: number,\n ) {\n this.printJoin(\n nodes,\n true,\n indent ?? false,\n undefined,\n undefined,\n resetTokenContext,\n trailingCommentsLineOffset,\n );\n }\n\n printList(\n items: t.Node[] | null | undefined,\n printTrailingSeparator?: boolean | null,\n statement?: boolean,\n indent?: boolean,\n separator?: PrintListOptions[\"separator\"],\n resetTokenContext?: boolean,\n ) {\n this.printJoin(\n items,\n statement,\n indent,\n separator ?? commaSeparator,\n printTrailingSeparator,\n resetTokenContext,\n );\n }\n\n shouldPrintTrailingComma(listEnd: string | number): boolean | null {\n if (!this.tokenMap) return null;\n\n const listEndIndex = this.tokenMap.findLastIndex(\n this._currentNode!,\n token =>\n this.tokenMap!.matchesOriginal(\n token,\n typeof listEnd === \"number\" ? String.fromCharCode(listEnd) : listEnd,\n ),\n );\n if (listEndIndex <= 0) return null;\n return this.tokenMap.matchesOriginal(this._tokens![listEndIndex - 1], \",\");\n }\n\n // Returns `PRINT_COMMENT_HINT.DEFER` if the comment cannot be printed in this position due to\n // line terminators, signaling that the print comments loop can stop and\n // resume printing comments at the next possible position. This happens when\n // printing inner comments, since if we have an inner comment with a multiline\n // there is at least one inner position where line terminators are allowed.\n _shouldPrintComment(\n comment: t.Comment,\n nextToken?: Token | null,\n ): PRINT_COMMENT_HINT {\n // Some plugins (such as flow-strip-types) use this to mark comments as removed using the AST-root 'comments' property,\n // where they can't manually mutate the AST node comment lists.\n if (comment.ignore) return PRINT_COMMENT_HINT.SKIP;\n\n if (this._printedComments.has(comment)) return PRINT_COMMENT_HINT.SKIP;\n\n if (\n this._noLineTerminator &&\n HAS_NEWLINE_OR_BlOCK_COMMENT_END.test(comment.value)\n ) {\n return PRINT_COMMENT_HINT.DEFER;\n }\n\n if (nextToken && this.tokenMap) {\n const commentTok = this.tokenMap.find(\n this._currentNode!,\n token => token.value === comment.value,\n );\n if (commentTok && commentTok.start > nextToken.start) {\n return PRINT_COMMENT_HINT.DEFER;\n }\n }\n\n this._printedComments.add(comment);\n\n if (!this.format.shouldPrintComment(comment.value)) {\n return PRINT_COMMENT_HINT.SKIP;\n }\n\n return PRINT_COMMENT_HINT.ALLOW;\n }\n\n _printComment(comment: t.Comment, skipNewLines: COMMENT_SKIP_NEWLINE) {\n const noLineTerminator = this._noLineTerminator;\n const isBlockComment = comment.type === \"CommentBlock\";\n\n // Add a newline before and after a block comment, unless explicitly\n // disallowed\n const printNewLines =\n isBlockComment &&\n skipNewLines !== COMMENT_SKIP_NEWLINE.ALL &&\n !noLineTerminator;\n\n if (\n printNewLines &&\n this._buf.hasContent() &&\n skipNewLines !== COMMENT_SKIP_NEWLINE.LEADING\n ) {\n this.newline(1);\n }\n\n switch (this.getLastChar(true)) {\n // Avoid converting a / operator into a line comment by appending /* to it\n case charCodes.slash:\n this._space();\n // falls through\n case charCodes.leftSquareBracket:\n case charCodes.leftCurlyBrace:\n case charCodes.leftParenthesis:\n break;\n\n default:\n this.space();\n }\n\n let val;\n if (isBlockComment) {\n val = `/*${comment.value}*/`;\n if (this.format.indent.adjustMultilineComment) {\n const offset = comment.loc?.start.column;\n if (offset) {\n const newlineRegex = new RegExp(\"\\\\n\\\\s{1,\" + offset + \"}\", \"g\");\n val = val.replace(newlineRegex, \"\\n\");\n }\n if (this._flags & PRINTER_FLAGS.CONCISE) {\n val = val.replace(/\\n(?!$)/g, `\\n`);\n } else {\n let indentSize = this.format.retainLines\n ? 0\n : this._buf.getCurrentColumn();\n\n if (this._shouldIndent() || this.format.retainLines) {\n indentSize += this._indent;\n }\n\n val = val.replace(/\\n(?!$)/g, `\\n${\" \".repeat(indentSize)}`);\n }\n }\n } else if (!noLineTerminator) {\n val = `//${comment.value}`;\n } else {\n // It was a single-line comment, so it's guaranteed to not\n // contain newlines and it can be safely printed as a block\n // comment.\n val = `/*${comment.value}*/`;\n }\n\n this.source(\"start\", comment.loc);\n this._append(val, isBlockComment);\n\n if (!isBlockComment && !noLineTerminator) {\n this._newline();\n }\n\n if (printNewLines && skipNewLines !== COMMENT_SKIP_NEWLINE.TRAILING) {\n this.newline(1);\n }\n }\n\n _printComments(\n type: COMMENT_TYPE,\n comments: t.Comment[],\n node: t.Node,\n parent?: t.Node | null,\n lineOffset: number = 0,\n nextToken?: Token | null,\n ): PRINT_COMMENTS_RESULT {\n const nodeLoc = node.loc;\n const len = comments.length;\n let hasLoc = !!nodeLoc;\n const nodeStartLine = hasLoc ? nodeLoc!.start.line : 0;\n const nodeEndLine = hasLoc ? nodeLoc!.end.line : 0;\n let lastLine = 0;\n let leadingCommentNewline = 0;\n\n const { _noLineTerminator, _flags } = this;\n\n for (let i = 0; i < len; i++) {\n const comment = comments[i];\n\n const shouldPrint = this._shouldPrintComment(comment, nextToken);\n if (shouldPrint === PRINT_COMMENT_HINT.DEFER) {\n return i === 0\n ? PRINT_COMMENTS_RESULT.PRINTED_NONE\n : PRINT_COMMENTS_RESULT.PRINTED_SOME;\n }\n if (hasLoc && comment.loc && shouldPrint === PRINT_COMMENT_HINT.ALLOW) {\n const commentStartLine = comment.loc.start.line;\n const commentEndLine = comment.loc.end.line;\n if (type === COMMENT_TYPE.LEADING) {\n let offset = 0;\n if (i === 0) {\n // Because currently we cannot handle blank lines before leading comments,\n // we always wrap before and after multi-line comments.\n if (\n this._buf.hasContent() &&\n (comment.type === \"CommentLine\" ||\n commentStartLine !== commentEndLine)\n ) {\n offset = leadingCommentNewline = 1;\n }\n } else {\n offset = commentStartLine - lastLine;\n }\n lastLine = commentEndLine;\n\n if (offset > 0 && !_noLineTerminator) {\n this.newline(offset, _flags);\n }\n this._printComment(comment, COMMENT_SKIP_NEWLINE.ALL);\n\n if (i + 1 === len) {\n const count = Math.max(\n nodeStartLine - lastLine,\n leadingCommentNewline,\n );\n if (count > 0 && !_noLineTerminator) {\n this.newline(count, _flags);\n }\n lastLine = nodeStartLine;\n }\n } else if (type === COMMENT_TYPE.INNER) {\n const offset =\n commentStartLine - (i === 0 ? nodeStartLine : lastLine);\n lastLine = commentEndLine;\n\n if (offset > 0 && !_noLineTerminator) {\n this.newline(offset, _flags);\n }\n this._printComment(comment, COMMENT_SKIP_NEWLINE.ALL);\n\n if (i + 1 === len) {\n const count = Math.min(1, nodeEndLine - lastLine);\n if (count > 0 && !_noLineTerminator) {\n this.newline(count, _flags);\n }\n lastLine = nodeEndLine;\n }\n } else {\n const offset =\n commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine);\n lastLine = commentEndLine;\n\n if (offset > 0 && !_noLineTerminator) {\n this.newline(offset, _flags);\n }\n this._printComment(comment, COMMENT_SKIP_NEWLINE.ALL);\n }\n } else {\n hasLoc = false;\n if (shouldPrint !== PRINT_COMMENT_HINT.ALLOW) {\n continue;\n }\n\n if (len === 1) {\n const singleLine = comment.loc\n ? comment.loc.start.line === comment.loc.end.line\n : !HAS_NEWLINE.test(comment.value);\n\n const shouldSkipNewline =\n singleLine &&\n !isStatement(node) &&\n !isClassBody(parent) &&\n !isTSInterfaceBody(parent) &&\n !isTSEnumMember(node);\n\n if (type === COMMENT_TYPE.LEADING) {\n this._printComment(\n comment,\n (shouldSkipNewline && node.type !== \"ObjectExpression\") ||\n (singleLine && isFunction(parent) && parent.body === node)\n ? COMMENT_SKIP_NEWLINE.ALL\n : COMMENT_SKIP_NEWLINE.DEFAULT,\n );\n } else if (shouldSkipNewline && type === COMMENT_TYPE.TRAILING) {\n this._printComment(comment, COMMENT_SKIP_NEWLINE.ALL);\n } else {\n this._printComment(comment, COMMENT_SKIP_NEWLINE.DEFAULT);\n }\n } else if (\n type === COMMENT_TYPE.INNER &&\n !(node.type === \"ObjectExpression\" && node.properties.length > 1) &&\n node.type !== \"ClassBody\" &&\n node.type !== \"TSInterfaceBody\"\n ) {\n // class X {\n // /*:: a: number*/\n // /*:: b: ?string*/\n // }\n\n this._printComment(\n comment,\n i === 0\n ? COMMENT_SKIP_NEWLINE.LEADING\n : i === len - 1\n ? COMMENT_SKIP_NEWLINE.TRAILING\n : COMMENT_SKIP_NEWLINE.DEFAULT,\n );\n } else {\n this._printComment(comment, COMMENT_SKIP_NEWLINE.DEFAULT);\n }\n }\n }\n\n if (type === COMMENT_TYPE.TRAILING && hasLoc && lastLine) {\n this._lastCommentLine = lastLine;\n }\n return PRINT_COMMENTS_RESULT.PRINTED_ALL;\n }\n}\n\nexport default Printer;\n\nfunction commaSeparator(this: Printer, occurrenceCount: number, last: boolean) {\n this.tokenChar(charCodes.comma, occurrenceCount);\n if (!last) this.space();\n}\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,EAAA,GAAAH,OAAA;AAUA,IAAAI,SAAA,GAAAJ,OAAA;AAqBA,IAAAK,OAAA,GAAAL,OAAA;AAA0D;EA9BxDM,YAAY;EACZC,UAAU;EACVC,WAAW;EACXC,WAAW;EACXC,iBAAiB;EACjBC;AAAc,IAAAR,EAAA;AAehB,MAAMS,mBAAmB,GAAG,IAAI;AAChC,MAAMC,oBAAoB,GAAG,OAAO;AACpC,MAAMC,WAAW,GAAG,oBAAoB;AACxC,MAAMC,gCAAgC,GAAG,yBAAyB;AAElE,SAASC,gBAAgBA,CAACC,CAAY,EAAE;EACtC,OAAOA,CAAC,CAACC,IAAI,KAAK,aAAa,IAAIJ,WAAW,CAACK,IAAI,CAACF,CAAC,CAACG,KAAK,CAAC;AAC9D;AAiHA,MAAMC,OAAO,CAAC;EACZC,WAAWA,CACTC,MAAc,EACdC,GAAqB,EACrBC,MAAsB,GAAG,IAAI,EAC7BC,YAA2B,GAAG,IAAI,EAClC;I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IAAI,CAAChK,SAAS,KAAkBH,eAAe,CAAC;EAChD,IAAI,CAACmK,IAAI,EAAE,IAAI,CAACvL,KAAK,CAAC,CAAC;AACzB","ignoreList":[]}
|
node_modules/@babel/generator/lib/source-map.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = void 0;
|
| 7 |
+
var _genMapping = require("@jridgewell/gen-mapping");
|
| 8 |
+
var _traceMapping = require("@jridgewell/trace-mapping");
|
| 9 |
+
class SourceMap {
|
| 10 |
+
constructor(opts, code) {
|
| 11 |
+
var _opts$sourceFileName;
|
| 12 |
+
this._map = void 0;
|
| 13 |
+
this._rawMappings = void 0;
|
| 14 |
+
this._sourceFileName = void 0;
|
| 15 |
+
this._lastGenLine = 0;
|
| 16 |
+
this._lastSourceLine = 0;
|
| 17 |
+
this._lastSourceColumn = 0;
|
| 18 |
+
this._inputMap = null;
|
| 19 |
+
const map = this._map = new _genMapping.GenMapping({
|
| 20 |
+
sourceRoot: opts.sourceRoot
|
| 21 |
+
});
|
| 22 |
+
this._sourceFileName = (_opts$sourceFileName = opts.sourceFileName) == null ? void 0 : _opts$sourceFileName.replace(/\\/g, "/");
|
| 23 |
+
this._rawMappings = undefined;
|
| 24 |
+
if (opts.inputSourceMap) {
|
| 25 |
+
this._inputMap = new _traceMapping.TraceMap(opts.inputSourceMap);
|
| 26 |
+
const resolvedSources = this._inputMap.resolvedSources;
|
| 27 |
+
if (resolvedSources.length) {
|
| 28 |
+
for (let i = 0; i < resolvedSources.length; i++) {
|
| 29 |
+
var _this$_inputMap$sourc;
|
| 30 |
+
(0, _genMapping.setSourceContent)(map, resolvedSources[i], (_this$_inputMap$sourc = this._inputMap.sourcesContent) == null ? void 0 : _this$_inputMap$sourc[i]);
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
if (typeof code === "string" && !opts.inputSourceMap) {
|
| 35 |
+
(0, _genMapping.setSourceContent)(map, this._sourceFileName, code);
|
| 36 |
+
} else if (typeof code === "object") {
|
| 37 |
+
for (const sourceFileName of Object.keys(code)) {
|
| 38 |
+
(0, _genMapping.setSourceContent)(map, sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
|
| 39 |
+
}
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
get() {
|
| 43 |
+
return (0, _genMapping.toEncodedMap)(this._map);
|
| 44 |
+
}
|
| 45 |
+
getDecoded() {
|
| 46 |
+
return (0, _genMapping.toDecodedMap)(this._map);
|
| 47 |
+
}
|
| 48 |
+
getRawMappings() {
|
| 49 |
+
return this._rawMappings || (this._rawMappings = (0, _genMapping.allMappings)(this._map));
|
| 50 |
+
}
|
| 51 |
+
mark(generated, line, column, identifierName, identifierNamePos, filename) {
|
| 52 |
+
var _originalMapping;
|
| 53 |
+
this._rawMappings = undefined;
|
| 54 |
+
let originalMapping;
|
| 55 |
+
if (line != null) {
|
| 56 |
+
if (this._inputMap) {
|
| 57 |
+
originalMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, {
|
| 58 |
+
line,
|
| 59 |
+
column: column
|
| 60 |
+
});
|
| 61 |
+
if (originalMapping.name && (identifierNamePos || identifierName != null && originalMapping.column === column)) {
|
| 62 |
+
identifierName = originalMapping.name;
|
| 63 |
+
} else if (identifierNamePos) {
|
| 64 |
+
const originalIdentifierMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, identifierNamePos);
|
| 65 |
+
if (originalIdentifierMapping.name) {
|
| 66 |
+
identifierName = originalIdentifierMapping.name;
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
} else {
|
| 70 |
+
originalMapping = {
|
| 71 |
+
name: null,
|
| 72 |
+
source: (filename == null ? void 0 : filename.replace(/\\/g, "/")) || this._sourceFileName,
|
| 73 |
+
line: line,
|
| 74 |
+
column: column
|
| 75 |
+
};
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
(0, _genMapping.maybeAddMapping)(this._map, {
|
| 79 |
+
name: identifierName,
|
| 80 |
+
generated,
|
| 81 |
+
source: (_originalMapping = originalMapping) == null ? void 0 : _originalMapping.source,
|
| 82 |
+
original: originalMapping
|
| 83 |
+
});
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
exports.default = SourceMap;
|
| 87 |
+
|
| 88 |
+
//# sourceMappingURL=source-map.js.map
|
node_modules/@babel/generator/lib/source-map.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_genMapping","require","_traceMapping","SourceMap","constructor","opts","code","_opts$sourceFileName","_map","_rawMappings","_sourceFileName","_lastGenLine","_lastSourceLine","_lastSourceColumn","_inputMap","map","GenMapping","sourceRoot","sourceFileName","replace","undefined","inputSourceMap","TraceMap","resolvedSources","length","i","_this$_inputMap$sourc","setSourceContent","sourcesContent","Object","keys","get","toEncodedMap","getDecoded","toDecodedMap","getRawMappings","allMappings","mark","generated","line","column","identifierName","identifierNamePos","filename","_originalMapping","originalMapping","originalPositionFor","name","originalIdentifierMapping","source","maybeAddMapping","original","exports","default"],"sources":["../src/source-map.ts"],"sourcesContent":["import {\n GenMapping,\n maybeAddMapping,\n setSourceContent,\n allMappings,\n toEncodedMap,\n toDecodedMap,\n} from \"@jridgewell/gen-mapping\";\n\nimport type {\n EncodedSourceMap,\n DecodedSourceMap,\n Mapping,\n} from \"@jridgewell/gen-mapping\";\n\nimport type {\n InvalidOriginalMapping,\n OriginalMapping,\n SourceMapInput,\n} from \"@jridgewell/trace-mapping\";\nimport { originalPositionFor, TraceMap } from \"@jridgewell/trace-mapping\";\n\n/**\n * Build a sourcemap.\n */\n\nexport default class SourceMap {\n private _map: GenMapping;\n private _rawMappings: Mapping[] | undefined;\n private _sourceFileName: string | undefined;\n\n // Any real line is > 0, so init to 0 is fine.\n private _lastGenLine = 0;\n private _lastSourceLine = 0;\n\n // Source columns can be 0, but we only check in unison with sourceLine, which\n // inits to an impossible value. So init to 0 is fine.\n private _lastSourceColumn = 0;\n\n public _inputMap: TraceMap | null = null;\n\n constructor(\n opts: {\n sourceFileName?: string;\n sourceRoot?: string;\n inputSourceMap?: SourceMapInput;\n },\n code: string | Record<string, string> | null | undefined,\n ) {\n const map = (this._map = new GenMapping({ sourceRoot: opts.sourceRoot }));\n this._sourceFileName = opts.sourceFileName?.replace(/\\\\/g, \"/\");\n this._rawMappings = undefined;\n\n if (opts.inputSourceMap) {\n this._inputMap = new TraceMap(opts.inputSourceMap);\n const resolvedSources = this._inputMap.resolvedSources;\n if (resolvedSources.length) {\n for (let i = 0; i < resolvedSources.length; i++) {\n setSourceContent(\n map,\n resolvedSources[i],\n // @ts-expect-error FIXME: this._inputMap.sourcesContent?.[i] may be undefined, which is not acceptable by setSourceContent\n this._inputMap.sourcesContent?.[i],\n );\n }\n }\n }\n\n if (typeof code === \"string\" && !opts.inputSourceMap) {\n setSourceContent(map, this._sourceFileName!, code);\n } else if (typeof code === \"object\") {\n for (const sourceFileName of Object.keys(code!)) {\n setSourceContent(\n map,\n sourceFileName.replace(/\\\\/g, \"/\"),\n code![sourceFileName],\n );\n }\n }\n }\n\n /**\n * Get the sourcemap.\n */\n get(): EncodedSourceMap {\n return toEncodedMap(this._map);\n }\n\n getDecoded(): DecodedSourceMap {\n return toDecodedMap(this._map);\n }\n\n getRawMappings(): Mapping[] {\n return (this._rawMappings ||= allMappings(this._map));\n }\n\n /**\n * Mark the current generated position with a source position. May also be passed null line/column\n * values to insert a mapping to nothing.\n */\n\n mark(\n generated: { line: number; column: number },\n line?: number,\n column?: number,\n identifierName?: string | null,\n identifierNamePos?: { line: number; column: number },\n filename?: string | null,\n ) {\n this._rawMappings = undefined;\n\n let originalMapping: OriginalMapping | InvalidOriginalMapping | undefined;\n\n if (line != null) {\n if (this._inputMap) {\n // This is the lookup for this mark\n originalMapping = originalPositionFor(this._inputMap, {\n line,\n column: column!,\n });\n\n // Prefer the original name from the input sourcemap when marking an\n // identifier token at the same column, or when marking a related\n // token such as `(` via identifierNamePos.\n if (\n originalMapping.name &&\n (identifierNamePos ||\n (identifierName != null && originalMapping.column === column))\n ) {\n identifierName = originalMapping.name;\n } else if (identifierNamePos) {\n // Maybe we're marking a `(` and the input map already had a name attached there,\n // or we're marking a `(` and the sourcemap spanned a `foo(`,\n // or we're marking an identifier, etc.\n // We're trying to mark a `(` (as that's the only thing that provides\n // an identifierNamePos currently), and we the AST had an identifier attached.\n // Lookup it's original name.\n const originalIdentifierMapping = originalPositionFor(\n this._inputMap,\n identifierNamePos,\n );\n if (originalIdentifierMapping.name) {\n identifierName = originalIdentifierMapping.name;\n }\n }\n } else {\n originalMapping = {\n name: null,\n source: filename?.replace(/\\\\/g, \"/\") || this._sourceFileName!,\n line: line,\n column: column!,\n };\n }\n }\n\n // @ts-expect-error FIXME: original cannot be InvalidOriginalMapping\n maybeAddMapping(this._map, {\n name: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S
|
| 11 |
+
} = _t;
|
| 12 |
+
class TokenMap {
|
| 13 |
+
constructor(ast, tokens, source) {
|
| 14 |
+
this._tokens = void 0;
|
| 15 |
+
this._source = void 0;
|
| 16 |
+
this._nodesToTokenIndexes = new Map();
|
| 17 |
+
this._nodesOccurrencesCountCache = new Map();
|
| 18 |
+
this._tokensCache = new Map();
|
| 19 |
+
this._tokens = tokens;
|
| 20 |
+
this._source = source;
|
| 21 |
+
traverseFast(ast, node => {
|
| 22 |
+
const indexes = this._getTokensIndexesOfNode(node);
|
| 23 |
+
if (indexes.length > 0) this._nodesToTokenIndexes.set(node, indexes);
|
| 24 |
+
});
|
| 25 |
+
this._tokensCache.clear();
|
| 26 |
+
}
|
| 27 |
+
has(node) {
|
| 28 |
+
return this._nodesToTokenIndexes.has(node);
|
| 29 |
+
}
|
| 30 |
+
getIndexes(node) {
|
| 31 |
+
return this._nodesToTokenIndexes.get(node);
|
| 32 |
+
}
|
| 33 |
+
find(node, condition) {
|
| 34 |
+
const indexes = this._nodesToTokenIndexes.get(node);
|
| 35 |
+
if (indexes) {
|
| 36 |
+
for (let k = 0; k < indexes.length; k++) {
|
| 37 |
+
const index = indexes[k];
|
| 38 |
+
const tok = this._tokens[index];
|
| 39 |
+
if (condition(tok, index)) return tok;
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
return null;
|
| 43 |
+
}
|
| 44 |
+
findLastIndex(node, condition) {
|
| 45 |
+
const indexes = this._nodesToTokenIndexes.get(node);
|
| 46 |
+
if (indexes) {
|
| 47 |
+
for (let k = indexes.length - 1; k >= 0; k--) {
|
| 48 |
+
const index = indexes[k];
|
| 49 |
+
const tok = this._tokens[index];
|
| 50 |
+
if (condition(tok, index)) return index;
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
return -1;
|
| 54 |
+
}
|
| 55 |
+
findMatching(node, test, occurrenceCount = 0) {
|
| 56 |
+
const indexes = this._nodesToTokenIndexes.get(node);
|
| 57 |
+
if (indexes) {
|
| 58 |
+
if (typeof test === "number") {
|
| 59 |
+
test = String.fromCharCode(test);
|
| 60 |
+
}
|
| 61 |
+
let i = 0;
|
| 62 |
+
const count = occurrenceCount;
|
| 63 |
+
if (count > 1) {
|
| 64 |
+
const cache = this._nodesOccurrencesCountCache.get(node);
|
| 65 |
+
if ((cache == null ? void 0 : cache.test) === test && cache.count < count) {
|
| 66 |
+
i = cache.i + 1;
|
| 67 |
+
occurrenceCount -= cache.count + 1;
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
for (; i < indexes.length; i++) {
|
| 71 |
+
const tok = this._tokens[indexes[i]];
|
| 72 |
+
if (this.matchesOriginal(tok, test)) {
|
| 73 |
+
if (occurrenceCount === 0) {
|
| 74 |
+
if (count > 0) {
|
| 75 |
+
this._nodesOccurrencesCountCache.set(node, {
|
| 76 |
+
test,
|
| 77 |
+
count,
|
| 78 |
+
i
|
| 79 |
+
});
|
| 80 |
+
}
|
| 81 |
+
return tok;
|
| 82 |
+
}
|
| 83 |
+
occurrenceCount--;
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
return null;
|
| 88 |
+
}
|
| 89 |
+
matchesOriginal(token, test) {
|
| 90 |
+
if (token.end - token.start !== test.length) return false;
|
| 91 |
+
if (token.value != null) return token.value === test;
|
| 92 |
+
return this._source.startsWith(test, token.start);
|
| 93 |
+
}
|
| 94 |
+
startMatches(node, test) {
|
| 95 |
+
const indexes = this._nodesToTokenIndexes.get(node);
|
| 96 |
+
if (!indexes) return false;
|
| 97 |
+
const tok = this._tokens[indexes[0]];
|
| 98 |
+
if (tok.start !== node.start) return false;
|
| 99 |
+
return this.matchesOriginal(tok, test);
|
| 100 |
+
}
|
| 101 |
+
endMatches(node, test) {
|
| 102 |
+
const indexes = this._nodesToTokenIndexes.get(node);
|
| 103 |
+
if (!indexes) return false;
|
| 104 |
+
const tok = this._tokens[indexes[indexes.length - 1]];
|
| 105 |
+
if (tok.end !== node.end) return false;
|
| 106 |
+
return this.matchesOriginal(tok, test);
|
| 107 |
+
}
|
| 108 |
+
_getTokensIndexesOfNode(node) {
|
| 109 |
+
var _node$declaration;
|
| 110 |
+
if (node.start == null || node.end == null) return [];
|
| 111 |
+
const {
|
| 112 |
+
first,
|
| 113 |
+
last
|
| 114 |
+
} = this._findTokensOfNode(node, 0, this._tokens.length - 1);
|
| 115 |
+
let low = first;
|
| 116 |
+
const children = childrenIterator(node);
|
| 117 |
+
if ((node.type === "ExportNamedDeclaration" || node.type === "ExportDefaultDeclaration") && ((_node$declaration = node.declaration) == null ? void 0 : _node$declaration.type) === "ClassDeclaration") {
|
| 118 |
+
children.next();
|
| 119 |
+
}
|
| 120 |
+
const indexes = [];
|
| 121 |
+
for (const child of children) {
|
| 122 |
+
if (child == null) continue;
|
| 123 |
+
if (child.start == null || child.end == null) continue;
|
| 124 |
+
const childTok = this._findTokensOfNode(child, low, last);
|
| 125 |
+
const high = childTok.first;
|
| 126 |
+
for (let k = low; k < high; k++) indexes.push(k);
|
| 127 |
+
low = childTok.last + 1;
|
| 128 |
+
}
|
| 129 |
+
for (let k = low; k <= last; k++) indexes.push(k);
|
| 130 |
+
return indexes;
|
| 131 |
+
}
|
| 132 |
+
_findTokensOfNode(node, low, high) {
|
| 133 |
+
const cached = this._tokensCache.get(node);
|
| 134 |
+
if (cached) return cached;
|
| 135 |
+
const first = this._findFirstTokenOfNode(node.start, low, high);
|
| 136 |
+
const last = this._findLastTokenOfNode(node.end, first, high);
|
| 137 |
+
this._tokensCache.set(node, {
|
| 138 |
+
first,
|
| 139 |
+
last
|
| 140 |
+
});
|
| 141 |
+
return {
|
| 142 |
+
first,
|
| 143 |
+
last
|
| 144 |
+
};
|
| 145 |
+
}
|
| 146 |
+
_findFirstTokenOfNode(start, low, high) {
|
| 147 |
+
while (low <= high) {
|
| 148 |
+
const mid = high + low >> 1;
|
| 149 |
+
if (start < this._tokens[mid].start) {
|
| 150 |
+
high = mid - 1;
|
| 151 |
+
} else if (start > this._tokens[mid].start) {
|
| 152 |
+
low = mid + 1;
|
| 153 |
+
} else {
|
| 154 |
+
return mid;
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
return low;
|
| 158 |
+
}
|
| 159 |
+
_findLastTokenOfNode(end, low, high) {
|
| 160 |
+
while (low <= high) {
|
| 161 |
+
const mid = high + low >> 1;
|
| 162 |
+
if (end < this._tokens[mid].end) {
|
| 163 |
+
high = mid - 1;
|
| 164 |
+
} else if (end > this._tokens[mid].end) {
|
| 165 |
+
low = mid + 1;
|
| 166 |
+
} else {
|
| 167 |
+
return mid;
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
return high;
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
exports.TokenMap = TokenMap;
|
| 174 |
+
function* childrenIterator(node) {
|
| 175 |
+
if (node.type === "TemplateLiteral") {
|
| 176 |
+
yield node.quasis[0];
|
| 177 |
+
for (let i = 1; i < node.quasis.length; i++) {
|
| 178 |
+
yield node.expressions[i - 1];
|
| 179 |
+
yield node.quasis[i];
|
| 180 |
+
}
|
| 181 |
+
return;
|
| 182 |
+
}
|
| 183 |
+
const keys = VISITOR_KEYS[node.type];
|
| 184 |
+
for (const key of keys) {
|
| 185 |
+
const child = node[key];
|
| 186 |
+
if (!child) continue;
|
| 187 |
+
if (Array.isArray(child)) {
|
| 188 |
+
yield* child;
|
| 189 |
+
} else {
|
| 190 |
+
yield child;
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
//# sourceMappingURL=token-map.js.map
|
node_modules/@babel/generator/lib/token-map.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","traverseFast","VISITOR_KEYS","TokenMap","constructor","ast","tokens","source","_tokens","_source","_nodesToTokenIndexes","Map","_nodesOccurrencesCountCache","_tokensCache","node","indexes","_getTokensIndexesOfNode","length","set","clear","has","getIndexes","get","find","condition","k","index","tok","findLastIndex","findMatching","test","occurrenceCount","String","fromCharCode","i","count","cache","matchesOriginal","token","end","start","value","startsWith","startMatches","endMatches","_node$declaration","first","last","_findTokensOfNode","low","children","childrenIterator","type","declaration","next","child","childTok","high","push","cached","_findFirstTokenOfNode","_findLastTokenOfNode","mid","exports","quasis","expressions","keys","key","Array","isArray"],"sources":["../src/token-map.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\nimport type { Token } from \"@babel/parser\";\n\nimport { traverseFast, VISITOR_KEYS } from \"@babel/types\";\n\nexport class TokenMap {\n _tokens: Token[];\n _source: string;\n\n _nodesToTokenIndexes = new Map<t.Node, number[]>();\n _nodesOccurrencesCountCache = new Map<\n t.Node,\n { test: string; count: number; i: number }\n >();\n\n _tokensCache = new Map<t.Node, { first: number; last: number }>();\n\n constructor(ast: t.Node, tokens: Token[], source: string) {\n this._tokens = tokens;\n this._source = source;\n\n traverseFast(ast, node => {\n const indexes = this._getTokensIndexesOfNode(node);\n if (indexes.length > 0) this._nodesToTokenIndexes.set(node, indexes);\n });\n\n this._tokensCache.clear();\n }\n\n has(node: t.Node): boolean {\n return this._nodesToTokenIndexes.has(node);\n }\n\n getIndexes(node: t.Node): readonly number[] | undefined {\n return this._nodesToTokenIndexes.get(node);\n }\n\n find(\n node: t.Node,\n condition: (token: Token, index: number) => boolean,\n ): Token | null {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (indexes) {\n for (let k = 0; k < indexes.length; k++) {\n const index = indexes[k];\n const tok = this._tokens[index];\n if (condition(tok, index)) return tok;\n }\n }\n return null;\n }\n\n findLastIndex(\n node: t.Node,\n condition: (token: Token, index: number) => boolean,\n ): number {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (indexes) {\n for (let k = indexes.length - 1; k >= 0; k--) {\n const index = indexes[k];\n const tok = this._tokens[index];\n if (condition(tok, index)) return index;\n }\n }\n return -1;\n }\n\n findMatching(\n node: t.Node,\n test: string | number,\n occurrenceCount: number = 0,\n ): Token | null {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (indexes) {\n if (typeof test === \"number\") {\n test = String.fromCharCode(test);\n }\n let i = 0;\n const count = occurrenceCount;\n\n // To avoid O(n^2) search when printing lists (such as arrays), we\n // cache the last index of a given token for a given occurrence count.\n // If then we are asked to find the next occurrence of the same token,\n // we start from the index of the previously found token.\n // This cache only kicks in after 2 tokens of the same type, to avoid\n // overhead in the simple case of having unique tokens per node.\n if (count > 1) {\n const cache = this._nodesOccurrencesCountCache.get(node);\n if (cache?.test === test && cache.count < count) {\n i = cache.i + 1;\n occurrenceCount -= cache.count + 1;\n }\n }\n\n for (; i < indexes.length; i++) {\n const tok = this._tokens[indexes[i]];\n if (this.matchesOriginal(tok, test)) {\n if (occurrenceCount === 0) {\n if (count > 0) {\n this._nodesOccurrencesCountCache.set(node, { test, count, i });\n }\n return tok;\n }\n occurrenceCount--;\n }\n }\n }\n return null;\n }\n\n matchesOriginal(token: Token, test: string) {\n if (token.end - token.start !== test.length) return false;\n if (token.value != null) return token.value === test;\n return this._source.startsWith(test, token.start);\n }\n\n startMatches(node: t.Node, test: string): boolean {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (!indexes) return false;\n const tok = this._tokens[indexes[0]];\n if (tok.start !== node.start) return false;\n return this.matchesOriginal(tok, test);\n }\n\n endMatches(node: t.Node, test: string): boolean {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (!indexes) return false;\n const tok = this._tokens[indexes[indexes.length - 1]];\n if (tok.end !== node.end) return false;\n return this.matchesOriginal(tok, test);\n }\n\n _getTokensIndexesOfNode(node: t.Node): number[] {\n if (node.start == null || node.end == null) return [];\n\n const { first, last } = this._findTokensOfNode(\n node,\n 0,\n this._tokens.length - 1,\n );\n\n let low = first;\n\n const children = childrenIterator(node);\n\n if (\n (node.type === \"ExportNamedDeclaration\" ||\n node.type === \"ExportDefaultDeclaration\") &&\n node.declaration?.type === \"ClassDeclaration\"\n ) {\n // Exported class declarations can be not properly nested inside\n // the export declaration that contains them. For example, in\n // `@dec export class Foo {}` the `export` is covered by the\n // ClassDeclaration range. Skip the class declaration from the list\n // of children to skip, so that when looking for `export` we also\n // traverse its tokens.\n children.next();\n }\n\n const indexes = [];\n\n for (const child of children) {\n if (child == null) continue;\n if (child.start == null || child.end == null) continue;\n\n const childTok = this._findTokensOfNode(child, low, last);\n\n const high = childTok.first;\n for (let k = low; k < high; k++) indexes.push(k);\n\n low = childTok.last + 1;\n }\n\n for (let k = low; k <= last; k++) indexes.push(k);\n\n return indexes;\n }\n\n _findTokensOfNode(node: t.Node, low: number, high: number) {\n const cached = this._tokensCache.get(node);\n if (cached) return cached;\n\n const first = this._findFirstTokenOfNode(node.start!, low, high);\n const last = this._findLastTokenOfNode(node.end!, first, high);\n\n this._tokensCache.set(node, { first, last });\n return { first, last };\n }\n\n _findFirstTokenOfNode(start: number, low: number, high: number): number {\n while (low <= high) {\n const mid = (high + low) >> 1;\n if (start < this._tokens[mid].start) {\n high = mid - 1;\n } else if (start > this._tokens[mid].start) {\n low = mid + 1;\n } else {\n return mid;\n }\n }\n return low;\n }\n\n _findLastTokenOfNode(end: number, low: number, high: number): number {\n while (low <= high) {\n const mid = (high + low) >> 1;\n if (end < this._tokens[mid].end) {\n high = mid - 1;\n } else if (end > this._tokens[mid].end) {\n low = mid + 1;\n } else {\n return mid;\n }\n }\n return high;\n }\n}\n\nfunction* childrenIterator(node: t.Node) {\n // We need special handling to iterate TemplateLiteral\n // children in order, since the two lists are interleaved.\n if (node.type === \"TemplateLiteral\") {\n yield node.quasis[0];\n for (let i = 1; i < node.quasis.length; i++) {\n yield node.expressions[i - 1];\n yield node.quasis[i];\n }\n return;\n }\n\n const keys = VISITOR_KEYS[node.type];\n for (const key of keys) {\n const child = (node as any)[key];\n if (!child) continue;\n if (Array.isArray(child)) {\n yield* child;\n } else {\n yield child;\n }\n }\n}\n"],"mappings":";;;;;;AAGA,IAAAA,EAAA,GAAAC,OAAA;AAA0D;EAAjDC,YAAY;EAAEC;AAAY,IAAAH,EAAA;AA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MpB,IAAI,CAACkD,MAAM,CAAC9B,CAAC,CAAC;IACtB;IACA;EACF;EAEA,MAAMgC,IAAI,GAAGhE,YAAY,CAACY,IAAI,CAACsC,IAAI,CAAC;EACpC,KAAK,MAAMe,GAAG,IAAID,IAAI,EAAE;IACtB,MAAMX,KAAK,GAAIzC,IAAI,CAASqD,GAAG,CAAC;IAChC,IAAI,CAACZ,KAAK,EAAE;IACZ,IAAIa,KAAK,CAACC,OAAO,CAACd,KAAK,CAAC,EAAE;MACxB,OAAOA,KAAK;IACd,CAAC,MAAM;MACL,MAAMA,KAAK;IACb;EACF;AACF","ignoreList":[]}
|
node_modules/@babel/generator/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/generator",
|
| 3 |
+
"version": "7.29.8",
|
| 4 |
+
"description": "Turns an AST into code.",
|
| 5 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 6 |
+
"license": "MIT",
|
| 7 |
+
"publishConfig": {
|
| 8 |
+
"access": "public"
|
| 9 |
+
},
|
| 10 |
+
"repository": {
|
| 11 |
+
"type": "git",
|
| 12 |
+
"url": "https://github.com/babel/babel.git",
|
| 13 |
+
"directory": "packages/babel-generator"
|
| 14 |
+
},
|
| 15 |
+
"homepage": "https://babel.dev/docs/en/next/babel-generator",
|
| 16 |
+
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen",
|
| 17 |
+
"main": "./lib/index.js",
|
| 18 |
+
"files": [
|
| 19 |
+
"lib"
|
| 20 |
+
],
|
| 21 |
+
"dependencies": {
|
| 22 |
+
"@babel/parser": "^7.29.8",
|
| 23 |
+
"@babel/types": "^7.29.8",
|
| 24 |
+
"@jridgewell/gen-mapping": "^0.3.12",
|
| 25 |
+
"@jridgewell/trace-mapping": "^0.3.28",
|
| 26 |
+
"jsesc": "^3.0.2"
|
| 27 |
+
},
|
| 28 |
+
"devDependencies": {
|
| 29 |
+
"@babel/core": "^7.29.7",
|
| 30 |
+
"@babel/helper-fixtures": "^7.29.7",
|
| 31 |
+
"@babel/plugin-transform-typescript": "^7.29.7",
|
| 32 |
+
"@jridgewell/sourcemap-codec": "^1.5.3",
|
| 33 |
+
"charcodes": "^0.2.0"
|
| 34 |
+
},
|
| 35 |
+
"engines": {
|
| 36 |
+
"node": ">=6.9.0"
|
| 37 |
+
},
|
| 38 |
+
"type": "commonjs"
|
| 39 |
+
}
|
node_modules/@babel/helper-compilation-targets/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/helper-compilation-targets/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/helper-compilation-targets
|
| 2 |
+
|
| 3 |
+
> Helper functions on Babel compilation targets
|
| 4 |
+
|
| 5 |
+
See our website [@babel/helper-compilation-targets](https://babeljs.io/docs/babel-helper-compilation-targets) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save @babel/helper-compilation-targets
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/helper-compilation-targets
|
| 19 |
+
```
|
node_modules/@babel/helper-compilation-targets/lib/debug.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.getInclusionReasons = getInclusionReasons;
|
| 7 |
+
var _semver = require("semver");
|
| 8 |
+
var _pretty = require("./pretty.js");
|
| 9 |
+
var _utils = require("./utils.js");
|
| 10 |
+
function getInclusionReasons(item, targetVersions, list) {
|
| 11 |
+
const minVersions = list[item] || {};
|
| 12 |
+
return Object.keys(targetVersions).reduce((result, env) => {
|
| 13 |
+
const minVersion = (0, _utils.getLowestImplementedVersion)(minVersions, env);
|
| 14 |
+
const targetVersion = targetVersions[env];
|
| 15 |
+
if (!minVersion) {
|
| 16 |
+
result[env] = (0, _pretty.prettifyVersion)(targetVersion);
|
| 17 |
+
} else {
|
| 18 |
+
const minIsUnreleased = (0, _utils.isUnreleasedVersion)(minVersion, env);
|
| 19 |
+
const targetIsUnreleased = (0, _utils.isUnreleasedVersion)(targetVersion, env);
|
| 20 |
+
if (!targetIsUnreleased && (minIsUnreleased || _semver.lt(targetVersion.toString(), (0, _utils.semverify)(minVersion)))) {
|
| 21 |
+
result[env] = (0, _pretty.prettifyVersion)(targetVersion);
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
return result;
|
| 25 |
+
}, {});
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
//# sourceMappingURL=debug.js.map
|
node_modules/@babel/helper-compilation-targets/lib/debug.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_semver","require","_pretty","_utils","getInclusionReasons","item","targetVersions","list","minVersions","Object","keys","reduce","result","env","minVersion","getLowestImplementedVersion","targetVersion","prettifyVersion","minIsUnreleased","isUnreleasedVersion","targetIsUnreleased","semver","lt","toString","semverify"],"sources":["../src/debug.ts"],"sourcesContent":["import semver from \"semver\";\nimport { prettifyVersion } from \"./pretty.ts\";\nimport {\n semverify,\n isUnreleasedVersion,\n getLowestImplementedVersion,\n} from \"./utils.ts\";\nimport type { Target, Targets } from \"./types.ts\";\n\nexport function getInclusionReasons(\n item: string,\n targetVersions: Targets,\n list: Record<string, Targets>,\n) {\n const minVersions = list[item] || {};\n\n return (Object.keys(targetVersions) as Target[]).reduce(\n (result, env) => {\n const minVersion = getLowestImplementedVersion(minVersions, env);\n const targetVersion = targetVersions[env];\n\n if (!minVersion) {\n result[env] = prettifyVersion(targetVersion);\n } else {\n const minIsUnreleased = isUnreleasedVersion(minVersion, env);\n const targetIsUnreleased = isUnreleasedVersion(targetVersion, env);\n\n if (\n !targetIsUnreleased &&\n (minIsUnreleased ||\n semver.lt(targetVersion.toString(), semverify(minVersion)))\n ) {\n result[env] = prettifyVersion(targetVersion);\n }\n }\n\n return result;\n },\n {} as Partial<Record<Target, string>>,\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAOO,SAASG,mBAAmBA,CACjCC,IAAY,EACZC,cAAuB,EACvBC,IAA6B,EAC7B;EACA,MAAMC,WAAW,GAAGD,IAAI,CAACF,IAAI,CAAC,IAAI,CAAC,CAAC;EAEpC,OAAQI,MAAM,CAACC,IAAI,CAACJ,cAAc,CAAC,CAAcK,MAAM,CACrD,CAACC,MAAM,EAAEC,GAAG,KAAK;IACf,MAAMC,UAAU,GAAG,IAAAC,kCAA2B,EAACP,WAAW,EAAEK,GAAG,CAAC;IAChE,MAAMG,aAAa,GAAGV,cAAc,CAACO,GAAG,CAAC;IAEzC,IAAI,CAACC,UAAU,EAAE;MACfF,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAI,uBAAe,EAACD,aAAa,CAAC;IAC9C,CAAC,MAAM;MACL,MAAME,eAAe,GAAG,IAAAC,0BAAmB,EAACL,UAAU,EAAED,GAAG,CAAC;MAC5D,MAAMO,kBAAkB,GAAG,IAAAD,0BAAmB,EAACH,aAAa,EAAEH,GAAG,CAAC;MAElE,IACE,CAACO,kBAAkB,KAClBF,eAAe,IACdG,OAAM,CAACC,EAAE,CAACN,aAAa,CAACO,QAAQ,CAAC,CAAC,EAAE,IAAAC,gBAAS,EAACV,UAAU,CAAC,CAAC,CAAC,EAC7D;QACAF,MAAM,CAACC,GAAG,CAAC,GAAG,IAAAI,uBAAe,EAACD,aAAa,CAAC;MAC9C;IACF;IAEA,OAAOJ,MAAM;EACf,CAAC,EACD,CAAC,CACH,CAAC;AACH","ignoreList":[]}
|
node_modules/@babel/helper-compilation-targets/lib/filter-items.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = filterItems;
|
| 7 |
+
exports.isRequired = isRequired;
|
| 8 |
+
exports.targetsSupported = targetsSupported;
|
| 9 |
+
var _semver = require("semver");
|
| 10 |
+
var _utils = require("./utils.js");
|
| 11 |
+
const pluginsCompatData = require("@babel/compat-data/plugins");
|
| 12 |
+
function targetsSupported(target, support) {
|
| 13 |
+
const targetEnvironments = Object.keys(target);
|
| 14 |
+
if (targetEnvironments.length === 0) {
|
| 15 |
+
return false;
|
| 16 |
+
}
|
| 17 |
+
const unsupportedEnvironments = targetEnvironments.filter(environment => {
|
| 18 |
+
const lowestImplementedVersion = (0, _utils.getLowestImplementedVersion)(support, environment);
|
| 19 |
+
if (!lowestImplementedVersion) {
|
| 20 |
+
return true;
|
| 21 |
+
}
|
| 22 |
+
const lowestTargetedVersion = target[environment];
|
| 23 |
+
if ((0, _utils.isUnreleasedVersion)(lowestTargetedVersion, environment)) {
|
| 24 |
+
return false;
|
| 25 |
+
}
|
| 26 |
+
if ((0, _utils.isUnreleasedVersion)(lowestImplementedVersion, environment)) {
|
| 27 |
+
return true;
|
| 28 |
+
}
|
| 29 |
+
if (!_semver.valid(lowestTargetedVersion.toString())) {
|
| 30 |
+
throw new Error(`Invalid version passed for target "${environment}": "${lowestTargetedVersion}". ` + "Versions must be in semver format (major.minor.patch)");
|
| 31 |
+
}
|
| 32 |
+
return _semver.gt((0, _utils.semverify)(lowestImplementedVersion), lowestTargetedVersion.toString());
|
| 33 |
+
});
|
| 34 |
+
return unsupportedEnvironments.length === 0;
|
| 35 |
+
}
|
| 36 |
+
function isRequired(name, targets, {
|
| 37 |
+
compatData = pluginsCompatData,
|
| 38 |
+
includes,
|
| 39 |
+
excludes
|
| 40 |
+
} = {}) {
|
| 41 |
+
if (excludes != null && excludes.has(name)) return false;
|
| 42 |
+
if (includes != null && includes.has(name)) return true;
|
| 43 |
+
return !targetsSupported(targets, compatData[name]);
|
| 44 |
+
}
|
| 45 |
+
function filterItems(list, includes, excludes, targets, defaultIncludes, defaultExcludes, pluginSyntaxMap) {
|
| 46 |
+
const result = new Set();
|
| 47 |
+
const options = {
|
| 48 |
+
compatData: list,
|
| 49 |
+
includes,
|
| 50 |
+
excludes
|
| 51 |
+
};
|
| 52 |
+
for (const item in list) {
|
| 53 |
+
if (isRequired(item, targets, options)) {
|
| 54 |
+
result.add(item);
|
| 55 |
+
} else if (pluginSyntaxMap) {
|
| 56 |
+
const shippedProposalsSyntax = pluginSyntaxMap.get(item);
|
| 57 |
+
if (shippedProposalsSyntax) {
|
| 58 |
+
result.add(shippedProposalsSyntax);
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
defaultIncludes == null || defaultIncludes.forEach(item => !excludes.has(item) && result.add(item));
|
| 63 |
+
defaultExcludes == null || defaultExcludes.forEach(item => !includes.has(item) && result.delete(item));
|
| 64 |
+
return result;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
//# sourceMappingURL=filter-items.js.map
|
node_modules/@babel/helper-compilation-targets/lib/filter-items.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_semver","require","_utils","pluginsCompatData","targetsSupported","target","support","targetEnvironments","Object","keys","length","unsupportedEnvironments","filter","environment","lowestImplementedVersion","getLowestImplementedVersion","lowestTargetedVersion","isUnreleasedVersion","semver","valid","toString","Error","gt","semverify","isRequired","name","targets","compatData","includes","excludes","has","filterItems","list","defaultIncludes","defaultExcludes","pluginSyntaxMap","result","Set","options","item","add","shippedProposalsSyntax","get","forEach","delete"],"sources":["../src/filter-items.ts"],"sourcesContent":["import semver from \"semver\";\n\nimport pluginsCompatData from \"@babel/compat-data/plugins\" with { type: \"json\" };\n\nimport type { Targets } from \"./types.ts\";\nimport {\n getLowestImplementedVersion,\n isUnreleasedVersion,\n semverify,\n} from \"./utils.ts\";\n\nexport function targetsSupported(target: Targets, support: Targets) {\n const targetEnvironments = Object.keys(target) as (keyof Targets)[];\n\n if (targetEnvironments.length === 0) {\n return false;\n }\n\n const unsupportedEnvironments = targetEnvironments.filter(environment => {\n const lowestImplementedVersion = getLowestImplementedVersion(\n support,\n environment,\n );\n\n // Feature is not implemented in that environment\n if (!lowestImplementedVersion) {\n return true;\n }\n\n const lowestTargetedVersion = target[environment];\n\n // If targets has unreleased value as a lowest version, then don't require a plugin.\n if (isUnreleasedVersion(lowestTargetedVersion, environment)) {\n return false;\n }\n\n // Include plugin if it is supported in the unreleased environment, which wasn't specified in targets\n if (isUnreleasedVersion(lowestImplementedVersion, environment)) {\n return true;\n }\n\n if (!semver.valid(lowestTargetedVersion.toString())) {\n throw new Error(\n `Invalid version passed for target \"${environment}\": \"${lowestTargetedVersion}\". ` +\n \"Versions must be in semver format (major.minor.patch)\",\n );\n }\n\n return semver.gt(\n semverify(lowestImplementedVersion),\n lowestTargetedVersion.toString(),\n );\n });\n\n return unsupportedEnvironments.length === 0;\n}\n\nexport function isRequired(\n name: string,\n targets: Targets,\n {\n compatData = pluginsCompatData,\n includes,\n excludes,\n }: {\n compatData?: Record<string, Targets>;\n includes?: Set<string>;\n excludes?: Set<string>;\n } = {},\n) {\n if (excludes?.has(name)) return false;\n if (includes?.has(name)) return true;\n return !targetsSupported(targets, compatData[name]);\n}\n\nexport default function filterItems(\n list: Record<string, Targets>,\n includes: Set<string>,\n excludes: Set<string>,\n targets: Targets,\n defaultIncludes: string[] | null,\n defaultExcludes?: string[] | null,\n pluginSyntaxMap?: Map<string, string | null>,\n) {\n const result = new Set<string>();\n const options = { compatData: list, includes, excludes };\n\n for (const item in list) {\n if (isRequired(item, targets, options)) {\n result.add(item);\n } else if (pluginSyntaxMap) {\n const shippedProposalsSyntax = pluginSyntaxMap.get(item);\n\n if (shippedProposalsSyntax) {\n result.add(shippedProposalsSyntax);\n }\n }\n }\n\n defaultIncludes?.forEach(item => !excludes.has(item) && result.add(item));\n defaultExcludes?.forEach(item => !includes.has(item) && result.delete(item));\n\n return result;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAIoB,MAPbE,iBAAiB,GAAAF,OAAA,CAAM,4BAA4B;AASnD,SAASG,gBAAgBA,CAAC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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
Object.defineProperty(exports, "TargetNames", {
|
| 7 |
+
enumerable: true,
|
| 8 |
+
get: function () {
|
| 9 |
+
return _options.TargetNames;
|
| 10 |
+
}
|
| 11 |
+
});
|
| 12 |
+
exports.default = getTargets;
|
| 13 |
+
Object.defineProperty(exports, "filterItems", {
|
| 14 |
+
enumerable: true,
|
| 15 |
+
get: function () {
|
| 16 |
+
return _filterItems.default;
|
| 17 |
+
}
|
| 18 |
+
});
|
| 19 |
+
Object.defineProperty(exports, "getInclusionReasons", {
|
| 20 |
+
enumerable: true,
|
| 21 |
+
get: function () {
|
| 22 |
+
return _debug.getInclusionReasons;
|
| 23 |
+
}
|
| 24 |
+
});
|
| 25 |
+
exports.isBrowsersQueryValid = isBrowsersQueryValid;
|
| 26 |
+
Object.defineProperty(exports, "isRequired", {
|
| 27 |
+
enumerable: true,
|
| 28 |
+
get: function () {
|
| 29 |
+
return _filterItems.isRequired;
|
| 30 |
+
}
|
| 31 |
+
});
|
| 32 |
+
Object.defineProperty(exports, "prettifyTargets", {
|
| 33 |
+
enumerable: true,
|
| 34 |
+
get: function () {
|
| 35 |
+
return _pretty.prettifyTargets;
|
| 36 |
+
}
|
| 37 |
+
});
|
| 38 |
+
Object.defineProperty(exports, "unreleasedLabels", {
|
| 39 |
+
enumerable: true,
|
| 40 |
+
get: function () {
|
| 41 |
+
return _targets.unreleasedLabels;
|
| 42 |
+
}
|
| 43 |
+
});
|
| 44 |
+
var _browserslist = require("browserslist");
|
| 45 |
+
var _helperValidatorOption = require("@babel/helper-validator-option");
|
| 46 |
+
var _lruCache = require("lru-cache");
|
| 47 |
+
var _utils = require("./utils.js");
|
| 48 |
+
var _targets = require("./targets.js");
|
| 49 |
+
var _options = require("./options.js");
|
| 50 |
+
var _pretty = require("./pretty.js");
|
| 51 |
+
var _debug = require("./debug.js");
|
| 52 |
+
var _filterItems = require("./filter-items.js");
|
| 53 |
+
const browserModulesData = require("@babel/compat-data/native-modules");
|
| 54 |
+
const ESM_SUPPORT = browserModulesData["es6.module"];
|
| 55 |
+
const v = new _helperValidatorOption.OptionValidator("@babel/helper-compilation-targets");
|
| 56 |
+
function validateTargetNames(targets) {
|
| 57 |
+
const validTargets = Object.keys(_options.TargetNames);
|
| 58 |
+
for (const target of Object.keys(targets)) {
|
| 59 |
+
if (!(target in _options.TargetNames)) {
|
| 60 |
+
throw new Error(v.formatMessage(`'${target}' is not a valid target
|
| 61 |
+
- Did you mean '${(0, _helperValidatorOption.findSuggestion)(target, validTargets)}'?`));
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
return targets;
|
| 65 |
+
}
|
| 66 |
+
function isBrowsersQueryValid(browsers) {
|
| 67 |
+
return typeof browsers === "string" || Array.isArray(browsers) && browsers.every(b => typeof b === "string");
|
| 68 |
+
}
|
| 69 |
+
function validateBrowsers(browsers) {
|
| 70 |
+
v.invariant(browsers === undefined || isBrowsersQueryValid(browsers), `'${String(browsers)}' is not a valid browserslist query`);
|
| 71 |
+
return browsers;
|
| 72 |
+
}
|
| 73 |
+
function getLowestVersions(browsers) {
|
| 74 |
+
return browsers.reduce((all, browser) => {
|
| 75 |
+
const [browserName, browserVersion] = browser.split(" ");
|
| 76 |
+
const target = _targets.browserNameMap[browserName];
|
| 77 |
+
if (!target) {
|
| 78 |
+
return all;
|
| 79 |
+
}
|
| 80 |
+
try {
|
| 81 |
+
const splitVersion = browserVersion.split("-")[0].toLowerCase();
|
| 82 |
+
const isSplitUnreleased = (0, _utils.isUnreleasedVersion)(splitVersion, target);
|
| 83 |
+
if (!all[target]) {
|
| 84 |
+
all[target] = isSplitUnreleased ? splitVersion : (0, _utils.semverify)(splitVersion);
|
| 85 |
+
return all;
|
| 86 |
+
}
|
| 87 |
+
const version = all[target];
|
| 88 |
+
const isUnreleased = (0, _utils.isUnreleasedVersion)(version, target);
|
| 89 |
+
if (isUnreleased && isSplitUnreleased) {
|
| 90 |
+
all[target] = (0, _utils.getLowestUnreleased)(version, splitVersion, target);
|
| 91 |
+
} else if (isUnreleased) {
|
| 92 |
+
all[target] = (0, _utils.semverify)(splitVersion);
|
| 93 |
+
} else if (!isUnreleased && !isSplitUnreleased) {
|
| 94 |
+
const parsedBrowserVersion = (0, _utils.semverify)(splitVersion);
|
| 95 |
+
all[target] = (0, _utils.semverMin)(version, parsedBrowserVersion);
|
| 96 |
+
}
|
| 97 |
+
} catch (_) {}
|
| 98 |
+
return all;
|
| 99 |
+
}, {});
|
| 100 |
+
}
|
| 101 |
+
function outputDecimalWarning(decimalTargets) {
|
| 102 |
+
if (!decimalTargets.length) {
|
| 103 |
+
return;
|
| 104 |
+
}
|
| 105 |
+
console.warn("Warning, the following targets are using a decimal version:\n");
|
| 106 |
+
decimalTargets.forEach(({
|
| 107 |
+
target,
|
| 108 |
+
value
|
| 109 |
+
}) => console.warn(` ${target}: ${value}`));
|
| 110 |
+
console.warn(`
|
| 111 |
+
We recommend using a string for minor/patch versions to avoid numbers like 6.10
|
| 112 |
+
getting parsed as 6.1, which can lead to unexpected behavior.
|
| 113 |
+
`);
|
| 114 |
+
}
|
| 115 |
+
function semverifyTarget(target, value) {
|
| 116 |
+
try {
|
| 117 |
+
return (0, _utils.semverify)(value);
|
| 118 |
+
} catch (_) {
|
| 119 |
+
throw new Error(v.formatMessage(`'${value}' is not a valid value for 'targets.${target}'.`));
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
function nodeTargetParser(value) {
|
| 123 |
+
const parsed = value === true || value === "current" ? process.versions.node.split("-")[0] : semverifyTarget("node", value);
|
| 124 |
+
return ["node", parsed];
|
| 125 |
+
}
|
| 126 |
+
function defaultTargetParser(target, value) {
|
| 127 |
+
const version = (0, _utils.isUnreleasedVersion)(value, target) ? value.toLowerCase() : semverifyTarget(target, value);
|
| 128 |
+
return [target, version];
|
| 129 |
+
}
|
| 130 |
+
function generateTargets(inputTargets) {
|
| 131 |
+
const input = Object.assign({}, inputTargets);
|
| 132 |
+
delete input.esmodules;
|
| 133 |
+
delete input.browsers;
|
| 134 |
+
return input;
|
| 135 |
+
}
|
| 136 |
+
function resolveTargets(queries, env) {
|
| 137 |
+
const resolved = _browserslist(queries, {
|
| 138 |
+
mobileToDesktop: true,
|
| 139 |
+
env
|
| 140 |
+
});
|
| 141 |
+
return getLowestVersions(resolved);
|
| 142 |
+
}
|
| 143 |
+
const targetsCache = new _lruCache({
|
| 144 |
+
max: 64
|
| 145 |
+
});
|
| 146 |
+
function resolveTargetsCached(queries, env) {
|
| 147 |
+
const cacheKey = typeof queries === "string" ? queries : queries.join() + env;
|
| 148 |
+
let cached = targetsCache.get(cacheKey);
|
| 149 |
+
if (!cached) {
|
| 150 |
+
cached = resolveTargets(queries, env);
|
| 151 |
+
targetsCache.set(cacheKey, cached);
|
| 152 |
+
}
|
| 153 |
+
return Object.assign({}, cached);
|
| 154 |
+
}
|
| 155 |
+
function getTargets(inputTargets = {}, options = {}) {
|
| 156 |
+
var _browsers, _browsers2;
|
| 157 |
+
let {
|
| 158 |
+
browsers,
|
| 159 |
+
esmodules
|
| 160 |
+
} = inputTargets;
|
| 161 |
+
const {
|
| 162 |
+
configPath = ".",
|
| 163 |
+
onBrowserslistConfigFound
|
| 164 |
+
} = options;
|
| 165 |
+
validateBrowsers(browsers);
|
| 166 |
+
const input = generateTargets(inputTargets);
|
| 167 |
+
let targets = validateTargetNames(input);
|
| 168 |
+
const shouldParseBrowsers = !!browsers;
|
| 169 |
+
const hasTargets = shouldParseBrowsers || Object.keys(targets).length > 0;
|
| 170 |
+
const shouldSearchForConfig = !options.ignoreBrowserslistConfig && !hasTargets;
|
| 171 |
+
if (!browsers && shouldSearchForConfig) {
|
| 172 |
+
browsers = process.env.BROWSERSLIST;
|
| 173 |
+
if (!browsers) {
|
| 174 |
+
const configFile = options.configFile || process.env.BROWSERSLIST_CONFIG || _browserslist.findConfigFile(configPath);
|
| 175 |
+
if (configFile != null) {
|
| 176 |
+
onBrowserslistConfigFound == null || onBrowserslistConfigFound(configFile);
|
| 177 |
+
browsers = _browserslist.loadConfig({
|
| 178 |
+
config: configFile,
|
| 179 |
+
env: options.browserslistEnv
|
| 180 |
+
});
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
if (browsers == null) {
|
| 184 |
+
browsers = [];
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
if (esmodules && (esmodules !== "intersect" || !((_browsers = browsers) != null && _browsers.length))) {
|
| 188 |
+
browsers = Object.keys(ESM_SUPPORT).map(browser => `${browser} >= ${ESM_SUPPORT[browser]}`).join(", ");
|
| 189 |
+
esmodules = false;
|
| 190 |
+
}
|
| 191 |
+
if ((_browsers2 = browsers) != null && _browsers2.length) {
|
| 192 |
+
const queryBrowsers = resolveTargetsCached(browsers, options.browserslistEnv);
|
| 193 |
+
if (esmodules === "intersect") {
|
| 194 |
+
for (const browser of Object.keys(queryBrowsers)) {
|
| 195 |
+
if (browser !== "deno" && browser !== "ie") {
|
| 196 |
+
const esmSupportVersion = ESM_SUPPORT[browser === "opera_mobile" ? "op_mob" : browser];
|
| 197 |
+
if (esmSupportVersion) {
|
| 198 |
+
const version = queryBrowsers[browser];
|
| 199 |
+
queryBrowsers[browser] = (0, _utils.getHighestUnreleased)(version, (0, _utils.semverify)(esmSupportVersion), browser);
|
| 200 |
+
} else {
|
| 201 |
+
delete queryBrowsers[browser];
|
| 202 |
+
}
|
| 203 |
+
} else {
|
| 204 |
+
delete queryBrowsers[browser];
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
}
|
| 208 |
+
targets = Object.assign(queryBrowsers, targets);
|
| 209 |
+
}
|
| 210 |
+
const result = {};
|
| 211 |
+
const decimalWarnings = [];
|
| 212 |
+
for (const target of Object.keys(targets).sort()) {
|
| 213 |
+
const value = targets[target];
|
| 214 |
+
if (typeof value === "number" && value % 1 !== 0) {
|
| 215 |
+
decimalWarnings.push({
|
| 216 |
+
target,
|
| 217 |
+
value
|
| 218 |
+
});
|
| 219 |
+
}
|
| 220 |
+
const [parsedTarget, parsedValue] = target === "node" ? nodeTargetParser(value) : defaultTargetParser(target, value);
|
| 221 |
+
if (parsedValue) {
|
| 222 |
+
result[parsedTarget] = parsedValue;
|
| 223 |
+
}
|
| 224 |
+
}
|
| 225 |
+
outputDecimalWarning(decimalWarnings);
|
| 226 |
+
return result;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/helper-compilation-targets/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_browserslist","require","_helperValidatorOption","_lruCache","_utils","_targets","_options","_pretty","_debug","_filterItems","browserModulesData","ESM_SUPPORT","v","OptionValidator","validateTargetNames","targets","validTargets","Object","keys","TargetNames","target","Error","formatMessage","findSuggestion","isBrowsersQueryValid","browsers","Array","isArray","every","b","validateBrowsers","invariant","undefined","String","getLowestVersions","reduce","all","browser","browserName","browserVersion","split","browserNameMap","splitVersion","toLowerCase","isSplitUnreleased","isUnreleasedVersion","semverify","version","isUnreleased","getLowestUnreleased","parsedBrowserVersion","semverMin","_","outputDecimalWarning","decimalTargets","length","console","warn","forEach","value","semverifyTarget","nodeTargetParser","parsed","process","versions","node","defaultTargetParser","generateTargets","inputTargets","input","assign","esmodules","resolveTargets","queries","env","resolved","browserslist","mobileToDesktop","targetsCache","LruCache","max","resolveTargetsCached","cacheKey","join","cached","get","set","getTargets","options","_browsers","_browsers2","configPath","onBrowserslistConfigFound","shouldParseBrowsers","hasTargets","shouldSearchForConfig","ignoreBrowserslistConfig","BROWSERSLIST","configFile","BROWSERSLIST_CONFIG","findConfigFile","loadConfig","config","browserslistEnv","map","queryBrowsers","esmSupportVersion","getHighestUnreleased","result","decimalWarnings","sort","push","parsedTarget","parsedValue"],"sources":["../src/index.ts"],"sourcesContent":["import browserslist from \"browserslist\";\nimport { findSuggestion } from \"@babel/helper-validator-option\";\nimport browserModulesData from \"@babel/compat-data/native-modules\" with { type: \"json\" };\nimport LruCache from \"lru-cache\";\n\nimport {\n semverify,\n semverMin,\n isUnreleasedVersion,\n getLowestUnreleased,\n getHighestUnreleased,\n} from \"./utils.ts\";\nimport { OptionValidator } from \"@babel/helper-validator-option\";\nimport { browserNameMap } from \"./targets.ts\";\nimport { TargetNames } from \"./options.ts\";\nimport type {\n Target,\n Targets,\n InputTargets,\n Browsers,\n BrowserslistBrowserName,\n TargetsTuple,\n} from \"./types.d.ts\";\n\nexport type { Target, Targets, InputTargets };\n\nexport { prettifyTargets } from \"./pretty.ts\";\nexport { getInclusionReasons } from \"./debug.ts\";\nexport { default as filterItems, isRequired } from \"./filter-items.ts\";\nexport { unreleasedLabels } from \"./targets.ts\";\nexport { TargetNames };\n\nconst ESM_SUPPORT = browserModulesData[\"es6.module\"];\n\nconst v = new OptionValidator(PACKAGE_JSON.name);\n\nfunction validateTargetNames(targets: Targets): TargetsTuple {\n const validTargets = Object.keys(TargetNames);\n for (const target of Object.keys(targets)) {\n if (!(target in TargetNames)) {\n throw new Error(\n v.formatMessage(`'${target}' is not a valid target\n- Did you mean '${findSuggestion(target, validTargets)}'?`),\n );\n }\n }\n\n return targets;\n}\n\nexport function isBrowsersQueryValid(browsers: unknown): boolean {\n return (\n typeof browsers === \"string\" ||\n (Array.isArray(browsers) && browsers.every(b => typeof b === \"string\"))\n );\n}\n\nfunction validateBrowsers(browsers: Browsers | undefined) {\n v.invariant(\n browsers === undefined || isBrowsersQueryValid(browsers),\n `'${String(browsers)}' is not a valid browserslist query`,\n );\n\n return browsers;\n}\n\nfunction getLowestVersions(browsers: string[]): Targets {\n return browsers.reduce(\n (all, browser) => {\n const [browserName, browserVersion] = browser.split(\" \") as [\n BrowserslistBrowserName,\n string,\n ];\n const target = browserNameMap[browserName];\n\n if (!target) {\n return all;\n }\n\n try {\n // Browser version can return as \"10.0-10.2\"\n const splitVersion = browserVersion.split(\"-\")[0].toLowerCase();\n const isSplitUnreleased = isUnreleasedVersion(splitVersion, target);\n\n if (!all[target]) {\n all[target] = isSplitUnreleased\n ? splitVersion\n : semverify(splitVersion);\n return all;\n }\n\n const version = all[target];\n const isUnreleased = isUnreleasedVersion(version, target);\n\n if (isUnreleased && isSplitUnreleased) {\n all[target] = getLowestUnreleased(version, splitVersion, target);\n } else if (isUnreleased) {\n all[target] = semverify(splitVersion);\n } else if (!isUnreleased && !isSplitUnreleased) {\n const parsedBrowserVersion = semverify(splitVersion);\n\n all[target] = semverMin(version, parsedBrowserVersion);\n }\n } catch (_) {}\n\n return all;\n },\n {} as Record<Target, string>,\n );\n}\n\nfunction outputDecimalWarning(\n decimalTargets: { target: string; value: number }[],\n) {\n if (!decimalTargets.length) {\n return;\n }\n\n console.warn(\"Warning, the following targets are using a decimal version:\\n\");\n decimalTargets.forEach(({ target, value }) =>\n console.warn(` ${target}: ${value}`),\n );\n console.warn(`\nWe recommend using a string for minor/patch versions to avoid numbers like 6.10\ngetting parsed as 6.1, which can lead to unexpected behavior.\n`);\n}\n\nfunction semverifyTarget(target: Target, value: string) {\n try {\n return semverify(value);\n } catch (_) {\n throw new Error(\n v.formatMessage(\n `'${value}' is not a valid value for 'targets.${target}'.`,\n ),\n );\n }\n}\n\n// Parse `node: true` and `node: \"current\"` to version\nfunction nodeTargetParser(value: true | string) {\n const parsed =\n value === true || value === \"current\"\n ? // Align with `browserslist` and strip prerelease tag.\n process.versions.node.split(\"-\")[0]\n : semverifyTarget(\"node\", value);\n return [\"node\", parsed] as const;\n}\n\nfunction defaultTargetParser(\n target: Exclude<Target, \"node\">,\n value: string,\n): readonly [Exclude<Target, \"node\">, string] {\n const version = isUnreleasedVersion(value, target)\n ? value.toLowerCase()\n : semverifyTarget(target, value);\n return [target, version] as const;\n}\n\nfunction generateTargets(inputTargets: InputTargets): Targets {\n const input = { ...inputTargets };\n delete input.esmodules;\n delete input.browsers;\n return input;\n}\n\nfunction resolveTargets(queries: Browsers, env?: string): Targets {\n const resolved = browserslist(queries, {\n mobileToDesktop: true,\n env,\n });\n return getLowestVersions(resolved);\n}\n\nconst targetsCache = new LruCache({ max: 64 });\n\nfunction resolveTargetsCached(queries: Browsers, env?: string): Targets {\n const cacheKey = typeof queries === \"string\" ? queries : queries.join() + env;\n let cached = targetsCache.get(cacheKey) as Targets | undefined;\n if (!cached) {\n cached = resolveTargets(queries, env);\n targetsCache.set(cacheKey, cached);\n }\n return { ...cached };\n}\n\ntype GetTargetsOption = {\n // This is not the path of the config file, but the path where start searching it from\n configPath?: string;\n // The path of the config file\n configFile?: string;\n // The env to pass to browserslist\n browserslistEnv?: string;\n // true to disable config loading\n ignoreBrowserslistConfig?: boolean;\n // custom hook when browserslist config is found\n onBrowserslistConfigFound?: (configFile: string) => void;\n};\n\nexport default function getTargets(\n inputTargets: InputTargets = {},\n options: GetTargetsOption = {},\n): Targets {\n let { browsers, esmodules } = inputTargets;\n const { configPath = \".\", onBrowserslistConfigFound } = options;\n\n validateBrowsers(browsers);\n\n const input = generateTargets(inputTargets);\n let targets = validateTargetNames(input);\n\n const shouldParseBrowsers = !!browsers;\n const hasTargets = shouldParseBrowsers || Object.keys(targets).length > 0;\n const shouldSearchForConfig =\n !options.ignoreBrowserslistConfig && !hasTargets;\n\n if (!browsers && shouldSearchForConfig) {\n // https://github.com/browserslist/browserslist/blob/8ae85caa905d130f4ca86f7a998a5b63abbbe582/node.js#L243\n browsers = process.env.BROWSERSLIST;\n if (!browsers) {\n const configFile =\n options.configFile ||\n process.env.BROWSERSLIST_CONFIG ||\n browserslist.findConfigFile(configPath);\n if (configFile != null) {\n onBrowserslistConfigFound?.(configFile);\n browsers = browserslist.loadConfig({\n config: configFile,\n env: options.browserslistEnv,\n });\n }\n }\n\n if (browsers == null) {\n if (process.env.BABEL_8_BREAKING) {\n // In Babel 8, if no targets are passed, we use browserslist's defaults.\n browsers = [\"defaults\"];\n } else {\n // If no targets are passed, we need to overwrite browserslist's defaults\n // so that we enable all transforms (acting like the now deprecated\n // preset-latest).\n browsers = [];\n }\n }\n }\n\n if (process.env.BABEL_8_BREAKING && esmodules) {\n esmodules = \"intersect\";\n }\n\n // `esmodules` as a target indicates the specific set of browsers supporting ES Modules.\n // These values OVERRIDE the `browsers` field.\n if (esmodules && (esmodules !== \"intersect\" || !browsers?.length)) {\n browsers = Object.keys(ESM_SUPPORT)\n .map(\n (browser: keyof typeof ESM_SUPPORT) =>\n `${browser} >= ${ESM_SUPPORT[browser]}`,\n )\n .join(\", \");\n esmodules = false;\n }\n\n // If current value of `browsers` is undefined (`ignoreBrowserslistConfig` should be `false`)\n // or an empty array (without any user config, use default config),\n // we don't need to call `resolveTargets` to execute the related methods of `browserslist` library.\n if (browsers?.length) {\n const queryBrowsers = resolveTargetsCached(\n browsers,\n options.browserslistEnv,\n );\n\n if (esmodules === \"intersect\") {\n for (const browser of Object.keys(queryBrowsers) as Target[]) {\n if (browser !== \"deno\" && browser !== \"ie\") {\n const esmSupportVersion =\n ESM_SUPPORT[browser === \"opera_mobile\" ? \"op_mob\" : browser];\n\n if (esmSupportVersion) {\n const version = queryBrowsers[browser];\n queryBrowsers[browser] = getHighestUnreleased(\n version,\n semverify(esmSupportVersion),\n browser,\n );\n } else {\n delete queryBrowsers[browser];\n }\n } else {\n delete queryBrowsers[browser];\n }\n }\n }\n\n targets = Object.assign(queryBrowsers, targets);\n }\n\n // Parse remaining targets\n const result: Targets = {};\n const decimalWarnings = [];\n for (const target of Object.keys(targets).sort() as Target[]) {\n const value = targets[target];\n\n // Warn when specifying minor/patch as a decimal\n if (typeof value === \"number\" && value % 1 !== 0) {\n decimalWarnings.push({ target, value });\n }\n\n const [parsedTarget, parsedValue] =\n target === \"node\"\n ? nodeTargetParser(value)\n : defaultTargetParser(target, value as string);\n\n if (parsedValue) {\n // Merge (lowest wins)\n result[parsedTarget] = parsedValue;\n }\n }\n\n outputDecimalWarning(decimalWarnings);\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAQA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAYA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAAuE,MA1BhES,kBAAkB,GAAAT,OAAA,CAAM,mCAAmC;AA8BlE,MAAMU,WAAW,GAAGD,kBAAkB,CAAC,YAAY,CAAC;AAEpD,MAAME,CAAC,GAAG,IAAIC,sCAAe,oCAAkB,CAAC;AAEhD,SAASC,mBAAmBA,CAACC,OAAgB,EAAgB;EAC3D,MAAMC,YAAY,GAAGC,MAAM,CAACC,IAAI,CAACC,oBAAW,CAAC;EAC7C,KAAK,MAAMC,MAAM,IAAIH,MAAM,CAACC,IAAI,CAACH,OAAO,CAAC,EAAE;IACzC,IAAI,EAAEK,MAAM,IAAID,oBAAW,CAAC,EAAE;MAC5B,MAAM,IAAIE,KAAK,CACbT,CAAC,CAACU,aAAa,CAAC,IAAIF,MAAM;AAClC,kBAAkB,IAAAG,qCAAc,EAACH,MAAM,EAAEJ,YAAY,CAAC,IAAI,CACpD,CAAC;IACH;EACF;EAEA,OAAOD,OAAO;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OAAOoE,aAAa,CAACpE,OAAO,CAAC;UAC/B;QACF,CAAC,MAAM;UACL,OAAOoE,aAAa,CAACpE,OAAO,CAAC;QAC/B;MACF;IACF;IAEAtB,OAAO,GAAGE,MAAM,CAACqD,MAAM,CAACmC,aAAa,EAAE1F,OAAO,CAAC;EACjD;EAGA,MAAM6F,MAAe,GAAG,CAAC,CAAC;EAC1B,MAAMC,eAAe,GAAG,EAAE;EAC1B,KAAK,MAAMzF,MAAM,IAAIH,MAAM,CAACC,IAAI,CAACH,OAAO,CAAC,CAAC+F,IAAI,CAAC,CAAC,EAAc;IAC5D,MAAMnD,KAAK,GAAG5C,OAAO,CAACK,MAAM,CAAC;IAG7B,IAAI,OAAOuC,KAAK,KAAK,QAAQ,IAAIA,KAAK,GAAG,CAAC,KAAK,CAAC,EAAE;MAChDkD,eAAe,CAACE,IAAI,CAAC;QAAE3F,MAAM;QAAEuC;MAAM,CAAC,CAAC;IACzC;IAEA,MAAM,CAACqD,YAAY,EAAEC,WAAW,CAAC,GAC/B7F,MAAM,KAAK,MAAM,GACbyC,gBAAgB,CAACF,KAAK,CAAC,GACvBO,mBAAmB,CAAC9C,MAAM,EAAEuC,KAAe,CAAC;IAElD,IAAIsD,WAAW,EAAE;MAEfL,MAAM,CAACI,YAAY,CAAC,GAAGC,WAAW;IACpC;EACF;EAEA5D,oBAAoB,CAACwD,eAAe,CAAC;EAErC,OAAOD,MAAM;AACf","ignoreList":[]}
|
node_modules/@babel/helper-compilation-targets/lib/options.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.TargetNames = void 0;
|
| 7 |
+
const TargetNames = exports.TargetNames = {
|
| 8 |
+
node: "node",
|
| 9 |
+
deno: "deno",
|
| 10 |
+
chrome: "chrome",
|
| 11 |
+
opera: "opera",
|
| 12 |
+
edge: "edge",
|
| 13 |
+
firefox: "firefox",
|
| 14 |
+
safari: "safari",
|
| 15 |
+
ie: "ie",
|
| 16 |
+
ios: "ios",
|
| 17 |
+
android: "android",
|
| 18 |
+
electron: "electron",
|
| 19 |
+
samsung: "samsung",
|
| 20 |
+
rhino: "rhino",
|
| 21 |
+
opera_mobile: "opera_mobile"
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
//# sourceMappingURL=options.js.map
|
node_modules/@babel/helper-compilation-targets/lib/options.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["TargetNames","exports","node","deno","chrome","opera","edge","firefox","safari","ie","ios","android","electron","samsung","rhino","opera_mobile"],"sources":["../src/options.ts"],"sourcesContent":["export const TargetNames = {\n node: \"node\",\n deno: \"deno\",\n chrome: \"chrome\",\n opera: \"opera\",\n edge: \"edge\",\n firefox: \"firefox\",\n safari: \"safari\",\n ie: \"ie\",\n ios: \"ios\",\n android: \"android\",\n electron: \"electron\",\n samsung: \"samsung\",\n rhino: \"rhino\",\n opera_mobile: \"opera_mobile\",\n};\n"],"mappings":";;;;;;AAAO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACzBE,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,EAAE,EAAE,IAAI;EACRC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,OAAO;EACdC,YAAY,EAAE;AAChB,CAAC","ignoreList":[]}
|
node_modules/@babel/helper-compilation-targets/lib/pretty.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.prettifyTargets = prettifyTargets;
|
| 7 |
+
exports.prettifyVersion = prettifyVersion;
|
| 8 |
+
var _semver = require("semver");
|
| 9 |
+
var _targets = require("./targets.js");
|
| 10 |
+
function prettifyVersion(version) {
|
| 11 |
+
if (typeof version !== "string") {
|
| 12 |
+
return version;
|
| 13 |
+
}
|
| 14 |
+
const {
|
| 15 |
+
major,
|
| 16 |
+
minor,
|
| 17 |
+
patch
|
| 18 |
+
} = _semver.parse(version);
|
| 19 |
+
const parts = [major];
|
| 20 |
+
if (minor || patch) {
|
| 21 |
+
parts.push(minor);
|
| 22 |
+
}
|
| 23 |
+
if (patch) {
|
| 24 |
+
parts.push(patch);
|
| 25 |
+
}
|
| 26 |
+
return parts.join(".");
|
| 27 |
+
}
|
| 28 |
+
function prettifyTargets(targets) {
|
| 29 |
+
return Object.keys(targets).reduce((results, target) => {
|
| 30 |
+
let value = targets[target];
|
| 31 |
+
const unreleasedLabel = _targets.unreleasedLabels[target];
|
| 32 |
+
if (typeof value === "string" && unreleasedLabel !== value) {
|
| 33 |
+
value = prettifyVersion(value);
|
| 34 |
+
}
|
| 35 |
+
results[target] = value;
|
| 36 |
+
return results;
|
| 37 |
+
}, {});
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
//# sourceMappingURL=pretty.js.map
|
node_modules/@babel/helper-compilation-targets/lib/pretty.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_semver","require","_targets","prettifyVersion","version","major","minor","patch","semver","parse","parts","push","join","prettifyTargets","targets","Object","keys","reduce","results","target","value","unreleasedLabel","unreleasedLabels"],"sources":["../src/pretty.ts"],"sourcesContent":["import semver from \"semver\";\nimport { unreleasedLabels } from \"./targets.ts\";\nimport type { Targets, Target } from \"./types.ts\";\n\nexport function prettifyVersion(version: string) {\n if (typeof version !== \"string\") {\n return version;\n }\n\n const { major, minor, patch } = semver.parse(version);\n\n const parts = [major];\n\n if (minor || patch) {\n parts.push(minor);\n }\n\n if (patch) {\n parts.push(patch);\n }\n\n return parts.join(\".\");\n}\n\nexport function prettifyTargets(targets: Targets): Targets {\n return Object.keys(targets).reduce((results, target: Target) => {\n let value = targets[target];\n\n const unreleasedLabel =\n // @ts-expect-error undefined is strictly compared with string later\n unreleasedLabels[target];\n if (typeof value === \"string\" && unreleasedLabel !== value) {\n value = prettifyVersion(value);\n }\n\n results[target] = value;\n return results;\n }, {} as Targets);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAGO,SAASE,eAAeA,CAACC,OAAe,EAAE;EAC/C,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;IAC/B,OAAOA,OAAO;EAChB;EAEA,MAAM;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGC,OAAM,CAACC,KAAK,CAACL,OAAO,CAAC;EAErD,MAAMM,KAAK,GAAG,CAACL,KAAK,CAAC;EAErB,IAAIC,KAAK,IAAIC,KAAK,EAAE;IAClBG,KAAK,CAACC,IAAI,CAACL,KAAK,CAAC;EACnB;EAEA,IAAIC,KAAK,EAAE;IACTG,KAAK,CAACC,IAAI,CAACJ,KAAK,CAAC;EACnB;EAEA,OAAOG,KAAK,CAACE,IAAI,CAAC,GAAG,CAAC;AACxB;AAEO,SAASC,eAAeA,CAACC,OAAgB,EAAW;EACzD,OAAOC,MAAM,CAACC,IAAI,CAACF,OAAO,CAAC,CAACG,MAAM,CAAC,CAACC,OAAO,EAAEC,MAAc,KAAK;IAC9D,IAAIC,KAAK,GAAGN,OAAO,CAACK,MAAM,CAAC;IAE3B,MAAME,eAAe,GAEnBC,yBAAgB,CAACH,MAAM,CAAC;IAC1B,IAAI,OAAOC,KAAK,KAAK,QAAQ,IAAIC,eAAe,KAAKD,KAAK,EAAE;MAC1DA,KAAK,GAAGjB,eAAe,CAACiB,KAAK,CAAC;IAChC;IAEAF,OAAO,CAACC,MAAM,CAAC,GAAGC,KAAK;IACvB,OAAOF,OAAO;EAChB,CAAC,EAAE,CAAC,CAAY,CAAC;AACnB","ignoreList":[]}
|
node_modules/@babel/helper-compilation-targets/lib/targets.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.unreleasedLabels = exports.browserNameMap = void 0;
|
| 7 |
+
const unreleasedLabels = exports.unreleasedLabels = {
|
| 8 |
+
safari: "tp"
|
| 9 |
+
};
|
| 10 |
+
const browserNameMap = exports.browserNameMap = {
|
| 11 |
+
and_chr: "chrome",
|
| 12 |
+
and_ff: "firefox",
|
| 13 |
+
android: "android",
|
| 14 |
+
chrome: "chrome",
|
| 15 |
+
edge: "edge",
|
| 16 |
+
firefox: "firefox",
|
| 17 |
+
ie: "ie",
|
| 18 |
+
ie_mob: "ie",
|
| 19 |
+
ios_saf: "ios",
|
| 20 |
+
node: "node",
|
| 21 |
+
deno: "deno",
|
| 22 |
+
op_mob: "opera_mobile",
|
| 23 |
+
opera: "opera",
|
| 24 |
+
safari: "safari",
|
| 25 |
+
samsung: "samsung"
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
//# sourceMappingURL=targets.js.map
|
node_modules/@babel/helper-compilation-targets/lib/targets.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["unreleasedLabels","exports","safari","browserNameMap","and_chr","and_ff","android","chrome","edge","firefox","ie","ie_mob","ios_saf","node","deno","op_mob","opera","samsung"],"sources":["../src/targets.ts"],"sourcesContent":["export const unreleasedLabels = {\n safari: \"tp\",\n} as const;\n\n// Map from browserslist|@mdn/browser-compat-data browser names to @kangax/compat-table browser names\nexport const browserNameMap = {\n and_chr: \"chrome\",\n and_ff: \"firefox\",\n android: \"android\",\n chrome: \"chrome\",\n edge: \"edge\",\n firefox: \"firefox\",\n ie: \"ie\",\n ie_mob: \"ie\",\n ios_saf: \"ios\",\n node: \"node\",\n deno: \"deno\",\n op_mob: \"opera_mobile\",\n opera: \"opera\",\n safari: \"safari\",\n samsung: \"samsung\",\n} as const;\n\nexport type BrowserslistBrowserName = keyof typeof browserNameMap;\n"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC9BE,MAAM,EAAE;AACV,CAAU;AAGH,MAAMC,cAAc,GAAAF,OAAA,CAAAE,cAAA,GAAG;EAC5BC,OAAO,EAAE,QAAQ;EACjBC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE,SAAS;EAClBC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAE,KAAK;EACdC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,cAAc;EACtBC,KAAK,EAAE,OAAO;EACdd,MAAM,EAAE,QAAQ;EAChBe,OAAO,EAAE;AACX,CAAU","ignoreList":[]}
|
node_modules/@babel/helper-compilation-targets/lib/utils.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.getHighestUnreleased = getHighestUnreleased;
|
| 7 |
+
exports.getLowestImplementedVersion = getLowestImplementedVersion;
|
| 8 |
+
exports.getLowestUnreleased = getLowestUnreleased;
|
| 9 |
+
exports.isUnreleasedVersion = isUnreleasedVersion;
|
| 10 |
+
exports.semverMin = semverMin;
|
| 11 |
+
exports.semverify = semverify;
|
| 12 |
+
var _semver = require("semver");
|
| 13 |
+
var _helperValidatorOption = require("@babel/helper-validator-option");
|
| 14 |
+
var _targets = require("./targets.js");
|
| 15 |
+
const versionRegExp = /^(?:\d+|\d(?:\d?[^\d\n\r\u2028\u2029]\d+|\d{2,}(?:[^\d\n\r\u2028\u2029]\d+)?))$/;
|
| 16 |
+
const v = new _helperValidatorOption.OptionValidator("@babel/helper-compilation-targets");
|
| 17 |
+
function semverMin(first, second) {
|
| 18 |
+
return first && _semver.lt(first, second) ? first : second;
|
| 19 |
+
}
|
| 20 |
+
function semverify(version) {
|
| 21 |
+
if (typeof version === "string" && _semver.valid(version)) {
|
| 22 |
+
return version;
|
| 23 |
+
}
|
| 24 |
+
v.invariant(typeof version === "number" || typeof version === "string" && versionRegExp.test(version), `'${version}' is not a valid version`);
|
| 25 |
+
version = version.toString();
|
| 26 |
+
let pos = 0;
|
| 27 |
+
let num = 0;
|
| 28 |
+
while ((pos = version.indexOf(".", pos + 1)) > 0) {
|
| 29 |
+
num++;
|
| 30 |
+
}
|
| 31 |
+
return version + ".0".repeat(2 - num);
|
| 32 |
+
}
|
| 33 |
+
function isUnreleasedVersion(version, env) {
|
| 34 |
+
const unreleasedLabel = _targets.unreleasedLabels[env];
|
| 35 |
+
return !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase();
|
| 36 |
+
}
|
| 37 |
+
function getLowestUnreleased(a, b, env) {
|
| 38 |
+
const unreleasedLabel = _targets.unreleasedLabels[env];
|
| 39 |
+
if (a === unreleasedLabel) {
|
| 40 |
+
return b;
|
| 41 |
+
}
|
| 42 |
+
if (b === unreleasedLabel) {
|
| 43 |
+
return a;
|
| 44 |
+
}
|
| 45 |
+
return semverMin(a, b);
|
| 46 |
+
}
|
| 47 |
+
function getHighestUnreleased(a, b, env) {
|
| 48 |
+
return getLowestUnreleased(a, b, env) === a ? b : a;
|
| 49 |
+
}
|
| 50 |
+
function getLowestImplementedVersion(plugin, environment) {
|
| 51 |
+
const result = plugin[environment];
|
| 52 |
+
if (!result && environment === "android") {
|
| 53 |
+
return plugin.chrome;
|
| 54 |
+
}
|
| 55 |
+
return result;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
//# sourceMappingURL=utils.js.map
|
node_modules/@babel/helper-compilation-targets/lib/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_semver","require","_helperValidatorOption","_targets","versionRegExp","v","OptionValidator","semverMin","first","second","semver","lt","semverify","version","valid","invariant","test","toString","pos","num","indexOf","repeat","isUnreleasedVersion","env","unreleasedLabel","unreleasedLabels","toLowerCase","getLowestUnreleased","a","b","getHighestUnreleased","getLowestImplementedVersion","plugin","environment","result","chrome"],"sources":["../src/utils.ts"],"sourcesContent":["import semver from \"semver\";\nimport { OptionValidator } from \"@babel/helper-validator-option\";\nimport { unreleasedLabels } from \"./targets.ts\";\nimport type { Target, Targets } from \"./types.ts\";\n\nconst versionRegExp =\n /^(?:\\d+|\\d(?:\\d?[^\\d\\n\\r\\u2028\\u2029]\\d+|\\d{2,}(?:[^\\d\\n\\r\\u2028\\u2029]\\d+)?))$/;\n\nconst v = new OptionValidator(PACKAGE_JSON.name);\n\nexport function semverMin(\n first: string | undefined | null,\n second: string,\n): string {\n return first && semver.lt(first, second) ? first : second;\n}\n\n// Convert version to a semver value.\n// 2.5 -> 2.5.0; 1 -> 1.0.0;\nexport function semverify(version: number | string): string {\n if (typeof version === \"string\" && semver.valid(version)) {\n return version;\n }\n\n v.invariant(\n typeof version === \"number\" ||\n (typeof version === \"string\" && versionRegExp.test(version)),\n `'${version}' is not a valid version`,\n );\n\n version = version.toString();\n\n let pos = 0;\n let num = 0;\n while ((pos = version.indexOf(\".\", pos + 1)) > 0) {\n num++;\n }\n return version + \".0\".repeat(2 - num);\n}\n\nexport function isUnreleasedVersion(\n version: string | number,\n env: Target,\n): boolean {\n const unreleasedLabel =\n // @ts-expect-error unreleasedLabel will be guarded later\n unreleasedLabels[env];\n return (\n !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase()\n );\n}\n\nexport function getLowestUnreleased(a: string, b: string, env: Target): string {\n const unreleasedLabel:\n | (typeof unreleasedLabels)[keyof typeof unreleasedLabels]\n | undefined =\n // @ts-expect-error unreleasedLabel is undefined when env is not safari\n unreleasedLabels[env];\n if (a === unreleasedLabel) {\n return b;\n }\n if (b === unreleasedLabel) {\n return a;\n }\n return semverMin(a, b);\n}\n\nexport function getHighestUnreleased(\n a: string,\n b: string,\n env: Target,\n): string {\n return getLowestUnreleased(a, b, env) === a ? b : a;\n}\n\nexport function getLowestImplementedVersion(\n plugin: Targets,\n environment: Target,\n): string {\n const result = plugin[environment];\n // When Android support data is absent, use Chrome data as fallback\n if (!result && environment === \"android\") {\n return plugin.chrome;\n }\n return result;\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAGA,MAAMG,aAAa,GACjB,iFAAiF;AAEnF,MAAMC,CAAC,GAAG,IAAIC,sCAAe,oCAAkB,CAAC;AAEzC,SAASC,SAASA,CACvBC,KAAgC,EAChCC,MAAc,EACN;EACR,OAAOD,KAAK,IAAIE,OAAM,CAACC,EAAE,CAACH,KAAK,EAAEC,MAAM,CAAC,GAAGD,KAAK,GAAGC,MAAM;AAC3D;AAIO,SAASG,SAASA,CAACC,OAAwB,EAAU;EAC1D,IAAI,OAAOA,OAAO,KAAK,QAAQ,IAAIH,OAAM,CAACI,KAAK,CAACD,OAAO,CAAC,EAAE;IACxD,OAAOA,OAAO;EAChB;EAEAR,CAAC,CAACU,SAAS,CACT,OAAOF,OAAO,KAAK,QAAQ,IACxB,OAAOA,OAAO,KAAK,QAAQ,IAAIT,aAAa,CAACY,IAAI,CAACH,OAAO,CAAE,EAC9D,IAAIA,OAAO,0BACb,CAAC;EAEDA,OAAO,GAAGA,OAAO,CAACI,QAAQ,CAAC,CAAC;EAE5B,IAAIC,GAAG,GAAG,CAAC;EACX,IAAIC,GAAG,GAAG,CAAC;EACX,OAAO,CAACD,GAAG,GAAGL,OAAO,CAACO,OAAO,CAAC,GAAG,EAAEF,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE;IAChDC,GA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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/helper-compilation-targets",
|
| 3 |
+
"version": "7.29.7",
|
| 4 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 5 |
+
"license": "MIT",
|
| 6 |
+
"description": "Helper functions on Babel compilation targets",
|
| 7 |
+
"repository": {
|
| 8 |
+
"type": "git",
|
| 9 |
+
"url": "https://github.com/babel/babel.git",
|
| 10 |
+
"directory": "packages/babel-helper-compilation-targets"
|
| 11 |
+
},
|
| 12 |
+
"main": "./lib/index.js",
|
| 13 |
+
"exports": {
|
| 14 |
+
".": {
|
| 15 |
+
"types": "./lib/index.d.ts",
|
| 16 |
+
"default": "./lib/index.js"
|
| 17 |
+
},
|
| 18 |
+
"./package.json": "./package.json"
|
| 19 |
+
},
|
| 20 |
+
"publishConfig": {
|
| 21 |
+
"access": "public"
|
| 22 |
+
},
|
| 23 |
+
"keywords": [
|
| 24 |
+
"babel",
|
| 25 |
+
"babel-plugin"
|
| 26 |
+
],
|
| 27 |
+
"dependencies": {
|
| 28 |
+
"@babel/compat-data": "^7.29.7",
|
| 29 |
+
"@babel/helper-validator-option": "^7.29.7",
|
| 30 |
+
"browserslist": "^4.24.0",
|
| 31 |
+
"lru-cache": "^5.1.1",
|
| 32 |
+
"semver": "^6.3.1"
|
| 33 |
+
},
|
| 34 |
+
"devDependencies": {
|
| 35 |
+
"@babel/helper-plugin-test-runner": "^7.29.7",
|
| 36 |
+
"@types/lru-cache": "^5.1.1",
|
| 37 |
+
"@types/semver": "^5.5.0"
|
| 38 |
+
},
|
| 39 |
+
"engines": {
|
| 40 |
+
"node": ">=6.9.0"
|
| 41 |
+
},
|
| 42 |
+
"type": "commonjs"
|
| 43 |
+
}
|
node_modules/@babel/helper-globals/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/helper-globals/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/helper-globals
|
| 2 |
+
|
| 3 |
+
> A collection of JavaScript globals for Babel internal usage
|
| 4 |
+
|
| 5 |
+
See our website [@babel/helper-globals](https://babeljs.io/docs/babel-helper-globals) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save @babel/helper-globals
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/helper-globals
|
| 19 |
+
```
|
node_modules/@babel/helper-globals/data/browser-upper.json
ADDED
|
@@ -0,0 +1,911 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
+
"AnimationPlaybackEvent",
|
| 15 |
+
"AnimationTimeline",
|
| 16 |
+
"AsyncDisposableStack",
|
| 17 |
+
"Attr",
|
| 18 |
+
"Audio",
|
| 19 |
+
"AudioBuffer",
|
| 20 |
+
"AudioBufferSourceNode",
|
| 21 |
+
"AudioContext",
|
| 22 |
+
"AudioData",
|
| 23 |
+
"AudioDecoder",
|
| 24 |
+
"AudioDestinationNode",
|
| 25 |
+
"AudioEncoder",
|
| 26 |
+
"AudioListener",
|
| 27 |
+
"AudioNode",
|
| 28 |
+
"AudioParam",
|
| 29 |
+
"AudioParamMap",
|
| 30 |
+
"AudioProcessingEvent",
|
| 31 |
+
"AudioScheduledSourceNode",
|
| 32 |
+
"AudioSinkInfo",
|
| 33 |
+
"AudioWorklet",
|
| 34 |
+
"AudioWorkletGlobalScope",
|
| 35 |
+
"AudioWorkletNode",
|
| 36 |
+
"AudioWorkletProcessor",
|
| 37 |
+
"AuthenticatorAssertionResponse",
|
| 38 |
+
"AuthenticatorAttestationResponse",
|
| 39 |
+
"AuthenticatorResponse",
|
| 40 |
+
"BackgroundFetchManager",
|
| 41 |
+
"BackgroundFetchRecord",
|
| 42 |
+
"BackgroundFetchRegistration",
|
| 43 |
+
"BarcodeDetector",
|
| 44 |
+
"BarProp",
|
| 45 |
+
"BaseAudioContext",
|
| 46 |
+
"BatteryManager",
|
| 47 |
+
"BeforeUnloadEvent",
|
| 48 |
+
"BiquadFilterNode",
|
| 49 |
+
"Blob",
|
| 50 |
+
"BlobEvent",
|
| 51 |
+
"Bluetooth",
|
| 52 |
+
"BluetoothCharacteristicProperties",
|
| 53 |
+
"BluetoothDevice",
|
| 54 |
+
"BluetoothRemoteGATTCharacteristic",
|
| 55 |
+
"BluetoothRemoteGATTDescriptor",
|
| 56 |
+
"BluetoothRemoteGATTServer",
|
| 57 |
+
"BluetoothRemoteGATTService",
|
| 58 |
+
"BluetoothUUID",
|
| 59 |
+
"BroadcastChannel",
|
| 60 |
+
"BrowserCaptureMediaStreamTrack",
|
| 61 |
+
"ByteLengthQueuingStrategy",
|
| 62 |
+
"Cache",
|
| 63 |
+
"CacheStorage",
|
| 64 |
+
"CanvasCaptureMediaStream",
|
| 65 |
+
"CanvasCaptureMediaStreamTrack",
|
| 66 |
+
"CanvasGradient",
|
| 67 |
+
"CanvasPattern",
|
| 68 |
+
"CanvasRenderingContext2D",
|
| 69 |
+
"CaptureController",
|
| 70 |
+
"CaretPosition",
|
| 71 |
+
"CDATASection",
|
| 72 |
+
"ChannelMergerNode",
|
| 73 |
+
"ChannelSplitterNode",
|
| 74 |
+
"ChapterInformation",
|
| 75 |
+
"CharacterBoundsUpdateEvent",
|
| 76 |
+
"CharacterData",
|
| 77 |
+
"Clipboard",
|
| 78 |
+
"ClipboardEvent",
|
| 79 |
+
"ClipboardItem",
|
| 80 |
+
"CloseEvent",
|
| 81 |
+
"CloseWatcher",
|
| 82 |
+
"CommandEvent",
|
| 83 |
+
"Comment",
|
| 84 |
+
"CompositionEvent",
|
| 85 |
+
"CompressionStream",
|
| 86 |
+
"ConstantSourceNode",
|
| 87 |
+
"ContentVisibilityAutoStateChangeEvent",
|
| 88 |
+
"ConvolverNode",
|
| 89 |
+
"CookieChangeEvent",
|
| 90 |
+
"CookieDeprecationLabel",
|
| 91 |
+
"CookieStore",
|
| 92 |
+
"CookieStoreManager",
|
| 93 |
+
"CountQueuingStrategy",
|
| 94 |
+
"Credential",
|
| 95 |
+
"CredentialsContainer",
|
| 96 |
+
"CropTarget",
|
| 97 |
+
"Crypto",
|
| 98 |
+
"CryptoKey",
|
| 99 |
+
"CSPViolationReportBody",
|
| 100 |
+
"CSS",
|
| 101 |
+
"CSSAnimation",
|
| 102 |
+
"CSSConditionRule",
|
| 103 |
+
"CSSContainerRule",
|
| 104 |
+
"CSSCounterStyleRule",
|
| 105 |
+
"CSSFontFaceRule",
|
| 106 |
+
"CSSFontFeatureValuesRule",
|
| 107 |
+
"CSSFontPaletteValuesRule",
|
| 108 |
+
"CSSGroupingRule",
|
| 109 |
+
"CSSImageValue",
|
| 110 |
+
"CSSImportRule",
|
| 111 |
+
"CSSKeyframeRule",
|
| 112 |
+
"CSSKeyframesRule",
|
| 113 |
+
"CSSKeywordValue",
|
| 114 |
+
"CSSLayerBlockRule",
|
| 115 |
+
"CSSLayerStatementRule",
|
| 116 |
+
"CSSMarginRule",
|
| 117 |
+
"CSSMathClamp",
|
| 118 |
+
"CSSMathInvert",
|
| 119 |
+
"CSSMathMax",
|
| 120 |
+
"CSSMathMin",
|
| 121 |
+
"CSSMathNegate",
|
| 122 |
+
"CSSMathProduct",
|
| 123 |
+
"CSSMathSum",
|
| 124 |
+
"CSSMathValue",
|
| 125 |
+
"CSSMatrixComponent",
|
| 126 |
+
"CSSMediaRule",
|
| 127 |
+
"CSSNamespaceRule",
|
| 128 |
+
"CSSNestedDeclarations",
|
| 129 |
+
"CSSNumericArray",
|
| 130 |
+
"CSSNumericValue",
|
| 131 |
+
"CSSPageDescriptors",
|
| 132 |
+
"CSSPageRule",
|
| 133 |
+
"CSSPerspective",
|
| 134 |
+
"CSSPositionTryDescriptors",
|
| 135 |
+
"CSSPositionTryRule",
|
| 136 |
+
"CSSPositionValue",
|
| 137 |
+
"CSSPropertyRule",
|
| 138 |
+
"CSSRotate",
|
| 139 |
+
"CSSRule",
|
| 140 |
+
"CSSRuleList",
|
| 141 |
+
"CSSScale",
|
| 142 |
+
"CSSScopeRule",
|
| 143 |
+
"CSSSkew",
|
| 144 |
+
"CSSSkewX",
|
| 145 |
+
"CSSSkewY",
|
| 146 |
+
"CSSStartingStyleRule",
|
| 147 |
+
"CSSStyleDeclaration",
|
| 148 |
+
"CSSStyleRule",
|
| 149 |
+
"CSSStyleSheet",
|
| 150 |
+
"CSSStyleValue",
|
| 151 |
+
"CSSSupportsRule",
|
| 152 |
+
"CSSTransformComponent",
|
| 153 |
+
"CSSTransformValue",
|
| 154 |
+
"CSSTransition",
|
| 155 |
+
"CSSTranslate",
|
| 156 |
+
"CSSUnitValue",
|
| 157 |
+
"CSSUnparsedValue",
|
| 158 |
+
"CSSVariableReferenceValue",
|
| 159 |
+
"CSSViewTransitionRule",
|
| 160 |
+
"CustomElementRegistry",
|
| 161 |
+
"CustomEvent",
|
| 162 |
+
"CustomStateSet",
|
| 163 |
+
"DataTransfer",
|
| 164 |
+
"DataTransferItem",
|
| 165 |
+
"DataTransferItemList",
|
| 166 |
+
"DecompressionStream",
|
| 167 |
+
"DelayNode",
|
| 168 |
+
"DelegatedInkTrailPresenter",
|
| 169 |
+
"DeviceMotionEvent",
|
| 170 |
+
"DeviceMotionEventAcceleration",
|
| 171 |
+
"DeviceMotionEventRotationRate",
|
| 172 |
+
"DeviceOrientationEvent",
|
| 173 |
+
"DevicePosture",
|
| 174 |
+
"DisposableStack",
|
| 175 |
+
"Document",
|
| 176 |
+
"DocumentFragment",
|
| 177 |
+
"DocumentPictureInPicture",
|
| 178 |
+
"DocumentPictureInPictureEvent",
|
| 179 |
+
"DocumentTimeline",
|
| 180 |
+
"DocumentType",
|
| 181 |
+
"DOMError",
|
| 182 |
+
"DOMException",
|
| 183 |
+
"DOMImplementation",
|
| 184 |
+
"DOMMatrix",
|
| 185 |
+
"DOMMatrixReadOnly",
|
| 186 |
+
"DOMParser",
|
| 187 |
+
"DOMPoint",
|
| 188 |
+
"DOMPointReadOnly",
|
| 189 |
+
"DOMQuad",
|
| 190 |
+
"DOMRect",
|
| 191 |
+
"DOMRectList",
|
| 192 |
+
"DOMRectReadOnly",
|
| 193 |
+
"DOMStringList",
|
| 194 |
+
"DOMStringMap",
|
| 195 |
+
"DOMTokenList",
|
| 196 |
+
"DragEvent",
|
| 197 |
+
"DynamicsCompressorNode",
|
| 198 |
+
"EditContext",
|
| 199 |
+
"Element",
|
| 200 |
+
"ElementInternals",
|
| 201 |
+
"EncodedAudioChunk",
|
| 202 |
+
"EncodedVideoChunk",
|
| 203 |
+
"ErrorEvent",
|
| 204 |
+
"Event",
|
| 205 |
+
"EventCounts",
|
| 206 |
+
"EventSource",
|
| 207 |
+
"EventTarget",
|
| 208 |
+
"External",
|
| 209 |
+
"EyeDropper",
|
| 210 |
+
"FeaturePolicy",
|
| 211 |
+
"FederatedCredential",
|
| 212 |
+
"Fence",
|
| 213 |
+
"FencedFrameConfig",
|
| 214 |
+
"FetchLaterResult",
|
| 215 |
+
"File",
|
| 216 |
+
"FileList",
|
| 217 |
+
"FileReader",
|
| 218 |
+
"FileSystem",
|
| 219 |
+
"FileSystemDirectoryEntry",
|
| 220 |
+
"FileSystemDirectoryHandle",
|
| 221 |
+
"FileSystemDirectoryReader",
|
| 222 |
+
"FileSystemEntry",
|
| 223 |
+
"FileSystemFileEntry",
|
| 224 |
+
"FileSystemFileHandle",
|
| 225 |
+
"FileSystemHandle",
|
| 226 |
+
"FileSystemObserver",
|
| 227 |
+
"FileSystemWritableFileStream",
|
| 228 |
+
"FocusEvent",
|
| 229 |
+
"FontData",
|
| 230 |
+
"FontFace",
|
| 231 |
+
"FontFaceSet",
|
| 232 |
+
"FontFaceSetLoadEvent",
|
| 233 |
+
"FormData",
|
| 234 |
+
"FormDataEvent",
|
| 235 |
+
"FragmentDirective",
|
| 236 |
+
"GainNode",
|
| 237 |
+
"Gamepad",
|
| 238 |
+
"GamepadAxisMoveEvent",
|
| 239 |
+
"GamepadButton",
|
| 240 |
+
"GamepadButtonEvent",
|
| 241 |
+
"GamepadEvent",
|
| 242 |
+
"GamepadHapticActuator",
|
| 243 |
+
"GamepadPose",
|
| 244 |
+
"Geolocation",
|
| 245 |
+
"GeolocationCoordinates",
|
| 246 |
+
"GeolocationPosition",
|
| 247 |
+
"GeolocationPositionError",
|
| 248 |
+
"GPU",
|
| 249 |
+
"GPUAdapter",
|
| 250 |
+
"GPUAdapterInfo",
|
| 251 |
+
"GPUBindGroup",
|
| 252 |
+
"GPUBindGroupLayout",
|
| 253 |
+
"GPUBuffer",
|
| 254 |
+
"GPUBufferUsage",
|
| 255 |
+
"GPUCanvasContext",
|
| 256 |
+
"GPUColorWrite",
|
| 257 |
+
"GPUCommandBuffer",
|
| 258 |
+
"GPUCommandEncoder",
|
| 259 |
+
"GPUCompilationInfo",
|
| 260 |
+
"GPUCompilationMessage",
|
| 261 |
+
"GPUComputePassEncoder",
|
| 262 |
+
"GPUComputePipeline",
|
| 263 |
+
"GPUDevice",
|
| 264 |
+
"GPUDeviceLostInfo",
|
| 265 |
+
"GPUError",
|
| 266 |
+
"GPUExternalTexture",
|
| 267 |
+
"GPUInternalError",
|
| 268 |
+
"GPUMapMode",
|
| 269 |
+
"GPUOutOfMemoryError",
|
| 270 |
+
"GPUPipelineError",
|
| 271 |
+
"GPUPipelineLayout",
|
| 272 |
+
"GPUQuerySet",
|
| 273 |
+
"GPUQueue",
|
| 274 |
+
"GPURenderBundle",
|
| 275 |
+
"GPURenderBundleEncoder",
|
| 276 |
+
"GPURenderPassEncoder",
|
| 277 |
+
"GPURenderPipeline",
|
| 278 |
+
"GPUSampler",
|
| 279 |
+
"GPUShaderModule",
|
| 280 |
+
"GPUShaderStage",
|
| 281 |
+
"GPUSupportedFeatures",
|
| 282 |
+
"GPUSupportedLimits",
|
| 283 |
+
"GPUTexture",
|
| 284 |
+
"GPUTextureUsage",
|
| 285 |
+
"GPUTextureView",
|
| 286 |
+
"GPUUncapturedErrorEvent",
|
| 287 |
+
"GPUValidationError",
|
| 288 |
+
"GravitySensor",
|
| 289 |
+
"Gyroscope",
|
| 290 |
+
"HashChangeEvent",
|
| 291 |
+
"Headers",
|
| 292 |
+
"HID",
|
| 293 |
+
"HIDConnectionEvent",
|
| 294 |
+
"HIDDevice",
|
| 295 |
+
"HIDInputReportEvent",
|
| 296 |
+
"Highlight",
|
| 297 |
+
"HighlightRegistry",
|
| 298 |
+
"History",
|
| 299 |
+
"HTMLAllCollection",
|
| 300 |
+
"HTMLAnchorElement",
|
| 301 |
+
"HTMLAreaElement",
|
| 302 |
+
"HTMLAudioElement",
|
| 303 |
+
"HTMLBaseElement",
|
| 304 |
+
"HTMLBodyElement",
|
| 305 |
+
"HTMLBRElement",
|
| 306 |
+
"HTMLButtonElement",
|
| 307 |
+
"HTMLCanvasElement",
|
| 308 |
+
"HTMLCollection",
|
| 309 |
+
"HTMLDataElement",
|
| 310 |
+
"HTMLDataListElement",
|
| 311 |
+
"HTMLDetailsElement",
|
| 312 |
+
"HTMLDialogElement",
|
| 313 |
+
"HTMLDirectoryElement",
|
| 314 |
+
"HTMLDivElement",
|
| 315 |
+
"HTMLDListElement",
|
| 316 |
+
"HTMLDocument",
|
| 317 |
+
"HTMLElement",
|
| 318 |
+
"HTMLEmbedElement",
|
| 319 |
+
"HTMLFencedFrameElement",
|
| 320 |
+
"HTMLFieldSetElement",
|
| 321 |
+
"HTMLFontElement",
|
| 322 |
+
"HTMLFormControlsCollection",
|
| 323 |
+
"HTMLFormElement",
|
| 324 |
+
"HTMLFrameElement",
|
| 325 |
+
"HTMLFrameSetElement",
|
| 326 |
+
"HTMLHeadElement",
|
| 327 |
+
"HTMLHeadingElement",
|
| 328 |
+
"HTMLHRElement",
|
| 329 |
+
"HTMLHtmlElement",
|
| 330 |
+
"HTMLIFrameElement",
|
| 331 |
+
"HTMLImageElement",
|
| 332 |
+
"HTMLInputElement",
|
| 333 |
+
"HTMLLabelElement",
|
| 334 |
+
"HTMLLegendElement",
|
| 335 |
+
"HTMLLIElement",
|
| 336 |
+
"HTMLLinkElement",
|
| 337 |
+
"HTMLMapElement",
|
| 338 |
+
"HTMLMarqueeElement",
|
| 339 |
+
"HTMLMediaElement",
|
| 340 |
+
"HTMLMenuElement",
|
| 341 |
+
"HTMLMetaElement",
|
| 342 |
+
"HTMLMeterElement",
|
| 343 |
+
"HTMLModElement",
|
| 344 |
+
"HTMLObjectElement",
|
| 345 |
+
"HTMLOListElement",
|
| 346 |
+
"HTMLOptGroupElement",
|
| 347 |
+
"HTMLOptionElement",
|
| 348 |
+
"HTMLOptionsCollection",
|
| 349 |
+
"HTMLOutputElement",
|
| 350 |
+
"HTMLParagraphElement",
|
| 351 |
+
"HTMLParamElement",
|
| 352 |
+
"HTMLPictureElement",
|
| 353 |
+
"HTMLPreElement",
|
| 354 |
+
"HTMLProgressElement",
|
| 355 |
+
"HTMLQuoteElement",
|
| 356 |
+
"HTMLScriptElement",
|
| 357 |
+
"HTMLSelectedContentElement",
|
| 358 |
+
"HTMLSelectElement",
|
| 359 |
+
"HTMLSlotElement",
|
| 360 |
+
"HTMLSourceElement",
|
| 361 |
+
"HTMLSpanElement",
|
| 362 |
+
"HTMLStyleElement",
|
| 363 |
+
"HTMLTableCaptionElement",
|
| 364 |
+
"HTMLTableCellElement",
|
| 365 |
+
"HTMLTableColElement",
|
| 366 |
+
"HTMLTableElement",
|
| 367 |
+
"HTMLTableRowElement",
|
| 368 |
+
"HTMLTableSectionElement",
|
| 369 |
+
"HTMLTemplateElement",
|
| 370 |
+
"HTMLTextAreaElement",
|
| 371 |
+
"HTMLTimeElement",
|
| 372 |
+
"HTMLTitleElement",
|
| 373 |
+
"HTMLTrackElement",
|
| 374 |
+
"HTMLUListElement",
|
| 375 |
+
"HTMLUnknownElement",
|
| 376 |
+
"HTMLVideoElement",
|
| 377 |
+
"IDBCursor",
|
| 378 |
+
"IDBCursorWithValue",
|
| 379 |
+
"IDBDatabase",
|
| 380 |
+
"IDBFactory",
|
| 381 |
+
"IDBIndex",
|
| 382 |
+
"IDBKeyRange",
|
| 383 |
+
"IDBObjectStore",
|
| 384 |
+
"IDBOpenDBRequest",
|
| 385 |
+
"IDBRequest",
|
| 386 |
+
"IDBTransaction",
|
| 387 |
+
"IDBVersionChangeEvent",
|
| 388 |
+
"IdentityCredential",
|
| 389 |
+
"IdentityCredentialError",
|
| 390 |
+
"IdentityProvider",
|
| 391 |
+
"IdleDeadline",
|
| 392 |
+
"IdleDetector",
|
| 393 |
+
"IIRFilterNode",
|
| 394 |
+
"Image",
|
| 395 |
+
"ImageBitmap",
|
| 396 |
+
"ImageBitmapRenderingContext",
|
| 397 |
+
"ImageCapture",
|
| 398 |
+
"ImageData",
|
| 399 |
+
"ImageDecoder",
|
| 400 |
+
"ImageTrack",
|
| 401 |
+
"ImageTrackList",
|
| 402 |
+
"Ink",
|
| 403 |
+
"InputDeviceCapabilities",
|
| 404 |
+
"InputDeviceInfo",
|
| 405 |
+
"InputEvent",
|
| 406 |
+
"IntersectionObserver",
|
| 407 |
+
"IntersectionObserverEntry",
|
| 408 |
+
"Keyboard",
|
| 409 |
+
"KeyboardEvent",
|
| 410 |
+
"KeyboardLayoutMap",
|
| 411 |
+
"KeyframeEffect",
|
| 412 |
+
"LanguageDetector",
|
| 413 |
+
"LargestContentfulPaint",
|
| 414 |
+
"LaunchParams",
|
| 415 |
+
"LaunchQueue",
|
| 416 |
+
"LayoutShift",
|
| 417 |
+
"LayoutShiftAttribution",
|
| 418 |
+
"LinearAccelerationSensor",
|
| 419 |
+
"Location",
|
| 420 |
+
"Lock",
|
| 421 |
+
"LockManager",
|
| 422 |
+
"MathMLElement",
|
| 423 |
+
"MediaCapabilities",
|
| 424 |
+
"MediaCapabilitiesInfo",
|
| 425 |
+
"MediaDeviceInfo",
|
| 426 |
+
"MediaDevices",
|
| 427 |
+
"MediaElementAudioSourceNode",
|
| 428 |
+
"MediaEncryptedEvent",
|
| 429 |
+
"MediaError",
|
| 430 |
+
"MediaKeyError",
|
| 431 |
+
"MediaKeyMessageEvent",
|
| 432 |
+
"MediaKeys",
|
| 433 |
+
"MediaKeySession",
|
| 434 |
+
"MediaKeyStatusMap",
|
| 435 |
+
"MediaKeySystemAccess",
|
| 436 |
+
"MediaList",
|
| 437 |
+
"MediaMetadata",
|
| 438 |
+
"MediaQueryList",
|
| 439 |
+
"MediaQueryListEvent",
|
| 440 |
+
"MediaRecorder",
|
| 441 |
+
"MediaRecorderErrorEvent",
|
| 442 |
+
"MediaSession",
|
| 443 |
+
"MediaSource",
|
| 444 |
+
"MediaSourceHandle",
|
| 445 |
+
"MediaStream",
|
| 446 |
+
"MediaStreamAudioDestinationNode",
|
| 447 |
+
"MediaStreamAudioSourceNode",
|
| 448 |
+
"MediaStreamEvent",
|
| 449 |
+
"MediaStreamTrack",
|
| 450 |
+
"MediaStreamTrackAudioSourceNode",
|
| 451 |
+
"MediaStreamTrackAudioStats",
|
| 452 |
+
"MediaStreamTrackEvent",
|
| 453 |
+
"MediaStreamTrackGenerator",
|
| 454 |
+
"MediaStreamTrackProcessor",
|
| 455 |
+
"MediaStreamTrackVideoStats",
|
| 456 |
+
"MessageChannel",
|
| 457 |
+
"MessageEvent",
|
| 458 |
+
"MessagePort",
|
| 459 |
+
"MIDIAccess",
|
| 460 |
+
"MIDIConnectionEvent",
|
| 461 |
+
"MIDIInput",
|
| 462 |
+
"MIDIInputMap",
|
| 463 |
+
"MIDIMessageEvent",
|
| 464 |
+
"MIDIOutput",
|
| 465 |
+
"MIDIOutputMap",
|
| 466 |
+
"MIDIPort",
|
| 467 |
+
"MimeType",
|
| 468 |
+
"MimeTypeArray",
|
| 469 |
+
"ModelGenericSession",
|
| 470 |
+
"ModelManager",
|
| 471 |
+
"MouseEvent",
|
| 472 |
+
"MutationEvent",
|
| 473 |
+
"MutationObserver",
|
| 474 |
+
"MutationRecord",
|
| 475 |
+
"NamedNodeMap",
|
| 476 |
+
"NavigateEvent",
|
| 477 |
+
"Navigation",
|
| 478 |
+
"NavigationActivation",
|
| 479 |
+
"NavigationCurrentEntryChangeEvent",
|
| 480 |
+
"NavigationDestination",
|
| 481 |
+
"NavigationHistoryEntry",
|
| 482 |
+
"NavigationPreloadManager",
|
| 483 |
+
"NavigationTransition",
|
| 484 |
+
"Navigator",
|
| 485 |
+
"NavigatorLogin",
|
| 486 |
+
"NavigatorManagedData",
|
| 487 |
+
"NavigatorUAData",
|
| 488 |
+
"NetworkInformation",
|
| 489 |
+
"Node",
|
| 490 |
+
"NodeFilter",
|
| 491 |
+
"NodeIterator",
|
| 492 |
+
"NodeList",
|
| 493 |
+
"Notification",
|
| 494 |
+
"NotifyPaintEvent",
|
| 495 |
+
"NotRestoredReasonDetails",
|
| 496 |
+
"NotRestoredReasons",
|
| 497 |
+
"Observable",
|
| 498 |
+
"OfflineAudioCompletionEvent",
|
| 499 |
+
"OfflineAudioContext",
|
| 500 |
+
"OffscreenCanvas",
|
| 501 |
+
"OffscreenCanvasRenderingContext2D",
|
| 502 |
+
"Option",
|
| 503 |
+
"OrientationSensor",
|
| 504 |
+
"OscillatorNode",
|
| 505 |
+
"OTPCredential",
|
| 506 |
+
"OverconstrainedError",
|
| 507 |
+
"PageRevealEvent",
|
| 508 |
+
"PageSwapEvent",
|
| 509 |
+
"PageTransitionEvent",
|
| 510 |
+
"PannerNode",
|
| 511 |
+
"PasswordCredential",
|
| 512 |
+
"Path2D",
|
| 513 |
+
"PaymentAddress",
|
| 514 |
+
"PaymentManager",
|
| 515 |
+
"PaymentMethodChangeEvent",
|
| 516 |
+
"PaymentRequest",
|
| 517 |
+
"PaymentRequestUpdateEvent",
|
| 518 |
+
"PaymentResponse",
|
| 519 |
+
"Performance",
|
| 520 |
+
"PerformanceElementTiming",
|
| 521 |
+
"PerformanceEntry",
|
| 522 |
+
"PerformanceEventTiming",
|
| 523 |
+
"PerformanceLongAnimationFrameTiming",
|
| 524 |
+
"PerformanceLongTaskTiming",
|
| 525 |
+
"PerformanceMark",
|
| 526 |
+
"PerformanceMeasure",
|
| 527 |
+
"PerformanceNavigation",
|
| 528 |
+
"PerformanceNavigationTiming",
|
| 529 |
+
"PerformanceObserver",
|
| 530 |
+
"PerformanceObserverEntryList",
|
| 531 |
+
"PerformancePaintTiming",
|
| 532 |
+
"PerformanceResourceTiming",
|
| 533 |
+
"PerformanceScriptTiming",
|
| 534 |
+
"PerformanceServerTiming",
|
| 535 |
+
"PerformanceTiming",
|
| 536 |
+
"PeriodicSyncManager",
|
| 537 |
+
"PeriodicWave",
|
| 538 |
+
"Permissions",
|
| 539 |
+
"PermissionStatus",
|
| 540 |
+
"PERSISTENT",
|
| 541 |
+
"PictureInPictureEvent",
|
| 542 |
+
"PictureInPictureWindow",
|
| 543 |
+
"Plugin",
|
| 544 |
+
"PluginArray",
|
| 545 |
+
"PointerEvent",
|
| 546 |
+
"PopStateEvent",
|
| 547 |
+
"Presentation",
|
| 548 |
+
"PresentationAvailability",
|
| 549 |
+
"PresentationConnection",
|
| 550 |
+
"PresentationConnectionAvailableEvent",
|
| 551 |
+
"PresentationConnectionCloseEvent",
|
| 552 |
+
"PresentationConnectionList",
|
| 553 |
+
"PresentationReceiver",
|
| 554 |
+
"PresentationRequest",
|
| 555 |
+
"PressureObserver",
|
| 556 |
+
"PressureRecord",
|
| 557 |
+
"ProcessingInstruction",
|
| 558 |
+
"Profiler",
|
| 559 |
+
"ProgressEvent",
|
| 560 |
+
"PromiseRejectionEvent",
|
| 561 |
+
"ProtectedAudience",
|
| 562 |
+
"PublicKeyCredential",
|
| 563 |
+
"PushManager",
|
| 564 |
+
"PushSubscription",
|
| 565 |
+
"PushSubscriptionOptions",
|
| 566 |
+
"RadioNodeList",
|
| 567 |
+
"Range",
|
| 568 |
+
"ReadableByteStreamController",
|
| 569 |
+
"ReadableStream",
|
| 570 |
+
"ReadableStreamBYOBReader",
|
| 571 |
+
"ReadableStreamBYOBRequest",
|
| 572 |
+
"ReadableStreamDefaultController",
|
| 573 |
+
"ReadableStreamDefaultReader",
|
| 574 |
+
"RelativeOrientationSensor",
|
| 575 |
+
"RemotePlayback",
|
| 576 |
+
"ReportBody",
|
| 577 |
+
"ReportingObserver",
|
| 578 |
+
"Request",
|
| 579 |
+
"ResizeObserver",
|
| 580 |
+
"ResizeObserverEntry",
|
| 581 |
+
"ResizeObserverSize",
|
| 582 |
+
"Response",
|
| 583 |
+
"RestrictionTarget",
|
| 584 |
+
"RTCCertificate",
|
| 585 |
+
"RTCDataChannel",
|
| 586 |
+
"RTCDataChannelEvent",
|
| 587 |
+
"RTCDtlsTransport",
|
| 588 |
+
"RTCDTMFSender",
|
| 589 |
+
"RTCDTMFToneChangeEvent",
|
| 590 |
+
"RTCEncodedAudioFrame",
|
| 591 |
+
"RTCEncodedVideoFrame",
|
| 592 |
+
"RTCError",
|
| 593 |
+
"RTCErrorEvent",
|
| 594 |
+
"RTCIceCandidate",
|
| 595 |
+
"RTCIceTransport",
|
| 596 |
+
"RTCPeerConnection",
|
| 597 |
+
"RTCPeerConnectionIceErrorEvent",
|
| 598 |
+
"RTCPeerConnectionIceEvent",
|
| 599 |
+
"RTCRtpReceiver",
|
| 600 |
+
"RTCRtpScriptTransform",
|
| 601 |
+
"RTCRtpSender",
|
| 602 |
+
"RTCRtpTransceiver",
|
| 603 |
+
"RTCSctpTransport",
|
| 604 |
+
"RTCSessionDescription",
|
| 605 |
+
"RTCStatsReport",
|
| 606 |
+
"RTCTrackEvent",
|
| 607 |
+
"Scheduler",
|
| 608 |
+
"Scheduling",
|
| 609 |
+
"Screen",
|
| 610 |
+
"ScreenDetailed",
|
| 611 |
+
"ScreenDetails",
|
| 612 |
+
"ScreenOrientation",
|
| 613 |
+
"ScriptProcessorNode",
|
| 614 |
+
"ScrollTimeline",
|
| 615 |
+
"SecurityPolicyViolationEvent",
|
| 616 |
+
"Selection",
|
| 617 |
+
"Sensor",
|
| 618 |
+
"SensorErrorEvent",
|
| 619 |
+
"Serial",
|
| 620 |
+
"SerialPort",
|
| 621 |
+
"ServiceWorker",
|
| 622 |
+
"ServiceWorkerContainer",
|
| 623 |
+
"ServiceWorkerRegistration",
|
| 624 |
+
"ShadowRoot",
|
| 625 |
+
"SharedStorage",
|
| 626 |
+
"SharedStorageAppendMethod",
|
| 627 |
+
"SharedStorageClearMethod",
|
| 628 |
+
"SharedStorageDeleteMethod",
|
| 629 |
+
"SharedStorageModifierMethod",
|
| 630 |
+
"SharedStorageSetMethod",
|
| 631 |
+
"SharedStorageWorklet",
|
| 632 |
+
"SharedWorker",
|
| 633 |
+
"SnapEvent",
|
| 634 |
+
"SourceBuffer",
|
| 635 |
+
"SourceBufferList",
|
| 636 |
+
"SpeechSynthesis",
|
| 637 |
+
"SpeechSynthesisErrorEvent",
|
| 638 |
+
"SpeechSynthesisEvent",
|
| 639 |
+
"SpeechSynthesisUtterance",
|
| 640 |
+
"SpeechSynthesisVoice",
|
| 641 |
+
"StaticRange",
|
| 642 |
+
"StereoPannerNode",
|
| 643 |
+
"Storage",
|
| 644 |
+
"StorageBucket",
|
| 645 |
+
"StorageBucketManager",
|
| 646 |
+
"StorageEvent",
|
| 647 |
+
"StorageManager",
|
| 648 |
+
"StylePropertyMap",
|
| 649 |
+
"StylePropertyMapReadOnly",
|
| 650 |
+
"StyleSheet",
|
| 651 |
+
"StyleSheetList",
|
| 652 |
+
"SubmitEvent",
|
| 653 |
+
"Subscriber",
|
| 654 |
+
"SubtleCrypto",
|
| 655 |
+
"SuppressedError",
|
| 656 |
+
"SVGAElement",
|
| 657 |
+
"SVGAngle",
|
| 658 |
+
"SVGAnimatedAngle",
|
| 659 |
+
"SVGAnimatedBoolean",
|
| 660 |
+
"SVGAnimatedEnumeration",
|
| 661 |
+
"SVGAnimatedInteger",
|
| 662 |
+
"SVGAnimatedLength",
|
| 663 |
+
"SVGAnimatedLengthList",
|
| 664 |
+
"SVGAnimatedNumber",
|
| 665 |
+
"SVGAnimatedNumberList",
|
| 666 |
+
"SVGAnimatedPreserveAspectRatio",
|
| 667 |
+
"SVGAnimatedRect",
|
| 668 |
+
"SVGAnimatedString",
|
| 669 |
+
"SVGAnimatedTransformList",
|
| 670 |
+
"SVGAnimateElement",
|
| 671 |
+
"SVGAnimateMotionElement",
|
| 672 |
+
"SVGAnimateTransformElement",
|
| 673 |
+
"SVGAnimationElement",
|
| 674 |
+
"SVGCircleElement",
|
| 675 |
+
"SVGClipPathElement",
|
| 676 |
+
"SVGComponentTransferFunctionElement",
|
| 677 |
+
"SVGDefsElement",
|
| 678 |
+
"SVGDescElement",
|
| 679 |
+
"SVGElement",
|
| 680 |
+
"SVGEllipseElement",
|
| 681 |
+
"SVGFEBlendElement",
|
| 682 |
+
"SVGFEColorMatrixElement",
|
| 683 |
+
"SVGFEComponentTransferElement",
|
| 684 |
+
"SVGFECompositeElement",
|
| 685 |
+
"SVGFEConvolveMatrixElement",
|
| 686 |
+
"SVGFEDiffuseLightingElement",
|
| 687 |
+
"SVGFEDisplacementMapElement",
|
| 688 |
+
"SVGFEDistantLightElement",
|
| 689 |
+
"SVGFEDropShadowElement",
|
| 690 |
+
"SVGFEFloodElement",
|
| 691 |
+
"SVGFEFuncAElement",
|
| 692 |
+
"SVGFEFuncBElement",
|
| 693 |
+
"SVGFEFuncGElement",
|
| 694 |
+
"SVGFEFuncRElement",
|
| 695 |
+
"SVGFEGaussianBlurElement",
|
| 696 |
+
"SVGFEImageElement",
|
| 697 |
+
"SVGFEMergeElement",
|
| 698 |
+
"SVGFEMergeNodeElement",
|
| 699 |
+
"SVGFEMorphologyElement",
|
| 700 |
+
"SVGFEOffsetElement",
|
| 701 |
+
"SVGFEPointLightElement",
|
| 702 |
+
"SVGFESpecularLightingElement",
|
| 703 |
+
"SVGFESpotLightElement",
|
| 704 |
+
"SVGFETileElement",
|
| 705 |
+
"SVGFETurbulenceElement",
|
| 706 |
+
"SVGFilterElement",
|
| 707 |
+
"SVGForeignObjectElement",
|
| 708 |
+
"SVGGElement",
|
| 709 |
+
"SVGGeometryElement",
|
| 710 |
+
"SVGGradientElement",
|
| 711 |
+
"SVGGraphicsElement",
|
| 712 |
+
"SVGImageElement",
|
| 713 |
+
"SVGLength",
|
| 714 |
+
"SVGLengthList",
|
| 715 |
+
"SVGLinearGradientElement",
|
| 716 |
+
"SVGLineElement",
|
| 717 |
+
"SVGMarkerElement",
|
| 718 |
+
"SVGMaskElement",
|
| 719 |
+
"SVGMatrix",
|
| 720 |
+
"SVGMetadataElement",
|
| 721 |
+
"SVGMPathElement",
|
| 722 |
+
"SVGNumber",
|
| 723 |
+
"SVGNumberList",
|
| 724 |
+
"SVGPathElement",
|
| 725 |
+
"SVGPatternElement",
|
| 726 |
+
"SVGPoint",
|
| 727 |
+
"SVGPointList",
|
| 728 |
+
"SVGPolygonElement",
|
| 729 |
+
"SVGPolylineElement",
|
| 730 |
+
"SVGPreserveAspectRatio",
|
| 731 |
+
"SVGRadialGradientElement",
|
| 732 |
+
"SVGRect",
|
| 733 |
+
"SVGRectElement",
|
| 734 |
+
"SVGScriptElement",
|
| 735 |
+
"SVGSetElement",
|
| 736 |
+
"SVGStopElement",
|
| 737 |
+
"SVGStringList",
|
| 738 |
+
"SVGStyleElement",
|
| 739 |
+
"SVGSVGElement",
|
| 740 |
+
"SVGSwitchElement",
|
| 741 |
+
"SVGSymbolElement",
|
| 742 |
+
"SVGTextContentElement",
|
| 743 |
+
"SVGTextElement",
|
| 744 |
+
"SVGTextPathElement",
|
| 745 |
+
"SVGTextPositioningElement",
|
| 746 |
+
"SVGTitleElement",
|
| 747 |
+
"SVGTransform",
|
| 748 |
+
"SVGTransformList",
|
| 749 |
+
"SVGTSpanElement",
|
| 750 |
+
"SVGUnitTypes",
|
| 751 |
+
"SVGUseElement",
|
| 752 |
+
"SVGViewElement",
|
| 753 |
+
"SyncManager",
|
| 754 |
+
"TaskAttributionTiming",
|
| 755 |
+
"TaskController",
|
| 756 |
+
"TaskPriorityChangeEvent",
|
| 757 |
+
"TaskSignal",
|
| 758 |
+
"TEMPORARY",
|
| 759 |
+
"Text",
|
| 760 |
+
"TextDecoder",
|
| 761 |
+
"TextDecoderStream",
|
| 762 |
+
"TextEncoder",
|
| 763 |
+
"TextEncoderStream",
|
| 764 |
+
"TextEvent",
|
| 765 |
+
"TextFormat",
|
| 766 |
+
"TextFormatUpdateEvent",
|
| 767 |
+
"TextMetrics",
|
| 768 |
+
"TextTrack",
|
| 769 |
+
"TextTrackCue",
|
| 770 |
+
"TextTrackCueList",
|
| 771 |
+
"TextTrackList",
|
| 772 |
+
"TextUpdateEvent",
|
| 773 |
+
"TimeEvent",
|
| 774 |
+
"TimeRanges",
|
| 775 |
+
"ToggleEvent",
|
| 776 |
+
"Touch",
|
| 777 |
+
"TouchEvent",
|
| 778 |
+
"TouchList",
|
| 779 |
+
"TrackEvent",
|
| 780 |
+
"TransformStream",
|
| 781 |
+
"TransformStreamDefaultController",
|
| 782 |
+
"TransitionEvent",
|
| 783 |
+
"TreeWalker",
|
| 784 |
+
"TrustedHTML",
|
| 785 |
+
"TrustedScript",
|
| 786 |
+
"TrustedScriptURL",
|
| 787 |
+
"TrustedTypePolicy",
|
| 788 |
+
"TrustedTypePolicyFactory",
|
| 789 |
+
"UIEvent",
|
| 790 |
+
"URL",
|
| 791 |
+
"URLPattern",
|
| 792 |
+
"URLSearchParams",
|
| 793 |
+
"USB",
|
| 794 |
+
"USBAlternateInterface",
|
| 795 |
+
"USBConfiguration",
|
| 796 |
+
"USBConnectionEvent",
|
| 797 |
+
"USBDevice",
|
| 798 |
+
"USBEndpoint",
|
| 799 |
+
"USBInterface",
|
| 800 |
+
"USBInTransferResult",
|
| 801 |
+
"USBIsochronousInTransferPacket",
|
| 802 |
+
"USBIsochronousInTransferResult",
|
| 803 |
+
"USBIsochronousOutTransferPacket",
|
| 804 |
+
"USBIsochronousOutTransferResult",
|
| 805 |
+
"USBOutTransferResult",
|
| 806 |
+
"UserActivation",
|
| 807 |
+
"ValidityState",
|
| 808 |
+
"VideoColorSpace",
|
| 809 |
+
"VideoDecoder",
|
| 810 |
+
"VideoEncoder",
|
| 811 |
+
"VideoFrame",
|
| 812 |
+
"VideoPlaybackQuality",
|
| 813 |
+
"ViewTimeline",
|
| 814 |
+
"ViewTransition",
|
| 815 |
+
"ViewTransitionTypeSet",
|
| 816 |
+
"VirtualKeyboard",
|
| 817 |
+
"VirtualKeyboardGeometryChangeEvent",
|
| 818 |
+
"VisibilityStateEntry",
|
| 819 |
+
"VisualViewport",
|
| 820 |
+
"VTTCue",
|
| 821 |
+
"VTTRegion",
|
| 822 |
+
"WakeLock",
|
| 823 |
+
"WakeLockSentinel",
|
| 824 |
+
"WaveShaperNode",
|
| 825 |
+
"WebAssembly",
|
| 826 |
+
"WebGL2RenderingContext",
|
| 827 |
+
"WebGLActiveInfo",
|
| 828 |
+
"WebGLBuffer",
|
| 829 |
+
"WebGLContextEvent",
|
| 830 |
+
"WebGLFramebuffer",
|
| 831 |
+
"WebGLObject",
|
| 832 |
+
"WebGLProgram",
|
| 833 |
+
"WebGLQuery",
|
| 834 |
+
"WebGLRenderbuffer",
|
| 835 |
+
"WebGLRenderingContext",
|
| 836 |
+
"WebGLSampler",
|
| 837 |
+
"WebGLShader",
|
| 838 |
+
"WebGLShaderPrecisionFormat",
|
| 839 |
+
"WebGLSync",
|
| 840 |
+
"WebGLTexture",
|
| 841 |
+
"WebGLTransformFeedback",
|
| 842 |
+
"WebGLUniformLocation",
|
| 843 |
+
"WebGLVertexArrayObject",
|
| 844 |
+
"WebSocket",
|
| 845 |
+
"WebSocketError",
|
| 846 |
+
"WebSocketStream",
|
| 847 |
+
"WebTransport",
|
| 848 |
+
"WebTransportBidirectionalStream",
|
| 849 |
+
"WebTransportDatagramDuplexStream",
|
| 850 |
+
"WebTransportError",
|
| 851 |
+
"WebTransportReceiveStream",
|
| 852 |
+
"WebTransportSendStream",
|
| 853 |
+
"WGSLLanguageFeatures",
|
| 854 |
+
"WheelEvent",
|
| 855 |
+
"Window",
|
| 856 |
+
"WindowControlsOverlay",
|
| 857 |
+
"WindowControlsOverlayGeometryChangeEvent",
|
| 858 |
+
"Worker",
|
| 859 |
+
"Worklet",
|
| 860 |
+
"WorkletGlobalScope",
|
| 861 |
+
"WritableStream",
|
| 862 |
+
"WritableStreamDefaultController",
|
| 863 |
+
"WritableStreamDefaultWriter",
|
| 864 |
+
"XMLDocument",
|
| 865 |
+
"XMLHttpRequest",
|
| 866 |
+
"XMLHttpRequestEventTarget",
|
| 867 |
+
"XMLHttpRequestUpload",
|
| 868 |
+
"XMLSerializer",
|
| 869 |
+
"XPathEvaluator",
|
| 870 |
+
"XPathExpression",
|
| 871 |
+
"XPathResult",
|
| 872 |
+
"XRAnchor",
|
| 873 |
+
"XRAnchorSet",
|
| 874 |
+
"XRBoundedReferenceSpace",
|
| 875 |
+
"XRCamera",
|
| 876 |
+
"XRCPUDepthInformation",
|
| 877 |
+
"XRDepthInformation",
|
| 878 |
+
"XRDOMOverlayState",
|
| 879 |
+
"XRFrame",
|
| 880 |
+
"XRHand",
|
| 881 |
+
"XRHitTestResult",
|
| 882 |
+
"XRHitTestSource",
|
| 883 |
+
"XRInputSource",
|
| 884 |
+
"XRInputSourceArray",
|
| 885 |
+
"XRInputSourceEvent",
|
| 886 |
+
"XRInputSourcesChangeEvent",
|
| 887 |
+
"XRJointPose",
|
| 888 |
+
"XRJointSpace",
|
| 889 |
+
"XRLayer",
|
| 890 |
+
"XRLightEstimate",
|
| 891 |
+
"XRLightProbe",
|
| 892 |
+
"XRPose",
|
| 893 |
+
"XRRay",
|
| 894 |
+
"XRReferenceSpace",
|
| 895 |
+
"XRReferenceSpaceEvent",
|
| 896 |
+
"XRRenderState",
|
| 897 |
+
"XRRigidTransform",
|
| 898 |
+
"XRSession",
|
| 899 |
+
"XRSessionEvent",
|
| 900 |
+
"XRSpace",
|
| 901 |
+
"XRSystem",
|
| 902 |
+
"XRTransientInputHitTestResult",
|
| 903 |
+
"XRTransientInputHitTestSource",
|
| 904 |
+
"XRView",
|
| 905 |
+
"XRViewerPose",
|
| 906 |
+
"XRViewport",
|
| 907 |
+
"XRWebGLBinding",
|
| 908 |
+
"XRWebGLDepthInformation",
|
| 909 |
+
"XRWebGLLayer",
|
| 910 |
+
"XSLTProcessor"
|
| 911 |
+
]
|
node_modules/@babel/helper-globals/data/builtin-lower.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
"decodeURI",
|
| 3 |
+
"decodeURIComponent",
|
| 4 |
+
"encodeURI",
|
| 5 |
+
"encodeURIComponent",
|
| 6 |
+
"escape",
|
| 7 |
+
"eval",
|
| 8 |
+
"globalThis",
|
| 9 |
+
"isFinite",
|
| 10 |
+
"isNaN",
|
| 11 |
+
"parseFloat",
|
| 12 |
+
"parseInt",
|
| 13 |
+
"undefined",
|
| 14 |
+
"unescape"
|
| 15 |
+
]
|
node_modules/@babel/helper-globals/data/builtin-upper.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
"AggregateError",
|
| 3 |
+
"Array",
|
| 4 |
+
"ArrayBuffer",
|
| 5 |
+
"Atomics",
|
| 6 |
+
"BigInt",
|
| 7 |
+
"BigInt64Array",
|
| 8 |
+
"BigUint64Array",
|
| 9 |
+
"Boolean",
|
| 10 |
+
"DataView",
|
| 11 |
+
"Date",
|
| 12 |
+
"Error",
|
| 13 |
+
"EvalError",
|
| 14 |
+
"FinalizationRegistry",
|
| 15 |
+
"Float16Array",
|
| 16 |
+
"Float32Array",
|
| 17 |
+
"Float64Array",
|
| 18 |
+
"Function",
|
| 19 |
+
"Infinity",
|
| 20 |
+
"Int16Array",
|
| 21 |
+
"Int32Array",
|
| 22 |
+
"Int8Array",
|
| 23 |
+
"Intl",
|
| 24 |
+
"Iterator",
|
| 25 |
+
"JSON",
|
| 26 |
+
"Map",
|
| 27 |
+
"Math",
|
| 28 |
+
"NaN",
|
| 29 |
+
"Number",
|
| 30 |
+
"Object",
|
| 31 |
+
"Promise",
|
| 32 |
+
"Proxy",
|
| 33 |
+
"RangeError",
|
| 34 |
+
"ReferenceError",
|
| 35 |
+
"Reflect",
|
| 36 |
+
"RegExp",
|
| 37 |
+
"Set",
|
| 38 |
+
"SharedArrayBuffer",
|
| 39 |
+
"String",
|
| 40 |
+
"Symbol",
|
| 41 |
+
"SyntaxError",
|
| 42 |
+
"TypeError",
|
| 43 |
+
"Uint16Array",
|
| 44 |
+
"Uint32Array",
|
| 45 |
+
"Uint8Array",
|
| 46 |
+
"Uint8ClampedArray",
|
| 47 |
+
"URIError",
|
| 48 |
+
"WeakMap",
|
| 49 |
+
"WeakRef",
|
| 50 |
+
"WeakSet"
|
| 51 |
+
]
|
node_modules/@babel/helper-globals/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/helper-globals",
|
| 3 |
+
"version": "7.29.7",
|
| 4 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 5 |
+
"license": "MIT",
|
| 6 |
+
"description": "A collection of JavaScript globals for Babel internal usage",
|
| 7 |
+
"repository": {
|
| 8 |
+
"type": "git",
|
| 9 |
+
"url": "https://github.com/babel/babel.git",
|
| 10 |
+
"directory": "packages/babel-helper-globals"
|
| 11 |
+
},
|
| 12 |
+
"publishConfig": {
|
| 13 |
+
"access": "public"
|
| 14 |
+
},
|
| 15 |
+
"exports": {
|
| 16 |
+
"./data/browser-upper.json": "./data/browser-upper.json",
|
| 17 |
+
"./data/builtin-lower.json": "./data/builtin-lower.json",
|
| 18 |
+
"./data/builtin-upper.json": "./data/builtin-upper.json",
|
| 19 |
+
"./package.json": "./package.json"
|
| 20 |
+
},
|
| 21 |
+
"keywords": [
|
| 22 |
+
"babel",
|
| 23 |
+
"globals"
|
| 24 |
+
],
|
| 25 |
+
"devDependencies": {
|
| 26 |
+
"globals": "^16.1.0"
|
| 27 |
+
},
|
| 28 |
+
"engines": {
|
| 29 |
+
"node": ">=6.9.0"
|
| 30 |
+
},
|
| 31 |
+
"type": "commonjs"
|
| 32 |
+
}
|
node_modules/@babel/helper-module-imports/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|