Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- ui/node_modules/@babel/code-frame/LICENSE +22 -0
- ui/node_modules/@babel/code-frame/README.md +19 -0
- ui/node_modules/@babel/code-frame/lib/index.js +216 -0
- ui/node_modules/@babel/code-frame/lib/index.js.map +1 -0
- ui/node_modules/@babel/code-frame/package.json +31 -0
- ui/node_modules/@babel/generator/LICENSE +22 -0
- ui/node_modules/@babel/generator/README.md +19 -0
- ui/node_modules/@babel/generator/lib/buffer.js +317 -0
- ui/node_modules/@babel/generator/lib/buffer.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/base.js +87 -0
- ui/node_modules/@babel/generator/lib/generators/base.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/classes.js +212 -0
- ui/node_modules/@babel/generator/lib/generators/classes.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/deprecated.js +28 -0
- ui/node_modules/@babel/generator/lib/generators/deprecated.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/expressions.js +301 -0
- ui/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/flow.js +660 -0
- ui/node_modules/@babel/generator/lib/generators/flow.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/index.js +128 -0
- ui/node_modules/@babel/generator/lib/generators/index.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/jsx.js +126 -0
- ui/node_modules/@babel/generator/lib/generators/jsx.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/methods.js +198 -0
- ui/node_modules/@babel/generator/lib/generators/methods.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/modules.js +283 -0
- ui/node_modules/@babel/generator/lib/generators/modules.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/statements.js +282 -0
- ui/node_modules/@babel/generator/lib/generators/statements.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/template-literals.js +40 -0
- ui/node_modules/@babel/generator/lib/generators/template-literals.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/types.js +234 -0
- ui/node_modules/@babel/generator/lib/generators/types.js.map +1 -0
- ui/node_modules/@babel/generator/lib/generators/typescript.js +724 -0
- ui/node_modules/@babel/generator/lib/generators/typescript.js.map +1 -0
- ui/node_modules/@babel/generator/lib/index.js +112 -0
- ui/node_modules/@babel/generator/lib/index.js.map +1 -0
- ui/node_modules/@babel/generator/lib/node/index.js +119 -0
- ui/node_modules/@babel/generator/lib/node/index.js.map +1 -0
- ui/node_modules/@babel/generator/lib/node/parentheses.js +262 -0
- ui/node_modules/@babel/generator/lib/node/parentheses.js.map +1 -0
- ui/node_modules/@babel/generator/lib/node/whitespace.js +145 -0
- ui/node_modules/@babel/generator/lib/node/whitespace.js.map +1 -0
- ui/node_modules/@babel/generator/lib/printer.js +775 -0
- ui/node_modules/@babel/generator/lib/printer.js.map +1 -0
- ui/node_modules/@babel/generator/lib/source-map.js +85 -0
- ui/node_modules/@babel/generator/lib/source-map.js.map +1 -0
- ui/node_modules/@babel/generator/lib/token-map.js +191 -0
- ui/node_modules/@babel/generator/lib/token-map.js.map +1 -0
- ui/node_modules/@babel/generator/package.json +40 -0
ui/node_modules/@babel/code-frame/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.
|
ui/node_modules/@babel/code-frame/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/code-frame
|
| 2 |
+
|
| 3 |
+
> Generate errors that contain a code frame that point to source locations.
|
| 4 |
+
|
| 5 |
+
See our website [@babel/code-frame](https://babeljs.io/docs/babel-code-frame) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save-dev @babel/code-frame
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/code-frame --dev
|
| 19 |
+
```
|
ui/node_modules/@babel/code-frame/lib/index.js
AD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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, '__esModule', { value: true });
|
| 4 |
+
|
| 5 |
+
var picocolors = require('picocolors');
|
| 6 |
+
var jsTokens = require('js-tokens');
|
| 7 |
+
var helperValidatorIdentifier = require('@babel/helper-validator-identifier');
|
| 8 |
+
|
| 9 |
+
function isColorSupported() {
|
| 10 |
+
return (typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported
|
| 11 |
+
);
|
| 12 |
+
}
|
| 13 |
+
const compose = (f, g) => v => f(g(v));
|
| 14 |
+
function buildDefs(colors) {
|
| 15 |
+
return {
|
| 16 |
+
keyword: colors.cyan,
|
| 17 |
+
capitalized: colors.yellow,
|
| 18 |
+
jsxIdentifier: colors.yellow,
|
| 19 |
+
punctuator: colors.yellow,
|
| 20 |
+
number: colors.magenta,
|
| 21 |
+
string: colors.green,
|
| 22 |
+
regex: colors.magenta,
|
| 23 |
+
comment: colors.gray,
|
| 24 |
+
invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
|
| 25 |
+
gutter: colors.gray,
|
| 26 |
+
marker: compose(colors.red, colors.bold),
|
| 27 |
+
message: compose(colors.red, colors.bold),
|
| 28 |
+
reset: colors.reset
|
| 29 |
+
};
|
| 30 |
+
}
|
| 31 |
+
const defsOn = buildDefs(picocolors.createColors(true));
|
| 32 |
+
const defsOff = buildDefs(picocolors.createColors(false));
|
| 33 |
+
function getDefs(enabled) {
|
| 34 |
+
return enabled ? defsOn : defsOff;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
| 38 |
+
const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
| 39 |
+
const BRACKET = /^[()[\]{}]$/;
|
| 40 |
+
let tokenize;
|
| 41 |
+
{
|
| 42 |
+
const JSX_TAG = /^[a-z][\w-]*$/i;
|
| 43 |
+
const getTokenType = function (token, offset, text) {
|
| 44 |
+
if (token.type === "name") {
|
| 45 |
+
if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) {
|
| 46 |
+
return "keyword";
|
| 47 |
+
}
|
| 48 |
+
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
| 49 |
+
return "jsxIdentifier";
|
| 50 |
+
}
|
| 51 |
+
if (token.value[0] !== token.value[0].toLowerCase()) {
|
| 52 |
+
return "capitalized";
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
| 56 |
+
return "bracket";
|
| 57 |
+
}
|
| 58 |
+
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
| 59 |
+
return "punctuator";
|
| 60 |
+
}
|
| 61 |
+
return token.type;
|
| 62 |
+
};
|
| 63 |
+
tokenize = function* (text) {
|
| 64 |
+
let match;
|
| 65 |
+
while (match = jsTokens.default.exec(text)) {
|
| 66 |
+
const token = jsTokens.matchToToken(match);
|
| 67 |
+
yield {
|
| 68 |
+
type: getTokenType(token, match.index, text),
|
| 69 |
+
value: token.value
|
| 70 |
+
};
|
| 71 |
+
}
|
| 72 |
+
};
|
| 73 |
+
}
|
| 74 |
+
function highlight(text) {
|
| 75 |
+
if (text === "") return "";
|
| 76 |
+
const defs = getDefs(true);
|
| 77 |
+
let highlighted = "";
|
| 78 |
+
for (const {
|
| 79 |
+
type,
|
| 80 |
+
value
|
| 81 |
+
} of tokenize(text)) {
|
| 82 |
+
if (type in defs) {
|
| 83 |
+
highlighted += value.split(NEWLINE$1).map(str => defs[type](str)).join("\n");
|
| 84 |
+
} else {
|
| 85 |
+
highlighted += value;
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
return highlighted;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
let deprecationWarningShown = false;
|
| 92 |
+
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
| 93 |
+
function getMarkerLines(loc, source, opts) {
|
| 94 |
+
const startLoc = Object.assign({
|
| 95 |
+
column: 0,
|
| 96 |
+
line: -1
|
| 97 |
+
}, loc.start);
|
| 98 |
+
const endLoc = Object.assign({}, startLoc, loc.end);
|
| 99 |
+
const {
|
| 100 |
+
linesAbove = 2,
|
| 101 |
+
linesBelow = 3
|
| 102 |
+
} = opts || {};
|
| 103 |
+
const startLine = startLoc.line;
|
| 104 |
+
const startColumn = startLoc.column;
|
| 105 |
+
const endLine = endLoc.line;
|
| 106 |
+
const endColumn = endLoc.column;
|
| 107 |
+
let start = Math.max(startLine - (linesAbove + 1), 0);
|
| 108 |
+
let end = Math.min(source.length, endLine + linesBelow);
|
| 109 |
+
if (startLine === -1) {
|
| 110 |
+
start = 0;
|
| 111 |
+
}
|
| 112 |
+
if (endLine === -1) {
|
| 113 |
+
end = source.length;
|
| 114 |
+
}
|
| 115 |
+
const lineDiff = endLine - startLine;
|
| 116 |
+
const markerLines = {};
|
| 117 |
+
if (lineDiff) {
|
| 118 |
+
for (let i = 0; i <= lineDiff; i++) {
|
| 119 |
+
const lineNumber = i + startLine;
|
| 120 |
+
if (!startColumn) {
|
| 121 |
+
markerLines[lineNumber] = true;
|
| 122 |
+
} else if (i === 0) {
|
| 123 |
+
const sourceLength = source[lineNumber - 1].length;
|
| 124 |
+
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
| 125 |
+
} else if (i === lineDiff) {
|
| 126 |
+
markerLines[lineNumber] = [0, endColumn];
|
| 127 |
+
} else {
|
| 128 |
+
const sourceLength = source[lineNumber - i].length;
|
| 129 |
+
markerLines[lineNumber] = [0, sourceLength];
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
} else {
|
| 133 |
+
if (startColumn === endColumn) {
|
| 134 |
+
if (startColumn) {
|
| 135 |
+
markerLines[startLine] = [startColumn, 0];
|
| 136 |
+
} else {
|
| 137 |
+
markerLines[startLine] = true;
|
| 138 |
+
}
|
| 139 |
+
} else {
|
| 140 |
+
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
return {
|
| 144 |
+
start,
|
| 145 |
+
end,
|
| 146 |
+
markerLines
|
| 147 |
+
};
|
| 148 |
+
}
|
| 149 |
+
function codeFrameColumns(rawLines, loc, opts = {}) {
|
| 150 |
+
const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
|
| 151 |
+
const defs = getDefs(shouldHighlight);
|
| 152 |
+
const lines = rawLines.split(NEWLINE);
|
| 153 |
+
const {
|
| 154 |
+
start,
|
| 155 |
+
end,
|
| 156 |
+
markerLines
|
| 157 |
+
} = getMarkerLines(loc, lines, opts);
|
| 158 |
+
const hasColumns = loc.start && typeof loc.start.column === "number";
|
| 159 |
+
const numberMaxWidth = String(end).length;
|
| 160 |
+
const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
|
| 161 |
+
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
|
| 162 |
+
const number = start + 1 + index;
|
| 163 |
+
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
| 164 |
+
const gutter = ` ${paddedNumber} |`;
|
| 165 |
+
const hasMarker = markerLines[number];
|
| 166 |
+
const lastMarkerLine = !markerLines[number + 1];
|
| 167 |
+
if (hasMarker) {
|
| 168 |
+
let markerLine = "";
|
| 169 |
+
if (Array.isArray(hasMarker)) {
|
| 170 |
+
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
| 171 |
+
const numberOfMarkers = hasMarker[1] || 1;
|
| 172 |
+
markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
|
| 173 |
+
if (lastMarkerLine && opts.message) {
|
| 174 |
+
markerLine += " " + defs.message(opts.message);
|
| 175 |
+
}
|
| 176 |
+
}
|
| 177 |
+
return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
| 178 |
+
} else {
|
| 179 |
+
return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
| 180 |
+
}
|
| 181 |
+
}).join("\n");
|
| 182 |
+
if (opts.message && !hasColumns) {
|
| 183 |
+
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
| 184 |
+
}
|
| 185 |
+
if (shouldHighlight) {
|
| 186 |
+
return defs.reset(frame);
|
| 187 |
+
} else {
|
| 188 |
+
return frame;
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
function index (rawLines, lineNumber, colNumber, opts = {}) {
|
| 192 |
+
if (!deprecationWarningShown) {
|
| 193 |
+
deprecationWarningShown = true;
|
| 194 |
+
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
| 195 |
+
if (process.emitWarning) {
|
| 196 |
+
process.emitWarning(message, "DeprecationWarning");
|
| 197 |
+
} else {
|
| 198 |
+
const deprecationError = new Error(message);
|
| 199 |
+
deprecationError.name = "DeprecationWarning";
|
| 200 |
+
console.warn(new Error(message));
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
colNumber = Math.max(colNumber, 0);
|
| 204 |
+
const location = {
|
| 205 |
+
start: {
|
| 206 |
+
column: colNumber,
|
| 207 |
+
line: lineNumber
|
| 208 |
+
}
|
| 209 |
+
};
|
| 210 |
+
return codeFrameColumns(rawLines, location, opts);
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
exports.codeFrameColumns = codeFrameColumns;
|
| 214 |
+
exports.default = index;
|
| 215 |
+
exports.highlight = highlight;
|
| 216 |
+
//# sourceMappingURL=index.js.map
|
ui/node_modules/@babel/code-frame/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sources":["../src/defs.ts","../src/highlight.ts","../src/index.ts"],"sourcesContent":["import picocolors, { createColors } from \"picocolors\";\nimport type { Colors, Formatter } from \"picocolors/types\";\n\nexport function isColorSupported() {\n return (\n // See https://github.com/alexeyraspopov/picocolors/issues/62\n typeof process === \"object\" &&\n (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\")\n ? false\n : picocolors.isColorSupported\n );\n}\n\nexport type InternalTokenType =\n | \"keyword\"\n | \"capitalized\"\n | \"jsxIdentifier\"\n | \"punctuator\"\n | \"number\"\n | \"string\"\n | \"regex\"\n | \"comment\"\n | \"invalid\";\n\ntype UITokens = \"gutter\" | \"marker\" | \"message\";\n\nexport type Defs = {\n [_ in InternalTokenType | UITokens | \"reset\"]: Formatter;\n};\n\nconst compose: <T, U, V>(f: (gv: U) => V, g: (v: T) => U) => (v: T) => V =\n (f, g) => v =>\n f(g(v));\n\n/**\n * Styles for token types.\n */\nfunction buildDefs(colors: Colors): Defs {\n return {\n keyword: colors.cyan,\n capitalized: colors.yellow,\n jsxIdentifier: colors.yellow,\n punctuator: colors.yellow,\n number: colors.magenta,\n string: colors.green,\n regex: colors.magenta,\n comment: colors.gray,\n invalid: compose(compose(colors.white, colors.bgRed), colors.bold),\n\n gutter: colors.gray,\n marker: compose(colors.red, colors.bold),\n message: compose(colors.red, colors.bold),\n\n reset: colors.reset,\n };\n}\n\nconst defsOn = buildDefs(createColors(true));\nconst defsOff = buildDefs(createColors(false));\n\nexport function getDefs(enabled: boolean): Defs {\n return enabled ? defsOn : defsOff;\n}\n","import type { Token as JSToken, JSXToken } from \"js-tokens\";\nimport jsTokens from \"js-tokens\";\n\nimport {\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nimport { getDefs, type InternalTokenType } from \"./defs.ts\";\n\n/**\n * Names that are always allowed as identifiers, but also appear as keywords\n * within certain syntactic productions.\n *\n * https://tc39.es/ecma262/#sec-keywords-and-reserved-words\n *\n * `target` has been omitted since it is very likely going to be a false\n * positive.\n */\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\n\ntype Token = {\n type: InternalTokenType | \"uncolored\";\n value: string;\n};\n\n/**\n * RegExp to test for newlines in terminal.\n */\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * RegExp to test for the three types of brackets.\n */\nconst BRACKET = /^[()[\\]{}]$/;\n\nlet tokenize: (\n text: string,\n) => Generator<{ type: InternalTokenType | \"uncolored\"; value: string }>;\n\nif (process.env.BABEL_8_BREAKING) {\n /**\n * Get the type of token, specifying punctuator type.\n */\n const getTokenType = function (\n token: JSToken | JSXToken,\n ): InternalTokenType | \"uncolored\" {\n if (token.type === \"IdentifierName\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (token.value[0] !== token.value[0].toLowerCase()) {\n return \"capitalized\";\n }\n }\n\n if (token.type === \"Punctuator\" && BRACKET.test(token.value)) {\n return \"uncolored\";\n }\n\n if (token.type === \"Invalid\" && token.value === \"@\") {\n return \"punctuator\";\n }\n\n switch (token.type) {\n case \"NumericLiteral\":\n return \"number\";\n\n case \"StringLiteral\":\n case \"JSXString\":\n case \"NoSubstitutionTemplate\":\n return \"string\";\n\n case \"RegularExpressionLiteral\":\n return \"regex\";\n\n case \"Punctuator\":\n case \"JSXPunctuator\":\n return \"punctuator\";\n\n case \"MultiLineComment\":\n case \"SingleLineComment\":\n return \"comment\";\n\n case \"Invalid\":\n case \"JSXInvalid\":\n return \"invalid\";\n\n case \"JSXIdentifier\":\n return \"jsxIdentifier\";\n\n default:\n return \"uncolored\";\n }\n };\n\n /**\n * Turn a string of JS into an array of objects.\n */\n tokenize = function* (text: string): Generator<Token> {\n for (const token of jsTokens(text, { jsx: true })) {\n switch (token.type) {\n case \"TemplateHead\":\n yield { type: \"string\", value: token.value.slice(0, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateMiddle\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateTail\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1) };\n break;\n\n default:\n yield {\n type: getTokenType(token),\n value: token.value,\n };\n }\n }\n };\n} else {\n /**\n * RegExp to test for what seems to be a JSX tag name.\n */\n const JSX_TAG = /^[a-z][\\w-]*$/i;\n\n // The token here is defined in js-tokens@4. However we don't bother\n // typing it since the whole block will be removed in Babel 8\n const getTokenType = function (token: any, offset: number, text: string) {\n if (token.type === \"name\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (\n JSX_TAG.test(token.value) &&\n (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) === \"</\")\n ) {\n return \"jsxIdentifier\";\n }\n\n if (token.value[0] !== token.value[0].toLowerCase()) {\n return \"capitalized\";\n }\n }\n\n if (token.type === \"punctuator\" && BRACKET.test(token.value)) {\n return \"bracket\";\n }\n\n if (\n token.type === \"invalid\" &&\n (token.value === \"@\" || token.value === \"#\")\n ) {\n return \"punctuator\";\n }\n\n return token.type;\n };\n\n tokenize = function* (text: string) {\n let match;\n while ((match = (jsTokens as any).default.exec(text))) {\n const token = (jsTokens as any).matchToToken(match);\n\n yield {\n type: getTokenType(token, match.index, text),\n value: token.value,\n };\n }\n };\n}\n\nexport function highlight(text: string) {\n if (text === \"\") return \"\";\n\n const defs = getDefs(true);\n\n let highlighted = \"\";\n\n for (const { type, value } of tokenize(text)) {\n if (type in defs) {\n highlighted += value\n .split(NEWLINE)\n .map(str => defs[type as InternalTokenType](str))\n .join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n\n return highlighted;\n}\n","import { getDefs, isColorSupported } from \"./defs.ts\";\nimport { highlight } from \"./highlight.ts\";\n\nexport { highlight };\n\nlet deprecationWarningShown = false;\n\ntype Location = {\n column: number;\n line: number;\n};\n\ntype NodeLocation = {\n end?: Location;\n start: Location;\n};\n\nexport interface Options {\n /** Syntax highlight the code as JavaScript for terminals. default: false */\n highlightCode?: boolean;\n /** The number of lines to show above the error. default: 2 */\n linesAbove?: number;\n /** The number of lines to show below the error. default: 3 */\n linesBelow?: number;\n /**\n * Forcibly syntax highlight the code as JavaScript (for non-terminals);\n * overrides highlightCode.\n * default: false\n */\n forceColor?: boolean;\n /**\n * Pass in a string to be displayed inline (if possible) next to the\n * highlighted location in the code. If it can't be positioned inline,\n * it will be placed above the code frame.\n * default: nothing\n */\n message?: string;\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\n\ntype MarkerLines = Record<number, true | [number, number]>;\n\nfunction getMarkerLines(\n loc: NodeLocation,\n source: Array<string>,\n opts: Options,\n): {\n start: number;\n end: number;\n markerLines: MarkerLines;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start,\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end,\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines: MarkerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return { start, end, markerLines };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: Options = {},\n): string {\n const shouldHighlight =\n opts.forceColor || (isColorSupported() && opts.highlightCode);\n const defs = getDefs(shouldHighlight);\n\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n\n const numberMaxWidth = String(end).length;\n\n const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;\n\n let frame = highlightedLines\n .split(NEWLINE, end)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n defs.gutter(gutter.replace(/\\d/g, \" \")),\n \" \",\n markerSpacing,\n defs.marker(\"^\").repeat(numberOfMarkers),\n ].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + defs.message(opts.message);\n }\n }\n return [\n defs.marker(\">\"),\n defs.gutter(gutter),\n line.length > 0 ? ` ${line}` : \"\",\n markerLine,\n ].join(\"\");\n } else {\n return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : \"\"}`;\n }\n })\n .join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (shouldHighlight) {\n return defs.reset(frame);\n } else {\n return frame;\n }\n}\n\n/**\n * Create a code frame, adding line numbers, code highlighting, and pointing to a given position.\n */\n\nexport default function (\n rawLines: string,\n lineNumber: number,\n colNumber?: number | null,\n opts: Options = {},\n): string {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n\n const message =\n \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n // A string is directly supplied to emitWarning, because when supplying an\n // Error object node throws in the tests because of different contexts\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n\n const location: NodeLocation = {\n start: { column: colNumber, line: lineNumber },\n };\n\n return codeFrameColumns(rawLines, location, opts);\n}\n"],"names":["isColorSupported","process","env","FORCE_COLOR","picocolors","compose","f","g","v","buildDefs","colors","keyword","cyan","capitalized","yellow","jsxIdentifier","punctuator","number","magenta","string","green","regex","comment","gray","invalid","white","bgRed","bold","gutter","marker","red","message","reset","defsOn","createColors","defsOff","getDefs","enabled","sometimesKeywords","Set","NEWLINE","BRACKET","tokenize","JSX_TAG","getTokenType","token","offset","text","type","isKeyword","value","isStrictReservedWord","has","test","slice","toLowerCase","match","jsTokens","default","exec","matchToToken","index","highlight","defs","highlighted","split","map","str","join","deprecationWarningShown","getMarkerLines","loc","source","opts","startLoc","Object","assign","column","line","start","endLoc","end","linesAbove","linesBelow","startLine","startColumn","endLine","endColumn","Math","max","min","length","lineDiff","markerLines","i","lineNumber","sourceLength","codeFrameColumns","rawLines","shouldHighlight","forceColor","highlightCode","lines","hasColumns","numberMaxWidth","String","highlightedLines","frame","paddedNumber","hasMarker","lastMarkerLine","markerLine","Array","isArray","markerSpacing","replace","numberOfMarkers","repeat","colNumber","emitWarning","deprecationError","Error","name","console","warn","location"],"mappings":";;;;;;;;AAGO,SAASA,gBAAgBA,GAAG;EACjC,QAEE,OAAOC,OAAO,KAAK,QAAQ,KACxBA,OAAO,CAACC,GAAG,CAACC,WAAW,KAAK,GAAG,IAAIF,OAAO,CAACC,GAAG,CAACC,WAAW,KAAK,OAAO,CAAC,GACtE,KAAK,GACLC,UAAU,CAACJ,gBAAAA;AAAgB,IAAA;AAEnC,CAAA;AAmBA,MAAMK,OAAkE,GACtEA,CAACC,CAAC,EAAEC,CAAC,KAAKC,CAAC,IACTF,CAAC,CAACC,CAAC,CAACC,CAAC,CAAC,CAAC,CAAA;AAKX,SAASC,SAASA,CAACC,MAAc,EAAQ;EACvC,OAAO;IACLC,OAAO,EAAED,MAAM,CAACE,IAAI;IACpBC,WAAW,EAAEH,MAAM,CAACI,MAAM;IAC1BC,aAAa,EAAEL,MAAM,CAACI,MAAM;IAC5BE,UAAU,EAAEN,MAAM,CAACI,MAAM;IACzBG,MAAM,EAAEP,MAAM,CAACQ,OAAO;IACtBC,MAAM,EAAET,MAAM,CAACU,KAAK;IACpBC,KAAK,EAAEX,MAAM,CAACQ,OAAO;IACrBI,OAAO,EAAEZ,MAAM,CAACa,IAAI;AACpBC,IAAAA,OAAO,EAAEnB,OAAO,CAACA,OAAO,CAACK,MAAM,CAACe,KAAK,EAAEf,MAAM,CAACgB,KAAK,CAAC,EAAEhB,MAAM,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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/code-frame",
|
| 3 |
+
"version": "7.27.1",
|
| 4 |
+
"description": "Generate errors that contain a code frame that point to source locations.",
|
| 5 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 6 |
+
"homepage": "https://babel.dev/docs/en/next/babel-code-frame",
|
| 7 |
+
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen",
|
| 8 |
+
"license": "MIT",
|
| 9 |
+
"publishConfig": {
|
| 10 |
+
"access": "public"
|
| 11 |
+
},
|
| 12 |
+
"repository": {
|
| 13 |
+
"type": "git",
|
| 14 |
+
"url": "https://github.com/babel/babel.git",
|
| 15 |
+
"directory": "packages/babel-code-frame"
|
| 16 |
+
},
|
| 17 |
+
"main": "./lib/index.js",
|
| 18 |
+
"dependencies": {
|
| 19 |
+
"@babel/helper-validator-identifier": "^7.27.1",
|
| 20 |
+
"js-tokens": "^4.0.0",
|
| 21 |
+
"picocolors": "^1.1.1"
|
| 22 |
+
},
|
| 23 |
+
"devDependencies": {
|
| 24 |
+
"import-meta-resolve": "^4.1.0",
|
| 25 |
+
"strip-ansi": "^4.0.0"
|
| 26 |
+
},
|
| 27 |
+
"engines": {
|
| 28 |
+
"node": ">=6.9.0"
|
| 29 |
+
},
|
| 30 |
+
"type": "commonjs"
|
| 31 |
+
}
|
ui/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.
|
ui/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 |
+
```
|
ui/node_modules/@babel/generator/lib/buffer.js
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = void 0;
|
| 7 |
+
class Buffer {
|
| 8 |
+
constructor(map, indentChar) {
|
| 9 |
+
this._map = null;
|
| 10 |
+
this._buf = "";
|
| 11 |
+
this._str = "";
|
| 12 |
+
this._appendCount = 0;
|
| 13 |
+
this._last = 0;
|
| 14 |
+
this._queue = [];
|
| 15 |
+
this._queueCursor = 0;
|
| 16 |
+
this._canMarkIdName = true;
|
| 17 |
+
this._indentChar = "";
|
| 18 |
+
this._fastIndentations = [];
|
| 19 |
+
this._position = {
|
| 20 |
+
line: 1,
|
| 21 |
+
column: 0
|
| 22 |
+
};
|
| 23 |
+
this._sourcePosition = {
|
| 24 |
+
identifierName: undefined,
|
| 25 |
+
identifierNamePos: undefined,
|
| 26 |
+
line: undefined,
|
| 27 |
+
column: undefined,
|
| 28 |
+
filename: undefined
|
| 29 |
+
};
|
| 30 |
+
this._map = map;
|
| 31 |
+
this._indentChar = indentChar;
|
| 32 |
+
for (let i = 0; i < 64; i++) {
|
| 33 |
+
this._fastIndentations.push(indentChar.repeat(i));
|
| 34 |
+
}
|
| 35 |
+
this._allocQueue();
|
| 36 |
+
}
|
| 37 |
+
_allocQueue() {
|
| 38 |
+
const queue = this._queue;
|
| 39 |
+
for (let i = 0; i < 16; i++) {
|
| 40 |
+
queue.push({
|
| 41 |
+
char: 0,
|
| 42 |
+
repeat: 1,
|
| 43 |
+
line: undefined,
|
| 44 |
+
column: undefined,
|
| 45 |
+
identifierName: undefined,
|
| 46 |
+
identifierNamePos: undefined,
|
| 47 |
+
filename: ""
|
| 48 |
+
});
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
_pushQueue(char, repeat, line, column, filename) {
|
| 52 |
+
const cursor = this._queueCursor;
|
| 53 |
+
if (cursor === this._queue.length) {
|
| 54 |
+
this._allocQueue();
|
| 55 |
+
}
|
| 56 |
+
const item = this._queue[cursor];
|
| 57 |
+
item.char = char;
|
| 58 |
+
item.repeat = repeat;
|
| 59 |
+
item.line = line;
|
| 60 |
+
item.column = column;
|
| 61 |
+
item.filename = filename;
|
| 62 |
+
this._queueCursor++;
|
| 63 |
+
}
|
| 64 |
+
_popQueue() {
|
| 65 |
+
if (this._queueCursor === 0) {
|
| 66 |
+
throw new Error("Cannot pop from empty queue");
|
| 67 |
+
}
|
| 68 |
+
return this._queue[--this._queueCursor];
|
| 69 |
+
}
|
| 70 |
+
get() {
|
| 71 |
+
this._flush();
|
| 72 |
+
const map = this._map;
|
| 73 |
+
const result = {
|
| 74 |
+
code: (this._buf + this._str).trimRight(),
|
| 75 |
+
decodedMap: map == null ? void 0 : map.getDecoded(),
|
| 76 |
+
get __mergedMap() {
|
| 77 |
+
return this.map;
|
| 78 |
+
},
|
| 79 |
+
get map() {
|
| 80 |
+
const resultMap = map ? map.get() : null;
|
| 81 |
+
result.map = resultMap;
|
| 82 |
+
return resultMap;
|
| 83 |
+
},
|
| 84 |
+
set map(value) {
|
| 85 |
+
Object.defineProperty(result, "map", {
|
| 86 |
+
value,
|
| 87 |
+
writable: true
|
| 88 |
+
});
|
| 89 |
+
},
|
| 90 |
+
get rawMappings() {
|
| 91 |
+
const mappings = map == null ? void 0 : map.getRawMappings();
|
| 92 |
+
result.rawMappings = mappings;
|
| 93 |
+
return mappings;
|
| 94 |
+
},
|
| 95 |
+
set rawMappings(value) {
|
| 96 |
+
Object.defineProperty(result, "rawMappings", {
|
| 97 |
+
value,
|
| 98 |
+
writable: true
|
| 99 |
+
});
|
| 100 |
+
}
|
| 101 |
+
};
|
| 102 |
+
return result;
|
| 103 |
+
}
|
| 104 |
+
append(str, maybeNewline) {
|
| 105 |
+
this._flush();
|
| 106 |
+
this._append(str, this._sourcePosition, maybeNewline);
|
| 107 |
+
}
|
| 108 |
+
appendChar(char) {
|
| 109 |
+
this._flush();
|
| 110 |
+
this._appendChar(char, 1, this._sourcePosition);
|
| 111 |
+
}
|
| 112 |
+
queue(char) {
|
| 113 |
+
if (char === 10) {
|
| 114 |
+
while (this._queueCursor !== 0) {
|
| 115 |
+
const char = this._queue[this._queueCursor - 1].char;
|
| 116 |
+
if (char !== 32 && char !== 9) {
|
| 117 |
+
break;
|
| 118 |
+
}
|
| 119 |
+
this._queueCursor--;
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
const sourcePosition = this._sourcePosition;
|
| 123 |
+
this._pushQueue(char, 1, sourcePosition.line, sourcePosition.column, sourcePosition.filename);
|
| 124 |
+
}
|
| 125 |
+
queueIndentation(repeat) {
|
| 126 |
+
if (repeat === 0) return;
|
| 127 |
+
this._pushQueue(-1, repeat, undefined, undefined, undefined);
|
| 128 |
+
}
|
| 129 |
+
_flush() {
|
| 130 |
+
const queueCursor = this._queueCursor;
|
| 131 |
+
const queue = this._queue;
|
| 132 |
+
for (let i = 0; i < queueCursor; i++) {
|
| 133 |
+
const item = queue[i];
|
| 134 |
+
this._appendChar(item.char, item.repeat, item);
|
| 135 |
+
}
|
| 136 |
+
this._queueCursor = 0;
|
| 137 |
+
}
|
| 138 |
+
_appendChar(char, repeat, sourcePos) {
|
| 139 |
+
this._last = char;
|
| 140 |
+
if (char === -1) {
|
| 141 |
+
const fastIndentation = this._fastIndentations[repeat];
|
| 142 |
+
if (fastIndentation !== undefined) {
|
| 143 |
+
this._str += fastIndentation;
|
| 144 |
+
} else {
|
| 145 |
+
this._str += repeat > 1 ? this._indentChar.repeat(repeat) : this._indentChar;
|
| 146 |
+
}
|
| 147 |
+
} else {
|
| 148 |
+
this._str += repeat > 1 ? String.fromCharCode(char).repeat(repeat) : String.fromCharCode(char);
|
| 149 |
+
}
|
| 150 |
+
if (char !== 10) {
|
| 151 |
+
this._mark(sourcePos.line, sourcePos.column, sourcePos.identifierName, sourcePos.identifierNamePos, sourcePos.filename);
|
| 152 |
+
this._position.column += repeat;
|
| 153 |
+
} else {
|
| 154 |
+
this._position.line++;
|
| 155 |
+
this._position.column = 0;
|
| 156 |
+
}
|
| 157 |
+
if (this._canMarkIdName) {
|
| 158 |
+
sourcePos.identifierName = undefined;
|
| 159 |
+
sourcePos.identifierNamePos = undefined;
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
_append(str, sourcePos, maybeNewline) {
|
| 163 |
+
const len = str.length;
|
| 164 |
+
const position = this._position;
|
| 165 |
+
this._last = str.charCodeAt(len - 1);
|
| 166 |
+
if (++this._appendCount > 4096) {
|
| 167 |
+
+this._str;
|
| 168 |
+
this._buf += this._str;
|
| 169 |
+
this._str = str;
|
| 170 |
+
this._appendCount = 0;
|
| 171 |
+
} else {
|
| 172 |
+
this._str += str;
|
| 173 |
+
}
|
| 174 |
+
if (!maybeNewline && !this._map) {
|
| 175 |
+
position.column += len;
|
| 176 |
+
return;
|
| 177 |
+
}
|
| 178 |
+
const {
|
| 179 |
+
column,
|
| 180 |
+
identifierName,
|
| 181 |
+
identifierNamePos,
|
| 182 |
+
filename
|
| 183 |
+
} = sourcePos;
|
| 184 |
+
let line = sourcePos.line;
|
| 185 |
+
if ((identifierName != null || identifierNamePos != null) && this._canMarkIdName) {
|
| 186 |
+
sourcePos.identifierName = undefined;
|
| 187 |
+
sourcePos.identifierNamePos = undefined;
|
| 188 |
+
}
|
| 189 |
+
let i = str.indexOf("\n");
|
| 190 |
+
let last = 0;
|
| 191 |
+
if (i !== 0) {
|
| 192 |
+
this._mark(line, column, identifierName, identifierNamePos, filename);
|
| 193 |
+
}
|
| 194 |
+
while (i !== -1) {
|
| 195 |
+
position.line++;
|
| 196 |
+
position.column = 0;
|
| 197 |
+
last = i + 1;
|
| 198 |
+
if (last < len && line !== undefined) {
|
| 199 |
+
this._mark(++line, 0, null, null, filename);
|
| 200 |
+
}
|
| 201 |
+
i = str.indexOf("\n", last);
|
| 202 |
+
}
|
| 203 |
+
position.column += len - last;
|
| 204 |
+
}
|
| 205 |
+
_mark(line, column, identifierName, identifierNamePos, filename) {
|
| 206 |
+
var _this$_map;
|
| 207 |
+
(_this$_map = this._map) == null || _this$_map.mark(this._position, line, column, identifierName, identifierNamePos, filename);
|
| 208 |
+
}
|
| 209 |
+
removeTrailingNewline() {
|
| 210 |
+
const queueCursor = this._queueCursor;
|
| 211 |
+
if (queueCursor !== 0 && this._queue[queueCursor - 1].char === 10) {
|
| 212 |
+
this._queueCursor--;
|
| 213 |
+
}
|
| 214 |
+
}
|
| 215 |
+
removeLastSemicolon() {
|
| 216 |
+
const queueCursor = this._queueCursor;
|
| 217 |
+
if (queueCursor !== 0 && this._queue[queueCursor - 1].char === 59) {
|
| 218 |
+
this._queueCursor--;
|
| 219 |
+
}
|
| 220 |
+
}
|
| 221 |
+
getLastChar() {
|
| 222 |
+
const queueCursor = this._queueCursor;
|
| 223 |
+
return queueCursor !== 0 ? this._queue[queueCursor - 1].char : this._last;
|
| 224 |
+
}
|
| 225 |
+
getNewlineCount() {
|
| 226 |
+
const queueCursor = this._queueCursor;
|
| 227 |
+
let count = 0;
|
| 228 |
+
if (queueCursor === 0) return this._last === 10 ? 1 : 0;
|
| 229 |
+
for (let i = queueCursor - 1; i >= 0; i--) {
|
| 230 |
+
if (this._queue[i].char !== 10) {
|
| 231 |
+
break;
|
| 232 |
+
}
|
| 233 |
+
count++;
|
| 234 |
+
}
|
| 235 |
+
return count === queueCursor && this._last === 10 ? count + 1 : count;
|
| 236 |
+
}
|
| 237 |
+
endsWithCharAndNewline() {
|
| 238 |
+
const queue = this._queue;
|
| 239 |
+
const queueCursor = this._queueCursor;
|
| 240 |
+
if (queueCursor !== 0) {
|
| 241 |
+
const lastCp = queue[queueCursor - 1].char;
|
| 242 |
+
if (lastCp !== 10) return;
|
| 243 |
+
if (queueCursor > 1) {
|
| 244 |
+
return queue[queueCursor - 2].char;
|
| 245 |
+
} else {
|
| 246 |
+
return this._last;
|
| 247 |
+
}
|
| 248 |
+
}
|
| 249 |
+
}
|
| 250 |
+
hasContent() {
|
| 251 |
+
return this._queueCursor !== 0 || !!this._last;
|
| 252 |
+
}
|
| 253 |
+
exactSource(loc, cb) {
|
| 254 |
+
if (!this._map) {
|
| 255 |
+
cb();
|
| 256 |
+
return;
|
| 257 |
+
}
|
| 258 |
+
this.source("start", loc);
|
| 259 |
+
const identifierName = loc.identifierName;
|
| 260 |
+
const sourcePos = this._sourcePosition;
|
| 261 |
+
if (identifierName) {
|
| 262 |
+
this._canMarkIdName = false;
|
| 263 |
+
sourcePos.identifierName = identifierName;
|
| 264 |
+
}
|
| 265 |
+
cb();
|
| 266 |
+
if (identifierName) {
|
| 267 |
+
this._canMarkIdName = true;
|
| 268 |
+
sourcePos.identifierName = undefined;
|
| 269 |
+
sourcePos.identifierNamePos = undefined;
|
| 270 |
+
}
|
| 271 |
+
this.source("end", loc);
|
| 272 |
+
}
|
| 273 |
+
source(prop, loc) {
|
| 274 |
+
if (!this._map) return;
|
| 275 |
+
this._normalizePosition(prop, loc, 0);
|
| 276 |
+
}
|
| 277 |
+
sourceWithOffset(prop, loc, columnOffset) {
|
| 278 |
+
if (!this._map) return;
|
| 279 |
+
this._normalizePosition(prop, loc, columnOffset);
|
| 280 |
+
}
|
| 281 |
+
_normalizePosition(prop, loc, columnOffset) {
|
| 282 |
+
const pos = loc[prop];
|
| 283 |
+
const target = this._sourcePosition;
|
| 284 |
+
if (pos) {
|
| 285 |
+
target.line = pos.line;
|
| 286 |
+
target.column = Math.max(pos.column + columnOffset, 0);
|
| 287 |
+
target.filename = loc.filename;
|
| 288 |
+
}
|
| 289 |
+
}
|
| 290 |
+
getCurrentColumn() {
|
| 291 |
+
const queue = this._queue;
|
| 292 |
+
const queueCursor = this._queueCursor;
|
| 293 |
+
let lastIndex = -1;
|
| 294 |
+
let len = 0;
|
| 295 |
+
for (let i = 0; i < queueCursor; i++) {
|
| 296 |
+
const item = queue[i];
|
| 297 |
+
if (item.char === 10) {
|
| 298 |
+
lastIndex = len;
|
| 299 |
+
}
|
| 300 |
+
len += item.repeat;
|
| 301 |
+
}
|
| 302 |
+
return lastIndex === -1 ? this._position.column + len : len - 1 - lastIndex;
|
| 303 |
+
}
|
| 304 |
+
getCurrentLine() {
|
| 305 |
+
let count = 0;
|
| 306 |
+
const queue = this._queue;
|
| 307 |
+
for (let i = 0; i < this._queueCursor; i++) {
|
| 308 |
+
if (queue[i].char === 10) {
|
| 309 |
+
count++;
|
| 310 |
+
}
|
| 311 |
+
}
|
| 312 |
+
return this._position.line + count;
|
| 313 |
+
}
|
| 314 |
+
}
|
| 315 |
+
exports.default = Buffer;
|
| 316 |
+
|
| 317 |
+
//# sourceMappingURL=buffer.js.map
|
ui/node_modules/@babel/generator/lib/buffer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["Buffer","constructor","map","indentChar","_map","_buf","_str","_appendCount","_last","_queue","_queueCursor","_canMarkIdName","_indentChar","_fastIndentations","_position","line","column","_sourcePosition","identifierName","undefined","identifierNamePos","filename","i","push","repeat","_allocQueue","queue","char","_pushQueue","cursor","length","item","_popQueue","Error","get","_flush","result","code","trimRight","decodedMap","getDecoded","__mergedMap","resultMap","value","Object","defineProperty","writable","rawMappings","mappings","getRawMappings","append","str","maybeNewline","_append","appendChar","_appendChar","sourcePosition","queueIndentation","queueCursor","sourcePos","fastIndentation","String","fromCharCode","_mark","len","position","charCodeAt","indexOf","last","_this$_map","mark","removeTrailingNewline","removeLastSemicolon","getLastChar","getNewlineCount","count","endsWithCharAndNewline","lastCp","hasContent","exactSource","loc","cb","source","prop","_normalizePosition","sourceWithOffset","columnOffset","pos","target","Math","max","getCurrentColumn","lastIndex","getCurrentLine","exports","default"],"sources":["../src/buffer.ts"],"sourcesContent":["import type SourceMap from \"./source-map.ts\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charcodes from \"charcodes\";\n\nexport type Pos = {\n line: number;\n column: number;\n index: number;\n};\nexport type Loc = {\n start?: Pos;\n end?: Pos;\n filename?: string;\n};\ntype SourcePos = {\n line: number | undefined;\n column: number | undefined;\n identifierName: string | undefined;\n filename: string | undefined;\n};\ntype InternalSourcePos = SourcePos & { identifierNamePos: Pos };\n\ntype QueueItem = {\n char: number;\n repeat: number;\n line: number | undefined;\n column: number | undefined;\n identifierName: undefined; // Not used, it always undefined.\n identifierNamePos: undefined; // Not used, it always undefined.\n filename: string | undefined;\n};\n\nexport default class Buffer {\n constructor(map: SourceMap | null, indentChar: string) {\n this._map = map;\n this._indentChar = indentChar;\n\n for (let i = 0; i < 64; i++) {\n this._fastIndentations.push(indentChar.repeat(i));\n }\n\n this._allocQueue();\n }\n\n _map: SourceMap = null;\n _buf = \"\";\n _str = \"\";\n _appendCount = 0;\n _last = 0;\n _queue: QueueItem[] = [];\n _queueCursor = 0;\n _canMarkIdName = true;\n _indentChar = \"\";\n _fastIndentations: string[] = [];\n\n _position = {\n line: 1,\n column: 0,\n };\n _sourcePosition: InternalSourcePos = {\n identifierName: undefined,\n identifierNamePos: undefined,\n line: undefined,\n column: undefined,\n filename: undefined,\n };\n\n _allocQueue() {\n const queue = this._queue;\n\n for (let i = 0; i < 16; i++) {\n queue.push({\n char: 0,\n repeat: 1,\n line: undefined,\n column: undefined,\n identifierName: undefined,\n identifierNamePos: undefined,\n filename: \"\",\n });\n }\n }\n\n _pushQueue(\n char: number,\n repeat: number,\n line: number | undefined,\n column: number | undefined,\n filename: string | undefined,\n ) {\n const cursor = this._queueCursor;\n if (cursor === this._queue.length) {\n this._allocQueue();\n }\n const item = this._queue[cursor];\n item.char = char;\n item.repeat = repeat;\n item.line = line;\n item.column = column;\n item.filename = filename;\n\n this._queueCursor++;\n }\n\n _popQueue(): QueueItem {\n if (this._queueCursor === 0) {\n throw new Error(\"Cannot pop from empty queue\");\n }\n return this._queue[--this._queueCursor];\n }\n\n /**\n * Get the final string output from the buffer, along with the sourcemap if one exists.\n */\n\n get() {\n this._flush();\n\n const map = this._map;\n const result = {\n // Whatever trim is used here should not execute a regex against the\n // source string since it may be arbitrarily large after all transformations\n code: (this._buf + this._str).trimRight(),\n // Decoded sourcemap is free to generate.\n decodedMap: map?.getDecoded(),\n // Used as a marker for backwards compatibility. We moved input map merging\n // into the generator. We cannot merge the input map a second time, so the\n // presence of this field tells us we've already done the work.\n get __mergedMap() {\n return this.map;\n },\n // Encoding the sourcemap is moderately CPU expensive.\n get map() {\n const resultMap = map ? map.get() : null;\n result.map = resultMap;\n return resultMap;\n },\n set map(value) {\n Object.defineProperty(result, \"map\", { value, writable: true });\n },\n // Retrieving the raw mappings is very memory intensive.\n get rawMappings() {\n const mappings = map?.getRawMappings();\n result.rawMappings = mappings;\n return mappings;\n },\n set rawMappings(value) {\n Object.defineProperty(result, \"rawMappings\", { value, writable: true });\n },\n };\n\n return result;\n }\n\n /**\n * Add a string to the buffer that cannot be reverted.\n */\n\n append(str: string, maybeNewline: boolean): void {\n this._flush();\n\n this._append(str, this._sourcePosition, maybeNewline);\n }\n\n appendChar(char: number): void {\n this._flush();\n this._appendChar(char, 1, this._sourcePosition);\n }\n\n /**\n * Add a string to the buffer than can be reverted.\n */\n queue(char: number): void {\n // Drop trailing spaces when a newline is inserted.\n if (char === charcodes.lineFeed) {\n while (this._queueCursor !== 0) {\n const char = this._queue[this._queueCursor - 1].char;\n if (char !== charcodes.space && char !== charcodes.tab) {\n break;\n }\n\n this._queueCursor--;\n }\n }\n\n const sourcePosition = this._sourcePosition;\n this._pushQueue(\n char,\n 1,\n sourcePosition.line,\n sourcePosition.column,\n sourcePosition.filename,\n );\n }\n\n /**\n * Same as queue, but this indentation will never have a sourcemap marker.\n */\n queueIndentation(repeat: number): void {\n if (repeat === 0) return;\n this._pushQueue(-1, repeat, undefined, undefined, undefined);\n }\n\n _flush(): void {\n const queueCursor = this._queueCursor;\n const queue = this._queue;\n for (let i = 0; i < queueCursor; i++) {\n const item: QueueItem = queue[i];\n this._appendChar(item.char, item.repeat, item);\n }\n this._queueCursor = 0;\n }\n\n _appendChar(\n char: number,\n repeat: number,\n sourcePos: InternalSourcePos,\n ): void {\n this._last = char;\n\n if (char === -1) {\n const fastIndentation = this._fastIndentations[repeat];\n if (fastIndentation !== undefined) {\n this._str += fastIndentation;\n } else {\n this._str +=\n repeat > 1 ? this._indentChar.repeat(repeat) : this._indentChar;\n }\n } else {\n this._str +=\n repeat > 1\n ? String.fromCharCode(char).repeat(repeat)\n : String.fromCharCode(char);\n }\n\n if (char !== charcodes.lineFeed) {\n this._mark(\n sourcePos.line,\n sourcePos.column,\n sourcePos.identifierName,\n sourcePos.identifierNamePos,\n sourcePos.filename,\n );\n this._position.column += repeat;\n } else {\n this._position.line++;\n this._position.column = 0;\n }\n\n if (this._canMarkIdName) {\n sourcePos.identifierName = undefined;\n sourcePos.identifierNamePos = undefined;\n }\n }\n\n _append(\n str: string,\n sourcePos: InternalSourcePos,\n maybeNewline: boolean,\n ): void {\n const len = str.length;\n const position = this._position;\n\n this._last = str.charCodeAt(len - 1);\n\n if (++this._appendCount > 4096) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n +this._str; // Unexplainable huge performance boost. Ref: https://github.com/davidmarkclements/flatstr License: MIT\n this._buf += this._str;\n this._str = str;\n this._appendCount = 0;\n } else {\n this._str += str;\n }\n\n if (!maybeNewline && !this._map) {\n position.column += len;\n return;\n }\n\n const { column, identifierName, identifierNamePos, filename } = sourcePos;\n let line = sourcePos.line;\n\n if (\n (identifierName != null || identifierNamePos != null) &&\n this._canMarkIdName\n ) {\n sourcePos.identifierName = undefined;\n sourcePos.identifierNamePos = undefined;\n }\n\n // Search for newline chars. We search only for `\\n`, since both `\\r` and\n // `\\r\\n` are normalized to `\\n` during parse. We exclude `\\u2028` and\n // `\\u2029` for performance reasons, they're so uncommon that it's probably\n // ok. It's also unclear how other sourcemap utilities handle them...\n let i = str.indexOf(\"\\n\");\n let last = 0;\n\n // If the string starts with a newline char, then adding a mark is redundant.\n // This catches both \"no newlines\" and \"newline after several chars\".\n if (i !== 0) {\n this._mark(line, column, identifierName, identifierNamePos, filename);\n }\n\n // Now, find each remaining newline char in the string.\n while (i !== -1) {\n position.line++;\n position.column = 0;\n last = i + 1;\n\n // We mark the start of each line, which happens directly after this newline char\n // unless this is the last char.\n // When manually adding multi-line content (such as a comment), `line` will be `undefined`.\n if (last < len && line !== undefined) {\n this._mark(++line, 0, null, null, filename);\n }\n i = str.indexOf(\"\\n\", last);\n }\n position.column += len - last;\n }\n\n _mark(\n line: number | undefined,\n column: number | undefined,\n identifierName: string | undefined,\n identifierNamePos: Pos | undefined,\n filename: string | undefined,\n ): void {\n this._map?.mark(\n this._position,\n line,\n column,\n identifierName,\n identifierNamePos,\n filename,\n );\n }\n\n removeTrailingNewline(): void {\n const queueCursor = this._queueCursor;\n if (\n queueCursor !== 0 &&\n this._queue[queueCursor - 1].char === charcodes.lineFeed\n ) {\n this._queueCursor--;\n }\n }\n\n removeLastSemicolon(): void {\n const queueCursor = this._queueCursor;\n if (\n queueCursor !== 0 &&\n this._queue[queueCursor - 1].char === charcodes.semicolon\n ) {\n this._queueCursor--;\n }\n }\n\n getLastChar(): number {\n const queueCursor = this._queueCursor;\n return queueCursor !== 0 ? this._queue[queueCursor - 1].char : this._last;\n }\n\n /**\n * This will only detect at most 1 newline after a call to `flush()`,\n * but this has not been found so far, and an accurate count can be achieved if needed later.\n */\n getNewlineCount(): number {\n const queueCursor = this._queueCursor;\n let count = 0;\n if (queueCursor === 0) return this._last === charcodes.lineFeed ? 1 : 0;\n for (let i = queueCursor - 1; i >= 0; i--) {\n if (this._queue[i].char !== charcodes.lineFeed) {\n break;\n }\n count++;\n }\n return count === queueCursor && this._last === charcodes.lineFeed\n ? count + 1\n : count;\n }\n\n /**\n * check if current _last + queue ends with newline, return the character before newline\n */\n endsWithCharAndNewline(): number {\n const queue = this._queue;\n const queueCursor = this._queueCursor;\n if (queueCursor !== 0) {\n // every element in queue is one-length whitespace string\n const lastCp = queue[queueCursor - 1].char;\n if (lastCp !== charcodes.lineFeed) return;\n if (queueCursor > 1) {\n return queue[queueCursor - 2].char;\n } else {\n return this._last;\n }\n }\n // We assume that everything being matched is at most a single token plus some whitespace,\n // which everything currently is, but otherwise we'd have to expand _last or check _buf.\n }\n\n hasContent(): boolean {\n return this._queueCursor !== 0 || !!this._last;\n }\n\n /**\n * Certain sourcemap usecases expect mappings to be more accurate than\n * Babel's generic sourcemap handling allows. For now, we special-case\n * identifiers to allow for the primary cases to work.\n * The goal of this line is to ensure that the map output from Babel will\n * have an exact range on identifiers in the output code. Without this\n * line, Babel would potentially include some number of trailing tokens\n * that are printed after the identifier, but before another location has\n * been assigned.\n * This allows tooling like Rollup and Webpack to more accurately perform\n * their own transformations. Most importantly, this allows the import/export\n * transformations performed by those tools to loose less information when\n * applying their own transformations on top of the code and map results\n * generated by Babel itself.\n *\n * The primary example of this is the snippet:\n *\n * import mod from \"mod\";\n * mod();\n *\n * With this line, there will be one mapping range over \"mod\" and another\n * over \"();\", where previously it would have been a single mapping.\n */\n exactSource(loc: Loc | undefined, cb: () => void) {\n if (!this._map) {\n cb();\n return;\n }\n\n this.source(\"start\", loc);\n // @ts-expect-error identifierName is not defined\n const identifierName = loc.identifierName;\n const sourcePos = this._sourcePosition;\n if (identifierName) {\n this._canMarkIdName = false;\n sourcePos.identifierName = identifierName;\n }\n cb();\n\n if (identifierName) {\n this._canMarkIdName = true;\n sourcePos.identifierName = undefined;\n sourcePos.identifierNamePos = undefined;\n }\n this.source(\"end\", loc);\n }\n\n /**\n * Sets a given position as the current source location so generated code after this call\n * will be given this position in the sourcemap.\n */\n\n source(prop: \"start\" | \"end\", loc: Loc | undefined): void {\n if (!this._map) return;\n\n // Since this is called extremely often, we reuse the same _sourcePosition\n // object for the whole lifetime of the buffer.\n this._normalizePosition(prop, loc, 0);\n }\n\n sourceWithOffset(\n prop: \"start\" | \"end\",\n loc: Loc | undefined,\n columnOffset: number,\n ): void {\n if (!this._map) return;\n\n this._normalizePosition(prop, loc, columnOffset);\n }\n\n _normalizePosition(prop: \"start\" | \"end\", loc: Loc, columnOffset: number) {\n const pos = loc[prop];\n const target = this._sourcePosition;\n\n if (pos) {\n target.line = pos.line;\n // TODO: Fix https://github.com/babel/babel/issues/15712 in downstream\n target.column = Math.max(pos.column + columnOffset, 0);\n target.filename = loc.filename;\n }\n }\n\n getCurrentColumn(): number {\n const queue = this._queue;\n const queueCursor = this._queueCursor;\n\n let lastIndex = -1;\n let len = 0;\n for (let i = 0; i < queueCursor; i++) {\n const item = queue[i];\n if (item.char === charcodes.lineFeed) {\n lastIndex = len;\n }\n len += item.repeat;\n }\n\n return lastIndex === -1 ? this._position.column + len : len - 1 - lastIndex;\n }\n\n getCurrentLine(): number {\n let count = 0;\n\n const queue = this._queue;\n for (let i = 0; i < this._queueCursor; i++) {\n if (queue[i].char === charcodes.lineFeed) {\n count++;\n }\n }\n\n return this._position.line + count;\n }\n}\n"],"mappings":";;;;;;AAkCe,MAAMA,MAAM,CAAC;EAC1BC,WAAWA,CAACC,GAAqB,EAAEC,UAAkB,EAAE;IAAA,KAWvDC,IAAI,GAAc,IAAI;IAAA,KACtBC,IAAI,GAAG,EAAE;IAAA,KACTC,IAAI,GAAG,EAAE;IAAA,KACTC,YAAY,GAAG,CAAC;IAAA,KAChBC,KAAK,GAAG,CAAC;IAAA,KACTC,MAAM,GAAgB,EAAE;IAAA,KACxBC,YAAY,GAAG,CAAC;IAAA,KAChBC,cAAc,GAAG,IAAI;IAAA,KACrBC,WAAW,GAAG,EAAE;IAAA,KAChBC,iBAAiB,GAAa,EAAE;IAAA,KAEhCC,SAAS,GAAG;MACVC,IAAI,EAAE,CAAC;MACPC,MAAM,EAAE;IACV,CAAC;IAAA,KACDC,eAAe,GAAsB;MACnCC,cAAc,EAAEC,SAA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AI,CAACZ,YAAY,EAAEY,CAAC,EAAE,EAAE;MAC1C,IAAII,KAAK,CAACJ,CAAC,CAAC,CAACK,IAAI,OAAuB,EAAE;QACxCgD,KAAK,EAAE;MACT;IACF;IAEA,OAAO,IAAI,CAAC7D,SAAS,CAACC,IAAI,GAAG4D,KAAK;EACpC;AACF;AAACmB,OAAA,CAAAC,OAAA,GAAA/F,MAAA","ignoreList":[]}
|
ui/node_modules/@babel/generator/lib/generators/base.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.BlockStatement = BlockStatement;
|
| 7 |
+
exports.Directive = Directive;
|
| 8 |
+
exports.DirectiveLiteral = DirectiveLiteral;
|
| 9 |
+
exports.File = File;
|
| 10 |
+
exports.InterpreterDirective = InterpreterDirective;
|
| 11 |
+
exports.Placeholder = Placeholder;
|
| 12 |
+
exports.Program = Program;
|
| 13 |
+
function File(node) {
|
| 14 |
+
if (node.program) {
|
| 15 |
+
this.print(node.program.interpreter);
|
| 16 |
+
}
|
| 17 |
+
this.print(node.program);
|
| 18 |
+
}
|
| 19 |
+
function Program(node) {
|
| 20 |
+
var _node$directives;
|
| 21 |
+
this.noIndentInnerCommentsHere();
|
| 22 |
+
this.printInnerComments();
|
| 23 |
+
const directivesLen = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
|
| 24 |
+
if (directivesLen) {
|
| 25 |
+
var _node$directives$trai;
|
| 26 |
+
const newline = node.body.length ? 2 : 1;
|
| 27 |
+
this.printSequence(node.directives, undefined, newline);
|
| 28 |
+
if (!((_node$directives$trai = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai.length)) {
|
| 29 |
+
this.newline(newline);
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
this.printSequence(node.body);
|
| 33 |
+
}
|
| 34 |
+
function BlockStatement(node) {
|
| 35 |
+
var _node$directives2;
|
| 36 |
+
this.tokenChar(123);
|
| 37 |
+
const exit = this.enterDelimited();
|
| 38 |
+
const directivesLen = (_node$directives2 = node.directives) == null ? void 0 : _node$directives2.length;
|
| 39 |
+
if (directivesLen) {
|
| 40 |
+
var _node$directives$trai2;
|
| 41 |
+
const newline = node.body.length ? 2 : 1;
|
| 42 |
+
this.printSequence(node.directives, true, newline);
|
| 43 |
+
if (!((_node$directives$trai2 = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai2.length)) {
|
| 44 |
+
this.newline(newline);
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
this.printSequence(node.body, true);
|
| 48 |
+
exit();
|
| 49 |
+
this.rightBrace(node);
|
| 50 |
+
}
|
| 51 |
+
function Directive(node) {
|
| 52 |
+
this.print(node.value);
|
| 53 |
+
this.semicolon();
|
| 54 |
+
}
|
| 55 |
+
const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
|
| 56 |
+
const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
|
| 57 |
+
function DirectiveLiteral(node) {
|
| 58 |
+
const raw = this.getPossibleRaw(node);
|
| 59 |
+
if (!this.format.minified && raw !== undefined) {
|
| 60 |
+
this.token(raw);
|
| 61 |
+
return;
|
| 62 |
+
}
|
| 63 |
+
const {
|
| 64 |
+
value
|
| 65 |
+
} = node;
|
| 66 |
+
if (!unescapedDoubleQuoteRE.test(value)) {
|
| 67 |
+
this.token(`"${value}"`);
|
| 68 |
+
} else if (!unescapedSingleQuoteRE.test(value)) {
|
| 69 |
+
this.token(`'${value}'`);
|
| 70 |
+
} else {
|
| 71 |
+
throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
function InterpreterDirective(node) {
|
| 75 |
+
this.token(`#!${node.value}`);
|
| 76 |
+
this.newline(1, true);
|
| 77 |
+
}
|
| 78 |
+
function Placeholder(node) {
|
| 79 |
+
this.token("%%");
|
| 80 |
+
this.print(node.name);
|
| 81 |
+
this.token("%%");
|
| 82 |
+
if (node.expectedNode === "Statement") {
|
| 83 |
+
this.semicolon();
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
//# sourceMappingURL=base.js.map
|
ui/node_modules/@babel/generator/lib/generators/base.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["File","node","program","print","interpreter","Program","_node$directives","noIndentInnerCommentsHere","printInnerComments","directivesLen","directives","length","_node$directives$trai","newline","body","printSequence","undefined","trailingComments","BlockStatement","_node$directives2","token","exit","enterDelimited","_node$directives$trai2","rightBrace","Directive","value","semicolon","unescapedSingleQuoteRE","unescapedDoubleQuoteRE","DirectiveLiteral","raw","getPossibleRaw","format","minified","test","Error","InterpreterDirective","Placeholder","name","expectedNode"],"sources":["../../src/generators/base.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\n\nexport function File(this: Printer, node: t.File) {\n if (node.program) {\n // Print this here to ensure that Program node 'leadingComments' still\n // get printed after the hashbang.\n this.print(node.program.interpreter);\n }\n\n this.print(node.program);\n}\n\nexport function Program(this: Printer, node: t.Program) {\n // An empty Program doesn't have any inner tokens, so\n // we must explicitly print its inner comments.\n this.noIndentInnerCommentsHere();\n this.printInnerComments();\n\n const directivesLen = node.directives?.length;\n if (directivesLen) {\n const newline = node.body.length ? 2 : 1;\n this.printSequence(node.directives, undefined, newline);\n if (!node.directives[directivesLen - 1].trailingComments?.length) {\n this.newline(newline);\n }\n }\n\n this.printSequence(node.body);\n}\n\nexport function BlockStatement(this: Printer, node: t.BlockStatement) {\n this.token(\"{\");\n const exit = this.enterDelimited();\n\n const directivesLen = node.directives?.length;\n if (directivesLen) {\n const newline = node.body.length ? 2 : 1;\n this.printSequence(node.directives, true, newline);\n if (!node.directives[directivesLen - 1].trailingComments?.length) {\n this.newline(newline);\n }\n }\n\n this.printSequence(node.body, true);\n\n exit();\n this.rightBrace(node);\n}\n\nexport function Directive(this: Printer, node: t.Directive) {\n this.print(node.value);\n this.semicolon();\n}\n\n// These regexes match an even number of \\ followed by a quote\nconst unescapedSingleQuoteRE = /(?:^|[^\\\\])(?:\\\\\\\\)*'/;\nconst unescapedDoubleQuoteRE = /(?:^|[^\\\\])(?:\\\\\\\\)*\"/;\n\nexport function DirectiveLiteral(this: Printer, node: t.DirectiveLiteral) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.token(raw);\n return;\n }\n\n const { value } = node;\n\n // NOTE: In directives we can't change escapings,\n // because they change the behavior.\n // e.g. \"us\\x65 strict\" (\\x65 is e) is not a \"use strict\" directive.\n\n if (!unescapedDoubleQuoteRE.test(value)) {\n this.token(`\"${value}\"`);\n } else if (!unescapedSingleQuoteRE.test(value)) {\n this.token(`'${value}'`);\n } else {\n throw new Error(\n \"Malformed AST: it is not possible to print a directive containing\" +\n \" both unescaped single and double quotes.\",\n );\n }\n}\n\nexport function InterpreterDirective(\n this: Printer,\n node: t.InterpreterDirective,\n) {\n this.token(`#!${node.value}`);\n this.newline(1, true);\n}\n\nexport function Placeholder(this: Printer, node: t.Placeholder) {\n this.token(\"%%\");\n this.print(node.name);\n this.token(\"%%\");\n\n if (node.expectedNode === \"Statement\") {\n this.semicolon();\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGO,SAASA,IAAIA,CAAgBC,IAAY,EAAE;EAChD,IAAIA,IAAI,CAACC,OAAO,EAAE;IAGhB,IAAI,CAACC,KAAK,CAACF,IAAI,CAACC,OAAO,CAACE,WAAW,CAAC;EACtC;EAEA,IAAI,CAACD,KAAK,CAACF,IAAI,CAACC,OAAO,CAAC;AAC1B;AAEO,SAASG,OAAOA,CAAgBJ,IAAe,EAAE;EAAA,IAAAK,gBAAA;EAGtD,IAAI,CAACC,yBAAyB,CAAC,CAAC;EAChC,IAAI,CAACC,kBAAkB,CAAC,CAAC;EAEzB,MAAMC,aAAa,IAAAH,gBAAA,GAAGL,IAAI,CAACS,UAAU,qBAAfJ,gBAAA,CAAiBK,MAAM;EAC7C,IAAIF,aAAa,EAAE;IAAA,IAAAG,qBAAA;IACjB,MAAMC,OAAO,GAAGZ,IAAI,CAACa,IAAI,CAACH,MAAM,GAAG,CAAC,GAAG,CAAC;IACxC,IAAI,CAACI,aAAa,CAACd,IAAI,CAACS,UAAU,EAAEM,SAAS,EAAEH,OAAO,CAAC;IACvD,IAAI,GAAAD,qBAAA,GAACX,IAAI,CAACS,UAAU,CAACD,aAAa,GAAG,CAAC,CAAC,CAACQ,gBAAgB,aAAnDL,qBAAA,CAAqDD,MAAM,GAAE;MAChE,IAAI,CAACE,OAAO,CAACA,OAAO,CAAC;IACvB;EACF;EAEA,IAAI,CAACE,aAAa,CAACd,IAAI,CAACa,IAAI,CAAC;AAC/B;AAEO,SAASI,cAAcA,CAAgBjB,IAAsB,EAAE;EAAA,IAA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Property(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.ClassAccessorProperty = ClassAccessorProperty;
|
| 7 |
+
exports.ClassBody = ClassBody;
|
| 8 |
+
exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration;
|
| 9 |
+
exports.ClassMethod = ClassMethod;
|
| 10 |
+
exports.ClassPrivateMethod = ClassPrivateMethod;
|
| 11 |
+
exports.ClassPrivateProperty = ClassPrivateProperty;
|
| 12 |
+
exports.ClassProperty = ClassProperty;
|
| 13 |
+
exports.StaticBlock = StaticBlock;
|
| 14 |
+
exports._classMethodHead = _classMethodHead;
|
| 15 |
+
var _t = require("@babel/types");
|
| 16 |
+
const {
|
| 17 |
+
isExportDefaultDeclaration,
|
| 18 |
+
isExportNamedDeclaration
|
| 19 |
+
} = _t;
|
| 20 |
+
function ClassDeclaration(node, parent) {
|
| 21 |
+
const inExport = isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent);
|
| 22 |
+
if (!inExport || !this._shouldPrintDecoratorsBeforeExport(parent)) {
|
| 23 |
+
this.printJoin(node.decorators);
|
| 24 |
+
}
|
| 25 |
+
if (node.declare) {
|
| 26 |
+
this.word("declare");
|
| 27 |
+
this.space();
|
| 28 |
+
}
|
| 29 |
+
if (node.abstract) {
|
| 30 |
+
this.word("abstract");
|
| 31 |
+
this.space();
|
| 32 |
+
}
|
| 33 |
+
this.word("class");
|
| 34 |
+
if (node.id) {
|
| 35 |
+
this.space();
|
| 36 |
+
this.print(node.id);
|
| 37 |
+
}
|
| 38 |
+
this.print(node.typeParameters);
|
| 39 |
+
if (node.superClass) {
|
| 40 |
+
this.space();
|
| 41 |
+
this.word("extends");
|
| 42 |
+
this.space();
|
| 43 |
+
this.print(node.superClass);
|
| 44 |
+
this.print(node.superTypeParameters);
|
| 45 |
+
}
|
| 46 |
+
if (node.implements) {
|
| 47 |
+
this.space();
|
| 48 |
+
this.word("implements");
|
| 49 |
+
this.space();
|
| 50 |
+
this.printList(node.implements);
|
| 51 |
+
}
|
| 52 |
+
this.space();
|
| 53 |
+
this.print(node.body);
|
| 54 |
+
}
|
| 55 |
+
function ClassBody(node) {
|
| 56 |
+
this.tokenChar(123);
|
| 57 |
+
if (node.body.length === 0) {
|
| 58 |
+
this.tokenChar(125);
|
| 59 |
+
} else {
|
| 60 |
+
this.newline();
|
| 61 |
+
const separator = classBodyEmptySemicolonsPrinter(this, node);
|
| 62 |
+
separator == null || separator(-1);
|
| 63 |
+
const exit = this.enterDelimited();
|
| 64 |
+
this.printJoin(node.body, true, true, separator, true);
|
| 65 |
+
exit();
|
| 66 |
+
if (!this.endsWith(10)) this.newline();
|
| 67 |
+
this.rightBrace(node);
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
function classBodyEmptySemicolonsPrinter(printer, node) {
|
| 71 |
+
if (!printer.tokenMap || node.start == null || node.end == null) {
|
| 72 |
+
return null;
|
| 73 |
+
}
|
| 74 |
+
const indexes = printer.tokenMap.getIndexes(node);
|
| 75 |
+
if (!indexes) return null;
|
| 76 |
+
let k = 1;
|
| 77 |
+
let occurrenceCount = 0;
|
| 78 |
+
let nextLocIndex = 0;
|
| 79 |
+
const advanceNextLocIndex = () => {
|
| 80 |
+
while (nextLocIndex < node.body.length && node.body[nextLocIndex].start == null) {
|
| 81 |
+
nextLocIndex++;
|
| 82 |
+
}
|
| 83 |
+
};
|
| 84 |
+
advanceNextLocIndex();
|
| 85 |
+
return i => {
|
| 86 |
+
if (nextLocIndex <= i) {
|
| 87 |
+
nextLocIndex = i + 1;
|
| 88 |
+
advanceNextLocIndex();
|
| 89 |
+
}
|
| 90 |
+
const end = nextLocIndex === node.body.length ? node.end : node.body[nextLocIndex].start;
|
| 91 |
+
let tok;
|
| 92 |
+
while (k < indexes.length && printer.tokenMap.matchesOriginal(tok = printer._tokens[indexes[k]], ";") && tok.start < end) {
|
| 93 |
+
printer.token(";", undefined, occurrenceCount++);
|
| 94 |
+
k++;
|
| 95 |
+
}
|
| 96 |
+
};
|
| 97 |
+
}
|
| 98 |
+
function ClassProperty(node) {
|
| 99 |
+
this.printJoin(node.decorators);
|
| 100 |
+
if (!node.static && !this.format.preserveFormat) {
|
| 101 |
+
var _node$key$loc;
|
| 102 |
+
const endLine = (_node$key$loc = node.key.loc) == null || (_node$key$loc = _node$key$loc.end) == null ? void 0 : _node$key$loc.line;
|
| 103 |
+
if (endLine) this.catchUp(endLine);
|
| 104 |
+
}
|
| 105 |
+
this.tsPrintClassMemberModifiers(node);
|
| 106 |
+
if (node.computed) {
|
| 107 |
+
this.tokenChar(91);
|
| 108 |
+
this.print(node.key);
|
| 109 |
+
this.tokenChar(93);
|
| 110 |
+
} else {
|
| 111 |
+
this._variance(node);
|
| 112 |
+
this.print(node.key);
|
| 113 |
+
}
|
| 114 |
+
if (node.optional) {
|
| 115 |
+
this.tokenChar(63);
|
| 116 |
+
}
|
| 117 |
+
if (node.definite) {
|
| 118 |
+
this.tokenChar(33);
|
| 119 |
+
}
|
| 120 |
+
this.print(node.typeAnnotation);
|
| 121 |
+
if (node.value) {
|
| 122 |
+
this.space();
|
| 123 |
+
this.tokenChar(61);
|
| 124 |
+
this.space();
|
| 125 |
+
this.print(node.value);
|
| 126 |
+
}
|
| 127 |
+
this.semicolon();
|
| 128 |
+
}
|
| 129 |
+
function ClassAccessorProperty(node) {
|
| 130 |
+
var _node$key$loc2;
|
| 131 |
+
this.printJoin(node.decorators);
|
| 132 |
+
const endLine = (_node$key$loc2 = node.key.loc) == null || (_node$key$loc2 = _node$key$loc2.end) == null ? void 0 : _node$key$loc2.line;
|
| 133 |
+
if (endLine) this.catchUp(endLine);
|
| 134 |
+
this.tsPrintClassMemberModifiers(node);
|
| 135 |
+
this.word("accessor", true);
|
| 136 |
+
this.space();
|
| 137 |
+
if (node.computed) {
|
| 138 |
+
this.tokenChar(91);
|
| 139 |
+
this.print(node.key);
|
| 140 |
+
this.tokenChar(93);
|
| 141 |
+
} else {
|
| 142 |
+
this._variance(node);
|
| 143 |
+
this.print(node.key);
|
| 144 |
+
}
|
| 145 |
+
if (node.optional) {
|
| 146 |
+
this.tokenChar(63);
|
| 147 |
+
}
|
| 148 |
+
if (node.definite) {
|
| 149 |
+
this.tokenChar(33);
|
| 150 |
+
}
|
| 151 |
+
this.print(node.typeAnnotation);
|
| 152 |
+
if (node.value) {
|
| 153 |
+
this.space();
|
| 154 |
+
this.tokenChar(61);
|
| 155 |
+
this.space();
|
| 156 |
+
this.print(node.value);
|
| 157 |
+
}
|
| 158 |
+
this.semicolon();
|
| 159 |
+
}
|
| 160 |
+
function ClassPrivateProperty(node) {
|
| 161 |
+
this.printJoin(node.decorators);
|
| 162 |
+
this.tsPrintClassMemberModifiers(node);
|
| 163 |
+
this.print(node.key);
|
| 164 |
+
if (node.optional) {
|
| 165 |
+
this.tokenChar(63);
|
| 166 |
+
}
|
| 167 |
+
if (node.definite) {
|
| 168 |
+
this.tokenChar(33);
|
| 169 |
+
}
|
| 170 |
+
this.print(node.typeAnnotation);
|
| 171 |
+
if (node.value) {
|
| 172 |
+
this.space();
|
| 173 |
+
this.tokenChar(61);
|
| 174 |
+
this.space();
|
| 175 |
+
this.print(node.value);
|
| 176 |
+
}
|
| 177 |
+
this.semicolon();
|
| 178 |
+
}
|
| 179 |
+
function ClassMethod(node) {
|
| 180 |
+
this._classMethodHead(node);
|
| 181 |
+
this.space();
|
| 182 |
+
this.print(node.body);
|
| 183 |
+
}
|
| 184 |
+
function ClassPrivateMethod(node) {
|
| 185 |
+
this._classMethodHead(node);
|
| 186 |
+
this.space();
|
| 187 |
+
this.print(node.body);
|
| 188 |
+
}
|
| 189 |
+
function _classMethodHead(node) {
|
| 190 |
+
this.printJoin(node.decorators);
|
| 191 |
+
if (!this.format.preserveFormat) {
|
| 192 |
+
var _node$key$loc3;
|
| 193 |
+
const endLine = (_node$key$loc3 = node.key.loc) == null || (_node$key$loc3 = _node$key$loc3.end) == null ? void 0 : _node$key$loc3.line;
|
| 194 |
+
if (endLine) this.catchUp(endLine);
|
| 195 |
+
}
|
| 196 |
+
this.tsPrintClassMemberModifiers(node);
|
| 197 |
+
this._methodHead(node);
|
| 198 |
+
}
|
| 199 |
+
function StaticBlock(node) {
|
| 200 |
+
this.word("static");
|
| 201 |
+
this.space();
|
| 202 |
+
this.tokenChar(123);
|
| 203 |
+
if (node.body.length === 0) {
|
| 204 |
+
this.tokenChar(125);
|
| 205 |
+
} else {
|
| 206 |
+
this.newline();
|
| 207 |
+
this.printSequence(node.body, true);
|
| 208 |
+
this.rightBrace(node);
|
| 209 |
+
}
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
//# sourceMappingURL=classes.js.map
|
ui/node_modules/@babel/generator/lib/generators/classes.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","isExportDefaultDeclaration","isExportNamedDeclaration","ClassDeclaration","node","parent","inExport","_shouldPrintDecoratorsBeforeExport","printJoin","decorators","declare","word","space","abstract","id","print","typeParameters","superClass","superTypeParameters","implements","printList","body","ClassBody","token","length","newline","separator","classBodyEmptySemicolonsPrinter","exit","enterDelimited","endsWith","rightBrace","printer","tokenMap","start","end","indexes","getIndexes","k","occurrenceCount","nextLocIndex","advanceNextLocIndex","i","tok","matchesOriginal","_tokens","undefined","ClassProperty","static","format","preserveFormat","_node$key$loc","endLine","key","loc","line","catchUp","tsPrintClassMemberModifiers","computed","_variance","optional","definite","typeAnnotation","value","semicolon","ClassAccessorProperty","_node$key$loc2","ClassPrivateProperty","ClassMethod","_classMethodHead","ClassPrivateMethod","_node$key$loc3","_methodHead","StaticBlock","printSequence"],"sources":["../../src/generators/classes.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isExportDefaultDeclaration,\n isExportNamedDeclaration,\n} 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\";\n\nexport function ClassDeclaration(\n this: Printer,\n node: t.ClassDeclaration,\n parent: t.Node,\n) {\n const inExport =\n isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent);\n\n if (\n !inExport ||\n !this._shouldPrintDecoratorsBeforeExport(\n parent as t.ExportDeclaration & { declaration: t.ClassDeclaration },\n )\n ) {\n this.printJoin(node.decorators);\n }\n\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n if (node.abstract) {\n // TS\n this.word(\"abstract\");\n this.space();\n }\n\n this.word(\"class\");\n\n if (node.id) {\n this.space();\n this.print(node.id);\n }\n\n this.print(node.typeParameters);\n\n if (node.superClass) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.superClass);\n this.print(\n process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Renamed\n node.superTypeArguments\n : // @ts-ignore(Babel 7 vs Babel 8) Renamed\n node.superTypeParameters,\n );\n }\n\n if (node.implements) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements);\n }\n\n this.space();\n this.print(node.body);\n}\n\nexport { ClassDeclaration as ClassExpression };\n\nexport function ClassBody(this: Printer, node: t.ClassBody) {\n this.token(\"{\");\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n\n const separator = classBodyEmptySemicolonsPrinter(this, node);\n separator?.(-1); // print leading semicolons in preserveFormat mode\n\n const exit = this.enterDelimited();\n this.printJoin(node.body, true, true, separator, true);\n exit();\n\n if (!this.endsWith(charCodes.lineFeed)) this.newline();\n\n this.rightBrace(node);\n }\n}\n\nfunction classBodyEmptySemicolonsPrinter(printer: Printer, node: t.ClassBody) {\n if (!printer.tokenMap || node.start == null || node.end == null) {\n return null;\n }\n\n // \"empty statements\" in class bodies are not represented in the AST.\n // Print them by checking if there are any ; tokens between the current AST\n // member and the next one.\n\n const indexes = printer.tokenMap.getIndexes(node);\n if (!indexes) return null;\n\n let k = 1; // start from 1 to skip '{'\n\n let occurrenceCount = 0;\n\n let nextLocIndex = 0;\n const advanceNextLocIndex = () => {\n while (\n nextLocIndex < node.body.length &&\n node.body[nextLocIndex].start == null\n ) {\n nextLocIndex++;\n }\n };\n advanceNextLocIndex();\n\n return (i: number) => {\n if (nextLocIndex <= i) {\n nextLocIndex = i + 1;\n advanceNextLocIndex();\n }\n\n const end =\n nextLocIndex === node.body.length\n ? node.end\n : node.body[nextLocIndex].start;\n\n let tok;\n while (\n k < indexes.length &&\n printer.tokenMap.matchesOriginal(\n (tok = printer._tokens[indexes[k]]),\n \";\",\n ) &&\n tok.start < end\n ) {\n printer.token(\";\", undefined, occurrenceCount++);\n k++;\n }\n };\n}\n\nexport function ClassProperty(this: Printer, node: t.ClassProperty) {\n this.printJoin(node.decorators);\n\n if (!node.static && !this.format.preserveFormat) {\n // catch up to property key, avoid line break\n // between member TS modifiers and the property key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n }\n\n this.tsPrintClassMemberModifiers(node);\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key);\n this.token(\"]\");\n } else {\n this._variance(node);\n this.print(node.key);\n }\n\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n\n this.print(node.typeAnnotation);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value);\n }\n this.semicolon();\n}\n\nexport function ClassAccessorProperty(\n this: Printer,\n node: t.ClassAccessorProperty,\n) {\n this.printJoin(node.decorators);\n\n // catch up to property key, avoid line break\n // between member modifiers and the property key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n\n // TS does not support class accessor property yet\n this.tsPrintClassMemberModifiers(node);\n\n this.word(\"accessor\", true);\n this.space();\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key);\n this.token(\"]\");\n } else {\n // Todo: Flow does not support class accessor property yet.\n this._variance(node);\n this.print(node.key);\n }\n\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n\n this.print(node.typeAnnotation);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value);\n }\n this.semicolon();\n}\n\nexport function ClassPrivateProperty(\n this: Printer,\n node: t.ClassPrivateProperty,\n) {\n this.printJoin(node.decorators);\n this.tsPrintClassMemberModifiers(node);\n this.print(node.key);\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n this.print(node.typeAnnotation);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value);\n }\n this.semicolon();\n}\n\nexport function ClassMethod(this: Printer, node: t.ClassMethod) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body);\n}\n\nexport function ClassPrivateMethod(this: Printer, node: t.ClassPrivateMethod) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body);\n}\n\nexport function _classMethodHead(\n this: Printer,\n node: t.ClassMethod | t.ClassPrivateMethod | t.TSDeclareMethod,\n) {\n this.printJoin(node.decorators);\n\n if (!this.format.preserveFormat) {\n // catch up to method key, avoid line break\n // between member modifiers/method heads and the method key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n }\n\n this.tsPrintClassMemberModifiers(node);\n this._methodHead(node);\n}\n\nexport function StaticBlock(this: Printer, node: t.StaticBlock) {\n this.word(\"static\");\n this.space();\n this.token(\"{\");\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n this.printSequence(node.body, true);\n this.rightBrace(node);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAGsB;EAFpBC,0BAA0B;EAC1BC;AAAwB,IAAAH,EAAA;AAQnB,SAASI,gBAAgBA,CAE9BC,IAAwB,EACxBC,MAAc,EACd;EACA,MAAMC,QAAQ,GACZL,0BAA0B,CAACI,MAAM,CAAC,IAAIH,wBAAwB,CAACG,MAAM,CAAC;EAExE,IACE,CAACC,QAAQ,IACT,CAAC,IAAI,CAACC,kCAAkC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CAACD,SAAK,IAAI,CAAC;EACjB,CAAC,MAAM;IACL,IAAI,CAACE,OAAO,CAAC,CAAC;IACd,IAAI,CAACiD,aAAa,CAACtE,IAAI,CAACiB,IAAI,EAAE,IAAI,CAAC;IACnC,IAAI,CAACU,UAAU,CAAC3B,IAAI,CAAC;EACvB;AACF","ignoreList":[]}
|
ui/node_modules/@babel/generator/lib/generators/deprecated.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.addDeprecatedGenerators = addDeprecatedGenerators;
|
| 7 |
+
function addDeprecatedGenerators(PrinterClass) {
|
| 8 |
+
{
|
| 9 |
+
const deprecatedBabel7Generators = {
|
| 10 |
+
Noop() {},
|
| 11 |
+
TSExpressionWithTypeArguments(node) {
|
| 12 |
+
this.print(node.expression);
|
| 13 |
+
this.print(node.typeParameters);
|
| 14 |
+
},
|
| 15 |
+
DecimalLiteral(node) {
|
| 16 |
+
const raw = this.getPossibleRaw(node);
|
| 17 |
+
if (!this.format.minified && raw !== undefined) {
|
| 18 |
+
this.word(raw);
|
| 19 |
+
return;
|
| 20 |
+
}
|
| 21 |
+
this.word(node.value + "m");
|
| 22 |
+
}
|
| 23 |
+
};
|
| 24 |
+
Object.assign(PrinterClass.prototype, deprecatedBabel7Generators);
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
//# sourceMappingURL=deprecated.js.map
|
ui/node_modules/@babel/generator/lib/generators/deprecated.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["addDeprecatedGenerators","PrinterClass","deprecatedBabel7Generators","Noop","TSExpressionWithTypeArguments","node","print","expression","typeParameters","DecimalLiteral","raw","getPossibleRaw","format","minified","undefined","word","value","Object","assign","prototype"],"sources":["../../src/generators/deprecated.ts"],"sourcesContent":["import type Printer from \"../printer\";\nimport type * as t from \"@babel/types\";\n\nexport type DeprecatedBabel7ASTTypes =\n | \"Noop\"\n | \"TSExpressionWithTypeArguments\"\n | \"DecimalLiteral\";\n\nexport function addDeprecatedGenerators(PrinterClass: typeof Printer) {\n // Add Babel 7 generator methods that is removed in Babel 8\n if (!process.env.BABEL_8_BREAKING) {\n const deprecatedBabel7Generators = {\n Noop(this: Printer) {},\n\n TSExpressionWithTypeArguments(\n this: Printer,\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node: t.TSExpressionWithTypeArguments,\n ) {\n this.print(node.expression);\n this.print(node.typeParameters);\n },\n\n DecimalLiteral(this: Printer, node: any) {\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 + \"m\");\n },\n } satisfies Record<\n DeprecatedBabel7ASTTypes,\n (this: Printer, node: any) => void\n >;\n Object.assign(PrinterClass.prototype, deprecatedBabel7Generators);\n }\n}\n"],"mappings":";;;;;;AAQO,SAASA,uBAAuBA,CAACC,YAA4B,EAAE;EAEjC;IACjC,MAAMC,0BAA0B,GAAG;MACjCC,IAAIA,CAAA,EAAgB,CAAC,CAAC;MAEtBC,6BAA6BA,CAG3BC,IAAqC,EACrC;QACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,UAAU,CAAC;QAC3B,IAAI,CAACD,KAAK,CAACD,IAAI,CAACG,cAAc,CAAC;MACjC,CAAC;MAEDC,cAAcA,CAAgBJ,IAAS,EAAE;QACvC,MAAMK,GAAG,GAAG,IAAI,CAACC,cAAc,CAACN,IAAI,CAAC;QACrC,IAAI,CAAC,IA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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression;
|
| 7 |
+
exports.AssignmentPattern = AssignmentPattern;
|
| 8 |
+
exports.AwaitExpression = AwaitExpression;
|
| 9 |
+
exports.BindExpression = BindExpression;
|
| 10 |
+
exports.CallExpression = CallExpression;
|
| 11 |
+
exports.ConditionalExpression = ConditionalExpression;
|
| 12 |
+
exports.Decorator = Decorator;
|
| 13 |
+
exports.DoExpression = DoExpression;
|
| 14 |
+
exports.EmptyStatement = EmptyStatement;
|
| 15 |
+
exports.ExpressionStatement = ExpressionStatement;
|
| 16 |
+
exports.Import = Import;
|
| 17 |
+
exports.MemberExpression = MemberExpression;
|
| 18 |
+
exports.MetaProperty = MetaProperty;
|
| 19 |
+
exports.ModuleExpression = ModuleExpression;
|
| 20 |
+
exports.NewExpression = NewExpression;
|
| 21 |
+
exports.OptionalCallExpression = OptionalCallExpression;
|
| 22 |
+
exports.OptionalMemberExpression = OptionalMemberExpression;
|
| 23 |
+
exports.ParenthesizedExpression = ParenthesizedExpression;
|
| 24 |
+
exports.PrivateName = PrivateName;
|
| 25 |
+
exports.SequenceExpression = SequenceExpression;
|
| 26 |
+
exports.Super = Super;
|
| 27 |
+
exports.ThisExpression = ThisExpression;
|
| 28 |
+
exports.UnaryExpression = UnaryExpression;
|
| 29 |
+
exports.UpdateExpression = UpdateExpression;
|
| 30 |
+
exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
|
| 31 |
+
exports.YieldExpression = YieldExpression;
|
| 32 |
+
exports._shouldPrintDecoratorsBeforeExport = _shouldPrintDecoratorsBeforeExport;
|
| 33 |
+
var _t = require("@babel/types");
|
| 34 |
+
var _index = require("../node/index.js");
|
| 35 |
+
const {
|
| 36 |
+
isCallExpression,
|
| 37 |
+
isLiteral,
|
| 38 |
+
isMemberExpression,
|
| 39 |
+
isNewExpression,
|
| 40 |
+
isPattern
|
| 41 |
+
} = _t;
|
| 42 |
+
function UnaryExpression(node) {
|
| 43 |
+
const {
|
| 44 |
+
operator
|
| 45 |
+
} = node;
|
| 46 |
+
if (operator === "void" || operator === "delete" || operator === "typeof" || operator === "throw") {
|
| 47 |
+
this.word(operator);
|
| 48 |
+
this.space();
|
| 49 |
+
} else {
|
| 50 |
+
this.token(operator);
|
| 51 |
+
}
|
| 52 |
+
this.print(node.argument);
|
| 53 |
+
}
|
| 54 |
+
function DoExpression(node) {
|
| 55 |
+
if (node.async) {
|
| 56 |
+
this.word("async", true);
|
| 57 |
+
this.space();
|
| 58 |
+
}
|
| 59 |
+
this.word("do");
|
| 60 |
+
this.space();
|
| 61 |
+
this.print(node.body);
|
| 62 |
+
}
|
| 63 |
+
function ParenthesizedExpression(node) {
|
| 64 |
+
this.tokenChar(40);
|
| 65 |
+
const exit = this.enterDelimited();
|
| 66 |
+
this.print(node.expression);
|
| 67 |
+
exit();
|
| 68 |
+
this.rightParens(node);
|
| 69 |
+
}
|
| 70 |
+
function UpdateExpression(node) {
|
| 71 |
+
if (node.prefix) {
|
| 72 |
+
this.token(node.operator);
|
| 73 |
+
this.print(node.argument);
|
| 74 |
+
} else {
|
| 75 |
+
this.print(node.argument, true);
|
| 76 |
+
this.token(node.operator);
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
function ConditionalExpression(node) {
|
| 80 |
+
this.print(node.test);
|
| 81 |
+
this.space();
|
| 82 |
+
this.tokenChar(63);
|
| 83 |
+
this.space();
|
| 84 |
+
this.print(node.consequent);
|
| 85 |
+
this.space();
|
| 86 |
+
this.tokenChar(58);
|
| 87 |
+
this.space();
|
| 88 |
+
this.print(node.alternate);
|
| 89 |
+
}
|
| 90 |
+
function NewExpression(node, parent) {
|
| 91 |
+
this.word("new");
|
| 92 |
+
this.space();
|
| 93 |
+
this.print(node.callee);
|
| 94 |
+
if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, {
|
| 95 |
+
callee: node
|
| 96 |
+
}) && !isMemberExpression(parent) && !isNewExpression(parent)) {
|
| 97 |
+
return;
|
| 98 |
+
}
|
| 99 |
+
this.print(node.typeArguments);
|
| 100 |
+
{
|
| 101 |
+
this.print(node.typeParameters);
|
| 102 |
+
}
|
| 103 |
+
if (node.optional) {
|
| 104 |
+
this.token("?.");
|
| 105 |
+
}
|
| 106 |
+
if (node.arguments.length === 0 && this.tokenMap && !this.tokenMap.endMatches(node, ")")) {
|
| 107 |
+
return;
|
| 108 |
+
}
|
| 109 |
+
this.tokenChar(40);
|
| 110 |
+
const exit = this.enterDelimited();
|
| 111 |
+
this.printList(node.arguments, this.shouldPrintTrailingComma(")"));
|
| 112 |
+
exit();
|
| 113 |
+
this.rightParens(node);
|
| 114 |
+
}
|
| 115 |
+
function SequenceExpression(node) {
|
| 116 |
+
this.printList(node.expressions);
|
| 117 |
+
}
|
| 118 |
+
function ThisExpression() {
|
| 119 |
+
this.word("this");
|
| 120 |
+
}
|
| 121 |
+
function Super() {
|
| 122 |
+
this.word("super");
|
| 123 |
+
}
|
| 124 |
+
function _shouldPrintDecoratorsBeforeExport(node) {
|
| 125 |
+
if (typeof this.format.decoratorsBeforeExport === "boolean") {
|
| 126 |
+
return this.format.decoratorsBeforeExport;
|
| 127 |
+
}
|
| 128 |
+
return typeof node.start === "number" && node.start === node.declaration.start;
|
| 129 |
+
}
|
| 130 |
+
function Decorator(node) {
|
| 131 |
+
this.tokenChar(64);
|
| 132 |
+
this.print(node.expression);
|
| 133 |
+
this.newline();
|
| 134 |
+
}
|
| 135 |
+
function OptionalMemberExpression(node) {
|
| 136 |
+
let {
|
| 137 |
+
computed
|
| 138 |
+
} = node;
|
| 139 |
+
const {
|
| 140 |
+
optional,
|
| 141 |
+
property
|
| 142 |
+
} = node;
|
| 143 |
+
this.print(node.object);
|
| 144 |
+
if (!computed && isMemberExpression(property)) {
|
| 145 |
+
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
| 146 |
+
}
|
| 147 |
+
if (isLiteral(property) && typeof property.value === "number") {
|
| 148 |
+
computed = true;
|
| 149 |
+
}
|
| 150 |
+
if (optional) {
|
| 151 |
+
this.token("?.");
|
| 152 |
+
}
|
| 153 |
+
if (computed) {
|
| 154 |
+
this.tokenChar(91);
|
| 155 |
+
this.print(property);
|
| 156 |
+
this.tokenChar(93);
|
| 157 |
+
} else {
|
| 158 |
+
if (!optional) {
|
| 159 |
+
this.tokenChar(46);
|
| 160 |
+
}
|
| 161 |
+
this.print(property);
|
| 162 |
+
}
|
| 163 |
+
}
|
| 164 |
+
function OptionalCallExpression(node) {
|
| 165 |
+
this.print(node.callee);
|
| 166 |
+
{
|
| 167 |
+
this.print(node.typeParameters);
|
| 168 |
+
}
|
| 169 |
+
if (node.optional) {
|
| 170 |
+
this.token("?.");
|
| 171 |
+
}
|
| 172 |
+
this.print(node.typeArguments);
|
| 173 |
+
this.tokenChar(40);
|
| 174 |
+
const exit = this.enterDelimited();
|
| 175 |
+
this.printList(node.arguments);
|
| 176 |
+
exit();
|
| 177 |
+
this.rightParens(node);
|
| 178 |
+
}
|
| 179 |
+
function CallExpression(node) {
|
| 180 |
+
this.print(node.callee);
|
| 181 |
+
this.print(node.typeArguments);
|
| 182 |
+
{
|
| 183 |
+
this.print(node.typeParameters);
|
| 184 |
+
}
|
| 185 |
+
this.tokenChar(40);
|
| 186 |
+
const exit = this.enterDelimited();
|
| 187 |
+
this.printList(node.arguments, this.shouldPrintTrailingComma(")"));
|
| 188 |
+
exit();
|
| 189 |
+
this.rightParens(node);
|
| 190 |
+
}
|
| 191 |
+
function Import() {
|
| 192 |
+
this.word("import");
|
| 193 |
+
}
|
| 194 |
+
function AwaitExpression(node) {
|
| 195 |
+
this.word("await");
|
| 196 |
+
if (node.argument) {
|
| 197 |
+
this.space();
|
| 198 |
+
this.printTerminatorless(node.argument);
|
| 199 |
+
}
|
| 200 |
+
}
|
| 201 |
+
function YieldExpression(node) {
|
| 202 |
+
this.word("yield", true);
|
| 203 |
+
if (node.delegate) {
|
| 204 |
+
this.tokenChar(42);
|
| 205 |
+
if (node.argument) {
|
| 206 |
+
this.space();
|
| 207 |
+
this.print(node.argument);
|
| 208 |
+
}
|
| 209 |
+
} else {
|
| 210 |
+
if (node.argument) {
|
| 211 |
+
this.space();
|
| 212 |
+
this.printTerminatorless(node.argument);
|
| 213 |
+
}
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
function EmptyStatement() {
|
| 217 |
+
this.semicolon(true);
|
| 218 |
+
}
|
| 219 |
+
function ExpressionStatement(node) {
|
| 220 |
+
this.tokenContext |= _index.TokenContext.expressionStatement;
|
| 221 |
+
this.print(node.expression);
|
| 222 |
+
this.semicolon();
|
| 223 |
+
}
|
| 224 |
+
function AssignmentPattern(node) {
|
| 225 |
+
this.print(node.left);
|
| 226 |
+
if (node.left.type === "Identifier" || isPattern(node.left)) {
|
| 227 |
+
if (node.left.optional) this.tokenChar(63);
|
| 228 |
+
this.print(node.left.typeAnnotation);
|
| 229 |
+
}
|
| 230 |
+
this.space();
|
| 231 |
+
this.tokenChar(61);
|
| 232 |
+
this.space();
|
| 233 |
+
this.print(node.right);
|
| 234 |
+
}
|
| 235 |
+
function AssignmentExpression(node) {
|
| 236 |
+
this.print(node.left);
|
| 237 |
+
this.space();
|
| 238 |
+
if (node.operator === "in" || node.operator === "instanceof") {
|
| 239 |
+
this.word(node.operator);
|
| 240 |
+
} else {
|
| 241 |
+
this.token(node.operator);
|
| 242 |
+
this._endsWithDiv = node.operator === "/";
|
| 243 |
+
}
|
| 244 |
+
this.space();
|
| 245 |
+
this.print(node.right);
|
| 246 |
+
}
|
| 247 |
+
function BindExpression(node) {
|
| 248 |
+
this.print(node.object);
|
| 249 |
+
this.token("::");
|
| 250 |
+
this.print(node.callee);
|
| 251 |
+
}
|
| 252 |
+
function MemberExpression(node) {
|
| 253 |
+
this.print(node.object);
|
| 254 |
+
if (!node.computed && isMemberExpression(node.property)) {
|
| 255 |
+
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
| 256 |
+
}
|
| 257 |
+
let computed = node.computed;
|
| 258 |
+
if (isLiteral(node.property) && typeof node.property.value === "number") {
|
| 259 |
+
computed = true;
|
| 260 |
+
}
|
| 261 |
+
if (computed) {
|
| 262 |
+
const exit = this.enterDelimited();
|
| 263 |
+
this.tokenChar(91);
|
| 264 |
+
this.print(node.property);
|
| 265 |
+
this.tokenChar(93);
|
| 266 |
+
exit();
|
| 267 |
+
} else {
|
| 268 |
+
this.tokenChar(46);
|
| 269 |
+
this.print(node.property);
|
| 270 |
+
}
|
| 271 |
+
}
|
| 272 |
+
function MetaProperty(node) {
|
| 273 |
+
this.print(node.meta);
|
| 274 |
+
this.tokenChar(46);
|
| 275 |
+
this.print(node.property);
|
| 276 |
+
}
|
| 277 |
+
function PrivateName(node) {
|
| 278 |
+
this.tokenChar(35);
|
| 279 |
+
this.print(node.id);
|
| 280 |
+
}
|
| 281 |
+
function V8IntrinsicIdentifier(node) {
|
| 282 |
+
this.tokenChar(37);
|
| 283 |
+
this.word(node.name);
|
| 284 |
+
}
|
| 285 |
+
function ModuleExpression(node) {
|
| 286 |
+
this.word("module", true);
|
| 287 |
+
this.space();
|
| 288 |
+
this.tokenChar(123);
|
| 289 |
+
this.indent();
|
| 290 |
+
const {
|
| 291 |
+
body
|
| 292 |
+
} = node;
|
| 293 |
+
if (body.body.length || body.directives.length) {
|
| 294 |
+
this.newline();
|
| 295 |
+
}
|
| 296 |
+
this.print(body);
|
| 297 |
+
this.dedent();
|
| 298 |
+
this.rightBrace(node);
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
//# sourceMappingURL=expressions.js.map
|
ui/node_modules/@babel/generator/lib/generators/expressions.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_index","isCallExpression","isLiteral","isMemberExpression","isNewExpression","isPattern","UnaryExpression","node","operator","word","space","token","print","argument","DoExpression","async","body","ParenthesizedExpression","exit","enterDelimited","expression","rightParens","UpdateExpression","prefix","ConditionalExpression","test","consequent","alternate","NewExpression","parent","callee","format","minified","arguments","length","optional","typeArguments","typeParameters","tokenMap","endMatches","printList","shouldPrintTrailingComma","SequenceExpression","expressions","ThisExpression","Super","_shouldPrintDecoratorsBeforeExport","decoratorsBeforeExport","start","declaration","Decorator","newline","OptionalMemberExpression","computed","property","object","TypeError","value","OptionalCallExpression","CallExpression","Import","AwaitExpression","printTerminatorless","YieldExpression","delegate","EmptyStatement","semicolon","ExpressionStatement","tokenContext","TokenContext","expressionStatement","AssignmentPattern","left","type","typeAnnotation","right","AssignmentExpression","_endsWithDiv","BindExpression","MemberExpression","MetaProperty","meta","PrivateName","id","V8IntrinsicIdentifier","name","ModuleExpression","indent","directives","dedent","rightBrace"],"sources":["../../src/generators/expressions.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isCallExpression,\n isLiteral,\n isMemberExpression,\n isNewExpression,\n isPattern,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function UnaryExpression(this: Printer, node: t.UnaryExpression) {\n const { operator } = node;\n if (\n operator === \"void\" ||\n operator === \"delete\" ||\n operator === \"typeof\" ||\n // throwExpressions\n operator === \"throw\"\n ) {\n this.word(operator);\n this.space();\n } else {\n this.token(operator);\n }\n\n this.print(node.argument);\n}\n\nexport function DoExpression(this: Printer, node: t.DoExpression) {\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n this.word(\"do\");\n this.space();\n this.print(node.body);\n}\n\nexport function ParenthesizedExpression(\n this: Printer,\n node: t.ParenthesizedExpression,\n) {\n this.token(\"(\");\n const exit = this.enterDelimited();\n this.print(node.expression);\n exit();\n this.rightParens(node);\n}\n\nexport function UpdateExpression(this: Printer, node: t.UpdateExpression) {\n if (node.prefix) {\n this.token(node.operator);\n this.print(node.argument);\n } else {\n this.print(node.argument, true);\n this.token(node.operator);\n }\n}\n\nexport function ConditionalExpression(\n this: Printer,\n node: t.ConditionalExpression,\n) {\n this.print(node.test);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.consequent);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.alternate);\n}\n\nexport function NewExpression(\n this: Printer,\n node: t.NewExpression,\n parent: t.Node,\n) {\n this.word(\"new\");\n this.space();\n this.print(node.callee);\n if (\n this.format.minified &&\n node.arguments.length === 0 &&\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n !node.optional &&\n !isCallExpression(parent, { callee: node }) &&\n !isMemberExpression(parent) &&\n !isNewExpression(parent)\n ) {\n return;\n }\n\n this.print(node.typeArguments);\n if (!process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters); // Legacy TS AST\n }\n\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n if (node.optional) {\n // TODO: This can never happen\n this.token(\"?.\");\n }\n\n if (\n node.arguments.length === 0 &&\n this.tokenMap &&\n !this.tokenMap.endMatches(node, \")\")\n ) {\n return;\n }\n\n this.token(\"(\");\n const exit = this.enterDelimited();\n this.printList(node.arguments, this.shouldPrintTrailingComma(\")\"));\n exit();\n this.rightParens(node);\n}\n\nexport function SequenceExpression(this: Printer, node: t.SequenceExpression) {\n this.printList(node.expressions);\n}\n\nexport function ThisExpression(this: Printer) {\n this.word(\"this\");\n}\n\nexport function Super(this: Printer) {\n this.word(\"super\");\n}\n\nexport function _shouldPrintDecoratorsBeforeExport(\n this: Printer,\n node: t.ExportDeclaration & { declaration: t.ClassDeclaration },\n) {\n if (typeof this.format.decoratorsBeforeExport === \"boolean\") {\n return this.format.decoratorsBeforeExport;\n }\n return (\n typeof node.start === \"number\" && node.start === node.declaration.start\n );\n}\n\nexport function Decorator(this: Printer, node: t.Decorator) {\n this.token(\"@\");\n this.print(node.expression);\n this.newline();\n}\n\nexport function OptionalMemberExpression(\n this: Printer,\n node: t.OptionalMemberExpression,\n) {\n let { computed } = node;\n const { optional, property } = node;\n\n this.print(node.object);\n\n if (!computed && isMemberExpression(property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n // @ts-expect-error todo(flow->ts) maybe instead of typeof check specific literal types?\n if (isLiteral(property) && typeof property.value === \"number\") {\n computed = true;\n }\n if (optional) {\n this.token(\"?.\");\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(property);\n this.token(\"]\");\n } else {\n if (!optional) {\n this.token(\".\");\n }\n this.print(property);\n }\n}\n\nexport function OptionalCallExpression(\n this: Printer,\n node: t.OptionalCallExpression,\n) {\n this.print(node.callee);\n\n if (!process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters); // legacy TS AST\n }\n\n if (node.optional) {\n this.token(\"?.\");\n }\n\n this.print(node.typeArguments);\n\n this.token(\"(\");\n const exit = this.enterDelimited();\n this.printList(node.arguments);\n exit();\n this.rightParens(node);\n}\n\nexport function CallExpression(this: Printer, node: t.CallExpression) {\n this.print(node.callee);\n\n this.print(node.typeArguments);\n if (!process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters); // legacy TS AST\n }\n this.token(\"(\");\n const exit = this.enterDelimited();\n this.printList(node.arguments, this.shouldPrintTrailingComma(\")\"));\n exit();\n this.rightParens(node);\n}\n\nexport function Import(this: Printer) {\n this.word(\"import\");\n}\n\nexport function AwaitExpression(this: Printer, node: t.AwaitExpression) {\n this.word(\"await\");\n\n if (node.argument) {\n this.space();\n this.printTerminatorless(node.argument);\n }\n}\n\nexport function YieldExpression(this: Printer, node: t.YieldExpression) {\n this.word(\"yield\", true);\n\n if (node.delegate) {\n this.token(\"*\");\n if (node.argument) {\n this.space();\n // line terminators are allowed after yield*\n this.print(node.argument);\n }\n } else {\n if (node.argument) {\n this.space();\n this.printTerminatorless(node.argument);\n }\n }\n}\n\nexport function EmptyStatement(this: Printer) {\n this.semicolon(true /* force */);\n}\n\nexport function ExpressionStatement(\n this: Printer,\n node: t.ExpressionStatement,\n) {\n this.tokenContext |= TokenContext.expressionStatement;\n this.print(node.expression);\n this.semicolon();\n}\n\nexport function AssignmentPattern(this: Printer, node: t.AssignmentPattern) {\n this.print(node.left);\n if (node.left.type === \"Identifier\" || isPattern(node.left)) {\n if (node.left.optional) this.token(\"?\");\n this.print(node.left.typeAnnotation);\n }\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.right);\n}\n\nexport function AssignmentExpression(\n this: Printer,\n node: t.AssignmentExpression | t.BinaryExpression | t.LogicalExpression,\n) {\n this.print(node.left);\n\n this.space();\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n this.word(node.operator);\n } else {\n this.token(node.operator);\n this._endsWithDiv = node.operator === \"/\";\n }\n this.space();\n\n this.print(node.right);\n}\n\nexport function BindExpression(this: Printer, node: t.BindExpression) {\n this.print(node.object);\n this.token(\"::\");\n this.print(node.callee);\n}\n\nexport {\n AssignmentExpression as BinaryExpression,\n AssignmentExpression as LogicalExpression,\n};\n\nexport function MemberExpression(this: Printer, node: t.MemberExpression) {\n this.print(node.object);\n\n if (!node.computed && isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n let computed = node.computed;\n // @ts-expect-error todo(flow->ts) maybe use specific literal types\n if (isLiteral(node.property) && typeof node.property.value === \"number\") {\n computed = true;\n }\n\n if (computed) {\n const exit = this.enterDelimited();\n this.token(\"[\");\n this.print(node.property);\n this.token(\"]\");\n exit();\n } else {\n this.token(\".\");\n this.print(node.property);\n }\n}\n\nexport function MetaProperty(this: Printer, node: t.MetaProperty) {\n this.print(node.meta);\n this.token(\".\");\n this.print(node.property);\n}\n\nexport function PrivateName(this: Printer, node: t.PrivateName) {\n this.token(\"#\");\n this.print(node.id);\n}\n\nexport function V8IntrinsicIdentifier(\n this: Printer,\n node: t.V8IntrinsicIdentifier,\n) {\n this.token(\"%\");\n this.word(node.name);\n}\n\nexport function ModuleExpression(this: Printer, node: t.ModuleExpression) {\n this.word(\"module\", true);\n this.space();\n this.token(\"{\");\n this.indent();\n const { body } = node;\n if (body.body.length || body.directives.length) {\n this.newline();\n }\n this.print(body);\n this.dedent();\n this.rightBrace(node);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAD,OAAA;AAAgD;EAP9CE,gBAAgB;EAChBC,SAAS;EACTC,kBAAkB;EAClBC,eAAe;EACfC;AAAS,IAAAP,EAAA;AAKJ,SAASQ,eAAeA,CAAgBC,IAAuB,EAAE;EACtE,MAAM;IAAEC;EAAS,CAAC,GAAGD,IAAI;EACzB,IACEC,QAAQ,KAAK,MAAM,IACnBA,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,QAAQ,IAErBA,QAAQ,KAAK,OAAO,EACpB;IACA,IAAI,CAACC,IAAI,CAACD,QAAQ,CAAC;IACnB,IAAI,CAACE,KAAK,CAAC,CAAC;EACd,CAAC,MAAM;IACL,IAAI,CAACC,KAAK,CAACH,QAAQ,CAAC;EACtB;EAEA,IAAI,CAACI,KAAK,CAACL,IAAI,CAACM,QAAQ,CAAC;AAC3B;AAEO,SAASC,YAAYA,CAAgBP,IAAoB,EAAE;EAChE,IAAIA,IAAI,CAACQ,KAAK,EAAE;IACd,IAAI,CAACN,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;IACxB,IAAI,CAACC,KAAK,CAAC,CAAC;EACd;EACA,IAAI,CAACD,IAAI,CAAC,IAAI,CAAC;EACf,IAAI,CAACC,KAAK,CAAC,CAAC;EACZ,IAAI,CAACE,KAAK,CAACL,IAAI,CAACS,IAAI,CAAC;AACvB;AAEO,SAASC,uBAAuBA,CAErCV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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.AnyTypeAnnotation = AnyTypeAnnotation;
|
| 7 |
+
exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
|
| 8 |
+
exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
|
| 9 |
+
exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
|
| 10 |
+
exports.DeclareClass = DeclareClass;
|
| 11 |
+
exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
|
| 12 |
+
exports.DeclareExportDeclaration = DeclareExportDeclaration;
|
| 13 |
+
exports.DeclareFunction = DeclareFunction;
|
| 14 |
+
exports.DeclareInterface = DeclareInterface;
|
| 15 |
+
exports.DeclareModule = DeclareModule;
|
| 16 |
+
exports.DeclareModuleExports = DeclareModuleExports;
|
| 17 |
+
exports.DeclareOpaqueType = DeclareOpaqueType;
|
| 18 |
+
exports.DeclareTypeAlias = DeclareTypeAlias;
|
| 19 |
+
exports.DeclareVariable = DeclareVariable;
|
| 20 |
+
exports.DeclaredPredicate = DeclaredPredicate;
|
| 21 |
+
exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
|
| 22 |
+
exports.EnumBooleanBody = EnumBooleanBody;
|
| 23 |
+
exports.EnumBooleanMember = EnumBooleanMember;
|
| 24 |
+
exports.EnumDeclaration = EnumDeclaration;
|
| 25 |
+
exports.EnumDefaultedMember = EnumDefaultedMember;
|
| 26 |
+
exports.EnumNumberBody = EnumNumberBody;
|
| 27 |
+
exports.EnumNumberMember = EnumNumberMember;
|
| 28 |
+
exports.EnumStringBody = EnumStringBody;
|
| 29 |
+
exports.EnumStringMember = EnumStringMember;
|
| 30 |
+
exports.EnumSymbolBody = EnumSymbolBody;
|
| 31 |
+
exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
|
| 32 |
+
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
| 33 |
+
exports.FunctionTypeParam = FunctionTypeParam;
|
| 34 |
+
exports.IndexedAccessType = IndexedAccessType;
|
| 35 |
+
exports.InferredPredicate = InferredPredicate;
|
| 36 |
+
exports.InterfaceDeclaration = InterfaceDeclaration;
|
| 37 |
+
exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends;
|
| 38 |
+
exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
|
| 39 |
+
exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
|
| 40 |
+
exports.MixedTypeAnnotation = MixedTypeAnnotation;
|
| 41 |
+
exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
|
| 42 |
+
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
| 43 |
+
Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
|
| 44 |
+
enumerable: true,
|
| 45 |
+
get: function () {
|
| 46 |
+
return _types2.NumericLiteral;
|
| 47 |
+
}
|
| 48 |
+
});
|
| 49 |
+
exports.NumberTypeAnnotation = NumberTypeAnnotation;
|
| 50 |
+
exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
|
| 51 |
+
exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
|
| 52 |
+
exports.ObjectTypeIndexer = ObjectTypeIndexer;
|
| 53 |
+
exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
|
| 54 |
+
exports.ObjectTypeProperty = ObjectTypeProperty;
|
| 55 |
+
exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
|
| 56 |
+
exports.OpaqueType = OpaqueType;
|
| 57 |
+
exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
|
| 58 |
+
exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
|
| 59 |
+
Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
|
| 60 |
+
enumerable: true,
|
| 61 |
+
get: function () {
|
| 62 |
+
return _types2.StringLiteral;
|
| 63 |
+
}
|
| 64 |
+
});
|
| 65 |
+
exports.StringTypeAnnotation = StringTypeAnnotation;
|
| 66 |
+
exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
|
| 67 |
+
exports.ThisTypeAnnotation = ThisTypeAnnotation;
|
| 68 |
+
exports.TupleTypeAnnotation = TupleTypeAnnotation;
|
| 69 |
+
exports.TypeAlias = TypeAlias;
|
| 70 |
+
exports.TypeAnnotation = TypeAnnotation;
|
| 71 |
+
exports.TypeCastExpression = TypeCastExpression;
|
| 72 |
+
exports.TypeParameter = TypeParameter;
|
| 73 |
+
exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation;
|
| 74 |
+
exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
|
| 75 |
+
exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
| 76 |
+
exports.Variance = Variance;
|
| 77 |
+
exports.VoidTypeAnnotation = VoidTypeAnnotation;
|
| 78 |
+
exports._interfaceish = _interfaceish;
|
| 79 |
+
exports._variance = _variance;
|
| 80 |
+
var _t = require("@babel/types");
|
| 81 |
+
var _modules = require("./modules.js");
|
| 82 |
+
var _index = require("../node/index.js");
|
| 83 |
+
var _types2 = require("./types.js");
|
| 84 |
+
const {
|
| 85 |
+
isDeclareExportDeclaration,
|
| 86 |
+
isStatement
|
| 87 |
+
} = _t;
|
| 88 |
+
function AnyTypeAnnotation() {
|
| 89 |
+
this.word("any");
|
| 90 |
+
}
|
| 91 |
+
function ArrayTypeAnnotation(node) {
|
| 92 |
+
this.print(node.elementType, true);
|
| 93 |
+
this.tokenChar(91);
|
| 94 |
+
this.tokenChar(93);
|
| 95 |
+
}
|
| 96 |
+
function BooleanTypeAnnotation() {
|
| 97 |
+
this.word("boolean");
|
| 98 |
+
}
|
| 99 |
+
function BooleanLiteralTypeAnnotation(node) {
|
| 100 |
+
this.word(node.value ? "true" : "false");
|
| 101 |
+
}
|
| 102 |
+
function NullLiteralTypeAnnotation() {
|
| 103 |
+
this.word("null");
|
| 104 |
+
}
|
| 105 |
+
function DeclareClass(node, parent) {
|
| 106 |
+
if (!isDeclareExportDeclaration(parent)) {
|
| 107 |
+
this.word("declare");
|
| 108 |
+
this.space();
|
| 109 |
+
}
|
| 110 |
+
this.word("class");
|
| 111 |
+
this.space();
|
| 112 |
+
this._interfaceish(node);
|
| 113 |
+
}
|
| 114 |
+
function DeclareFunction(node, parent) {
|
| 115 |
+
if (!isDeclareExportDeclaration(parent)) {
|
| 116 |
+
this.word("declare");
|
| 117 |
+
this.space();
|
| 118 |
+
}
|
| 119 |
+
this.word("function");
|
| 120 |
+
this.space();
|
| 121 |
+
this.print(node.id);
|
| 122 |
+
this.print(node.id.typeAnnotation.typeAnnotation);
|
| 123 |
+
if (node.predicate) {
|
| 124 |
+
this.space();
|
| 125 |
+
this.print(node.predicate);
|
| 126 |
+
}
|
| 127 |
+
this.semicolon();
|
| 128 |
+
}
|
| 129 |
+
function InferredPredicate() {
|
| 130 |
+
this.tokenChar(37);
|
| 131 |
+
this.word("checks");
|
| 132 |
+
}
|
| 133 |
+
function DeclaredPredicate(node) {
|
| 134 |
+
this.tokenChar(37);
|
| 135 |
+
this.word("checks");
|
| 136 |
+
this.tokenChar(40);
|
| 137 |
+
this.print(node.value);
|
| 138 |
+
this.tokenChar(41);
|
| 139 |
+
}
|
| 140 |
+
function DeclareInterface(node) {
|
| 141 |
+
this.word("declare");
|
| 142 |
+
this.space();
|
| 143 |
+
this.InterfaceDeclaration(node);
|
| 144 |
+
}
|
| 145 |
+
function DeclareModule(node) {
|
| 146 |
+
this.word("declare");
|
| 147 |
+
this.space();
|
| 148 |
+
this.word("module");
|
| 149 |
+
this.space();
|
| 150 |
+
this.print(node.id);
|
| 151 |
+
this.space();
|
| 152 |
+
this.print(node.body);
|
| 153 |
+
}
|
| 154 |
+
function DeclareModuleExports(node) {
|
| 155 |
+
this.word("declare");
|
| 156 |
+
this.space();
|
| 157 |
+
this.word("module");
|
| 158 |
+
this.tokenChar(46);
|
| 159 |
+
this.word("exports");
|
| 160 |
+
this.print(node.typeAnnotation);
|
| 161 |
+
}
|
| 162 |
+
function DeclareTypeAlias(node) {
|
| 163 |
+
this.word("declare");
|
| 164 |
+
this.space();
|
| 165 |
+
this.TypeAlias(node);
|
| 166 |
+
}
|
| 167 |
+
function DeclareOpaqueType(node, parent) {
|
| 168 |
+
if (!isDeclareExportDeclaration(parent)) {
|
| 169 |
+
this.word("declare");
|
| 170 |
+
this.space();
|
| 171 |
+
}
|
| 172 |
+
this.OpaqueType(node);
|
| 173 |
+
}
|
| 174 |
+
function DeclareVariable(node, parent) {
|
| 175 |
+
if (!isDeclareExportDeclaration(parent)) {
|
| 176 |
+
this.word("declare");
|
| 177 |
+
this.space();
|
| 178 |
+
}
|
| 179 |
+
this.word("var");
|
| 180 |
+
this.space();
|
| 181 |
+
this.print(node.id);
|
| 182 |
+
this.print(node.id.typeAnnotation);
|
| 183 |
+
this.semicolon();
|
| 184 |
+
}
|
| 185 |
+
function DeclareExportDeclaration(node) {
|
| 186 |
+
this.word("declare");
|
| 187 |
+
this.space();
|
| 188 |
+
this.word("export");
|
| 189 |
+
this.space();
|
| 190 |
+
if (node.default) {
|
| 191 |
+
this.word("default");
|
| 192 |
+
this.space();
|
| 193 |
+
}
|
| 194 |
+
FlowExportDeclaration.call(this, node);
|
| 195 |
+
}
|
| 196 |
+
function DeclareExportAllDeclaration(node) {
|
| 197 |
+
this.word("declare");
|
| 198 |
+
this.space();
|
| 199 |
+
_modules.ExportAllDeclaration.call(this, node);
|
| 200 |
+
}
|
| 201 |
+
function EnumDeclaration(node) {
|
| 202 |
+
const {
|
| 203 |
+
id,
|
| 204 |
+
body
|
| 205 |
+
} = node;
|
| 206 |
+
this.word("enum");
|
| 207 |
+
this.space();
|
| 208 |
+
this.print(id);
|
| 209 |
+
this.print(body);
|
| 210 |
+
}
|
| 211 |
+
function enumExplicitType(context, name, hasExplicitType) {
|
| 212 |
+
if (hasExplicitType) {
|
| 213 |
+
context.space();
|
| 214 |
+
context.word("of");
|
| 215 |
+
context.space();
|
| 216 |
+
context.word(name);
|
| 217 |
+
}
|
| 218 |
+
context.space();
|
| 219 |
+
}
|
| 220 |
+
function enumBody(context, node) {
|
| 221 |
+
const {
|
| 222 |
+
members
|
| 223 |
+
} = node;
|
| 224 |
+
context.token("{");
|
| 225 |
+
context.indent();
|
| 226 |
+
context.newline();
|
| 227 |
+
for (const member of members) {
|
| 228 |
+
context.print(member);
|
| 229 |
+
context.newline();
|
| 230 |
+
}
|
| 231 |
+
if (node.hasUnknownMembers) {
|
| 232 |
+
context.token("...");
|
| 233 |
+
context.newline();
|
| 234 |
+
}
|
| 235 |
+
context.dedent();
|
| 236 |
+
context.token("}");
|
| 237 |
+
}
|
| 238 |
+
function EnumBooleanBody(node) {
|
| 239 |
+
const {
|
| 240 |
+
explicitType
|
| 241 |
+
} = node;
|
| 242 |
+
enumExplicitType(this, "boolean", explicitType);
|
| 243 |
+
enumBody(this, node);
|
| 244 |
+
}
|
| 245 |
+
function EnumNumberBody(node) {
|
| 246 |
+
const {
|
| 247 |
+
explicitType
|
| 248 |
+
} = node;
|
| 249 |
+
enumExplicitType(this, "number", explicitType);
|
| 250 |
+
enumBody(this, node);
|
| 251 |
+
}
|
| 252 |
+
function EnumStringBody(node) {
|
| 253 |
+
const {
|
| 254 |
+
explicitType
|
| 255 |
+
} = node;
|
| 256 |
+
enumExplicitType(this, "string", explicitType);
|
| 257 |
+
enumBody(this, node);
|
| 258 |
+
}
|
| 259 |
+
function EnumSymbolBody(node) {
|
| 260 |
+
enumExplicitType(this, "symbol", true);
|
| 261 |
+
enumBody(this, node);
|
| 262 |
+
}
|
| 263 |
+
function EnumDefaultedMember(node) {
|
| 264 |
+
const {
|
| 265 |
+
id
|
| 266 |
+
} = node;
|
| 267 |
+
this.print(id);
|
| 268 |
+
this.tokenChar(44);
|
| 269 |
+
}
|
| 270 |
+
function enumInitializedMember(context, node) {
|
| 271 |
+
context.print(node.id);
|
| 272 |
+
context.space();
|
| 273 |
+
context.token("=");
|
| 274 |
+
context.space();
|
| 275 |
+
context.print(node.init);
|
| 276 |
+
context.token(",");
|
| 277 |
+
}
|
| 278 |
+
function EnumBooleanMember(node) {
|
| 279 |
+
enumInitializedMember(this, node);
|
| 280 |
+
}
|
| 281 |
+
function EnumNumberMember(node) {
|
| 282 |
+
enumInitializedMember(this, node);
|
| 283 |
+
}
|
| 284 |
+
function EnumStringMember(node) {
|
| 285 |
+
enumInitializedMember(this, node);
|
| 286 |
+
}
|
| 287 |
+
function FlowExportDeclaration(node) {
|
| 288 |
+
if (node.declaration) {
|
| 289 |
+
const declar = node.declaration;
|
| 290 |
+
this.print(declar);
|
| 291 |
+
if (!isStatement(declar)) this.semicolon();
|
| 292 |
+
} else {
|
| 293 |
+
this.tokenChar(123);
|
| 294 |
+
if (node.specifiers.length) {
|
| 295 |
+
this.space();
|
| 296 |
+
this.printList(node.specifiers);
|
| 297 |
+
this.space();
|
| 298 |
+
}
|
| 299 |
+
this.tokenChar(125);
|
| 300 |
+
if (node.source) {
|
| 301 |
+
this.space();
|
| 302 |
+
this.word("from");
|
| 303 |
+
this.space();
|
| 304 |
+
this.print(node.source);
|
| 305 |
+
}
|
| 306 |
+
this.semicolon();
|
| 307 |
+
}
|
| 308 |
+
}
|
| 309 |
+
function ExistsTypeAnnotation() {
|
| 310 |
+
this.tokenChar(42);
|
| 311 |
+
}
|
| 312 |
+
function FunctionTypeAnnotation(node, parent) {
|
| 313 |
+
this.print(node.typeParameters);
|
| 314 |
+
this.tokenChar(40);
|
| 315 |
+
if (node.this) {
|
| 316 |
+
this.word("this");
|
| 317 |
+
this.tokenChar(58);
|
| 318 |
+
this.space();
|
| 319 |
+
this.print(node.this.typeAnnotation);
|
| 320 |
+
if (node.params.length || node.rest) {
|
| 321 |
+
this.tokenChar(44);
|
| 322 |
+
this.space();
|
| 323 |
+
}
|
| 324 |
+
}
|
| 325 |
+
this.printList(node.params);
|
| 326 |
+
if (node.rest) {
|
| 327 |
+
if (node.params.length) {
|
| 328 |
+
this.tokenChar(44);
|
| 329 |
+
this.space();
|
| 330 |
+
}
|
| 331 |
+
this.token("...");
|
| 332 |
+
this.print(node.rest);
|
| 333 |
+
}
|
| 334 |
+
this.tokenChar(41);
|
| 335 |
+
const type = parent == null ? void 0 : parent.type;
|
| 336 |
+
if (type != null && (type === "ObjectTypeCallProperty" || type === "ObjectTypeInternalSlot" || type === "DeclareFunction" || type === "ObjectTypeProperty" && parent.method)) {
|
| 337 |
+
this.tokenChar(58);
|
| 338 |
+
} else {
|
| 339 |
+
this.space();
|
| 340 |
+
this.token("=>");
|
| 341 |
+
}
|
| 342 |
+
this.space();
|
| 343 |
+
this.print(node.returnType);
|
| 344 |
+
}
|
| 345 |
+
function FunctionTypeParam(node) {
|
| 346 |
+
this.print(node.name);
|
| 347 |
+
if (node.optional) this.tokenChar(63);
|
| 348 |
+
if (node.name) {
|
| 349 |
+
this.tokenChar(58);
|
| 350 |
+
this.space();
|
| 351 |
+
}
|
| 352 |
+
this.print(node.typeAnnotation);
|
| 353 |
+
}
|
| 354 |
+
function InterfaceExtends(node) {
|
| 355 |
+
this.print(node.id);
|
| 356 |
+
this.print(node.typeParameters, true);
|
| 357 |
+
}
|
| 358 |
+
function _interfaceish(node) {
|
| 359 |
+
var _node$extends;
|
| 360 |
+
this.print(node.id);
|
| 361 |
+
this.print(node.typeParameters);
|
| 362 |
+
if ((_node$extends = node.extends) != null && _node$extends.length) {
|
| 363 |
+
this.space();
|
| 364 |
+
this.word("extends");
|
| 365 |
+
this.space();
|
| 366 |
+
this.printList(node.extends);
|
| 367 |
+
}
|
| 368 |
+
if (node.type === "DeclareClass") {
|
| 369 |
+
var _node$mixins, _node$implements;
|
| 370 |
+
if ((_node$mixins = node.mixins) != null && _node$mixins.length) {
|
| 371 |
+
this.space();
|
| 372 |
+
this.word("mixins");
|
| 373 |
+
this.space();
|
| 374 |
+
this.printList(node.mixins);
|
| 375 |
+
}
|
| 376 |
+
if ((_node$implements = node.implements) != null && _node$implements.length) {
|
| 377 |
+
this.space();
|
| 378 |
+
this.word("implements");
|
| 379 |
+
this.space();
|
| 380 |
+
this.printList(node.implements);
|
| 381 |
+
}
|
| 382 |
+
}
|
| 383 |
+
this.space();
|
| 384 |
+
this.print(node.body);
|
| 385 |
+
}
|
| 386 |
+
function _variance(node) {
|
| 387 |
+
var _node$variance;
|
| 388 |
+
const kind = (_node$variance = node.variance) == null ? void 0 : _node$variance.kind;
|
| 389 |
+
if (kind != null) {
|
| 390 |
+
if (kind === "plus") {
|
| 391 |
+
this.tokenChar(43);
|
| 392 |
+
} else if (kind === "minus") {
|
| 393 |
+
this.tokenChar(45);
|
| 394 |
+
}
|
| 395 |
+
}
|
| 396 |
+
}
|
| 397 |
+
function InterfaceDeclaration(node) {
|
| 398 |
+
this.word("interface");
|
| 399 |
+
this.space();
|
| 400 |
+
this._interfaceish(node);
|
| 401 |
+
}
|
| 402 |
+
function andSeparator(occurrenceCount) {
|
| 403 |
+
this.space();
|
| 404 |
+
this.token("&", false, occurrenceCount);
|
| 405 |
+
this.space();
|
| 406 |
+
}
|
| 407 |
+
function InterfaceTypeAnnotation(node) {
|
| 408 |
+
var _node$extends2;
|
| 409 |
+
this.word("interface");
|
| 410 |
+
if ((_node$extends2 = node.extends) != null && _node$extends2.length) {
|
| 411 |
+
this.space();
|
| 412 |
+
this.word("extends");
|
| 413 |
+
this.space();
|
| 414 |
+
this.printList(node.extends);
|
| 415 |
+
}
|
| 416 |
+
this.space();
|
| 417 |
+
this.print(node.body);
|
| 418 |
+
}
|
| 419 |
+
function IntersectionTypeAnnotation(node) {
|
| 420 |
+
this.printJoin(node.types, undefined, undefined, andSeparator);
|
| 421 |
+
}
|
| 422 |
+
function MixedTypeAnnotation() {
|
| 423 |
+
this.word("mixed");
|
| 424 |
+
}
|
| 425 |
+
function EmptyTypeAnnotation() {
|
| 426 |
+
this.word("empty");
|
| 427 |
+
}
|
| 428 |
+
function NullableTypeAnnotation(node) {
|
| 429 |
+
this.tokenChar(63);
|
| 430 |
+
this.print(node.typeAnnotation);
|
| 431 |
+
}
|
| 432 |
+
function NumberTypeAnnotation() {
|
| 433 |
+
this.word("number");
|
| 434 |
+
}
|
| 435 |
+
function StringTypeAnnotation() {
|
| 436 |
+
this.word("string");
|
| 437 |
+
}
|
| 438 |
+
function ThisTypeAnnotation() {
|
| 439 |
+
this.word("this");
|
| 440 |
+
}
|
| 441 |
+
function TupleTypeAnnotation(node) {
|
| 442 |
+
this.tokenChar(91);
|
| 443 |
+
this.printList(node.types);
|
| 444 |
+
this.tokenChar(93);
|
| 445 |
+
}
|
| 446 |
+
function TypeofTypeAnnotation(node) {
|
| 447 |
+
this.word("typeof");
|
| 448 |
+
this.space();
|
| 449 |
+
this.print(node.argument);
|
| 450 |
+
}
|
| 451 |
+
function TypeAlias(node) {
|
| 452 |
+
this.word("type");
|
| 453 |
+
this.space();
|
| 454 |
+
this.print(node.id);
|
| 455 |
+
this.print(node.typeParameters);
|
| 456 |
+
this.space();
|
| 457 |
+
this.tokenChar(61);
|
| 458 |
+
this.space();
|
| 459 |
+
this.print(node.right);
|
| 460 |
+
this.semicolon();
|
| 461 |
+
}
|
| 462 |
+
function TypeAnnotation(node, parent) {
|
| 463 |
+
this.tokenChar(58);
|
| 464 |
+
this.space();
|
| 465 |
+
if (parent.type === "ArrowFunctionExpression") {
|
| 466 |
+
this.tokenContext |= _index.TokenContext.arrowFlowReturnType;
|
| 467 |
+
} else if (node.optional) {
|
| 468 |
+
this.tokenChar(63);
|
| 469 |
+
}
|
| 470 |
+
this.print(node.typeAnnotation);
|
| 471 |
+
}
|
| 472 |
+
function TypeParameterInstantiation(node) {
|
| 473 |
+
this.tokenChar(60);
|
| 474 |
+
this.printList(node.params);
|
| 475 |
+
this.tokenChar(62);
|
| 476 |
+
}
|
| 477 |
+
function TypeParameter(node) {
|
| 478 |
+
this._variance(node);
|
| 479 |
+
this.word(node.name);
|
| 480 |
+
if (node.bound) {
|
| 481 |
+
this.print(node.bound);
|
| 482 |
+
}
|
| 483 |
+
if (node.default) {
|
| 484 |
+
this.space();
|
| 485 |
+
this.tokenChar(61);
|
| 486 |
+
this.space();
|
| 487 |
+
this.print(node.default);
|
| 488 |
+
}
|
| 489 |
+
}
|
| 490 |
+
function OpaqueType(node) {
|
| 491 |
+
this.word("opaque");
|
| 492 |
+
this.space();
|
| 493 |
+
this.word("type");
|
| 494 |
+
this.space();
|
| 495 |
+
this.print(node.id);
|
| 496 |
+
this.print(node.typeParameters);
|
| 497 |
+
if (node.supertype) {
|
| 498 |
+
this.tokenChar(58);
|
| 499 |
+
this.space();
|
| 500 |
+
this.print(node.supertype);
|
| 501 |
+
}
|
| 502 |
+
if (node.impltype) {
|
| 503 |
+
this.space();
|
| 504 |
+
this.tokenChar(61);
|
| 505 |
+
this.space();
|
| 506 |
+
this.print(node.impltype);
|
| 507 |
+
}
|
| 508 |
+
this.semicolon();
|
| 509 |
+
}
|
| 510 |
+
function ObjectTypeAnnotation(node) {
|
| 511 |
+
if (node.exact) {
|
| 512 |
+
this.token("{|");
|
| 513 |
+
} else {
|
| 514 |
+
this.tokenChar(123);
|
| 515 |
+
}
|
| 516 |
+
const props = [...node.properties, ...(node.callProperties || []), ...(node.indexers || []), ...(node.internalSlots || [])];
|
| 517 |
+
if (props.length) {
|
| 518 |
+
this.newline();
|
| 519 |
+
this.space();
|
| 520 |
+
this.printJoin(props, true, true, undefined, undefined, function addNewlines(leading) {
|
| 521 |
+
if (leading && !props[0]) return 1;
|
| 522 |
+
}, () => {
|
| 523 |
+
if (props.length !== 1 || node.inexact) {
|
| 524 |
+
this.tokenChar(44);
|
| 525 |
+
this.space();
|
| 526 |
+
}
|
| 527 |
+
});
|
| 528 |
+
this.space();
|
| 529 |
+
}
|
| 530 |
+
if (node.inexact) {
|
| 531 |
+
this.indent();
|
| 532 |
+
this.token("...");
|
| 533 |
+
if (props.length) {
|
| 534 |
+
this.newline();
|
| 535 |
+
}
|
| 536 |
+
this.dedent();
|
| 537 |
+
}
|
| 538 |
+
if (node.exact) {
|
| 539 |
+
this.token("|}");
|
| 540 |
+
} else {
|
| 541 |
+
this.tokenChar(125);
|
| 542 |
+
}
|
| 543 |
+
}
|
| 544 |
+
function ObjectTypeInternalSlot(node) {
|
| 545 |
+
if (node.static) {
|
| 546 |
+
this.word("static");
|
| 547 |
+
this.space();
|
| 548 |
+
}
|
| 549 |
+
this.tokenChar(91);
|
| 550 |
+
this.tokenChar(91);
|
| 551 |
+
this.print(node.id);
|
| 552 |
+
this.tokenChar(93);
|
| 553 |
+
this.tokenChar(93);
|
| 554 |
+
if (node.optional) this.tokenChar(63);
|
| 555 |
+
if (!node.method) {
|
| 556 |
+
this.tokenChar(58);
|
| 557 |
+
this.space();
|
| 558 |
+
}
|
| 559 |
+
this.print(node.value);
|
| 560 |
+
}
|
| 561 |
+
function ObjectTypeCallProperty(node) {
|
| 562 |
+
if (node.static) {
|
| 563 |
+
this.word("static");
|
| 564 |
+
this.space();
|
| 565 |
+
}
|
| 566 |
+
this.print(node.value);
|
| 567 |
+
}
|
| 568 |
+
function ObjectTypeIndexer(node) {
|
| 569 |
+
if (node.static) {
|
| 570 |
+
this.word("static");
|
| 571 |
+
this.space();
|
| 572 |
+
}
|
| 573 |
+
this._variance(node);
|
| 574 |
+
this.tokenChar(91);
|
| 575 |
+
if (node.id) {
|
| 576 |
+
this.print(node.id);
|
| 577 |
+
this.tokenChar(58);
|
| 578 |
+
this.space();
|
| 579 |
+
}
|
| 580 |
+
this.print(node.key);
|
| 581 |
+
this.tokenChar(93);
|
| 582 |
+
this.tokenChar(58);
|
| 583 |
+
this.space();
|
| 584 |
+
this.print(node.value);
|
| 585 |
+
}
|
| 586 |
+
function ObjectTypeProperty(node) {
|
| 587 |
+
if (node.proto) {
|
| 588 |
+
this.word("proto");
|
| 589 |
+
this.space();
|
| 590 |
+
}
|
| 591 |
+
if (node.static) {
|
| 592 |
+
this.word("static");
|
| 593 |
+
this.space();
|
| 594 |
+
}
|
| 595 |
+
if (node.kind === "get" || node.kind === "set") {
|
| 596 |
+
this.word(node.kind);
|
| 597 |
+
this.space();
|
| 598 |
+
}
|
| 599 |
+
this._variance(node);
|
| 600 |
+
this.print(node.key);
|
| 601 |
+
if (node.optional) this.tokenChar(63);
|
| 602 |
+
if (!node.method) {
|
| 603 |
+
this.tokenChar(58);
|
| 604 |
+
this.space();
|
| 605 |
+
}
|
| 606 |
+
this.print(node.value);
|
| 607 |
+
}
|
| 608 |
+
function ObjectTypeSpreadProperty(node) {
|
| 609 |
+
this.token("...");
|
| 610 |
+
this.print(node.argument);
|
| 611 |
+
}
|
| 612 |
+
function QualifiedTypeIdentifier(node) {
|
| 613 |
+
this.print(node.qualification);
|
| 614 |
+
this.tokenChar(46);
|
| 615 |
+
this.print(node.id);
|
| 616 |
+
}
|
| 617 |
+
function SymbolTypeAnnotation() {
|
| 618 |
+
this.word("symbol");
|
| 619 |
+
}
|
| 620 |
+
function orSeparator(occurrenceCount) {
|
| 621 |
+
this.space();
|
| 622 |
+
this.token("|", false, occurrenceCount);
|
| 623 |
+
this.space();
|
| 624 |
+
}
|
| 625 |
+
function UnionTypeAnnotation(node) {
|
| 626 |
+
this.printJoin(node.types, undefined, undefined, orSeparator);
|
| 627 |
+
}
|
| 628 |
+
function TypeCastExpression(node) {
|
| 629 |
+
this.tokenChar(40);
|
| 630 |
+
this.print(node.expression);
|
| 631 |
+
this.print(node.typeAnnotation);
|
| 632 |
+
this.tokenChar(41);
|
| 633 |
+
}
|
| 634 |
+
function Variance(node) {
|
| 635 |
+
if (node.kind === "plus") {
|
| 636 |
+
this.tokenChar(43);
|
| 637 |
+
} else {
|
| 638 |
+
this.tokenChar(45);
|
| 639 |
+
}
|
| 640 |
+
}
|
| 641 |
+
function VoidTypeAnnotation() {
|
| 642 |
+
this.word("void");
|
| 643 |
+
}
|
| 644 |
+
function IndexedAccessType(node) {
|
| 645 |
+
this.print(node.objectType, true);
|
| 646 |
+
this.tokenChar(91);
|
| 647 |
+
this.print(node.indexType);
|
| 648 |
+
this.tokenChar(93);
|
| 649 |
+
}
|
| 650 |
+
function OptionalIndexedAccessType(node) {
|
| 651 |
+
this.print(node.objectType);
|
| 652 |
+
if (node.optional) {
|
| 653 |
+
this.token("?.");
|
| 654 |
+
}
|
| 655 |
+
this.tokenChar(91);
|
| 656 |
+
this.print(node.indexType);
|
| 657 |
+
this.tokenChar(93);
|
| 658 |
+
}
|
| 659 |
+
|
| 660 |
+
//# sourceMappingURL=flow.js.map
|
ui/node_modules/@babel/generator/lib/generators/flow.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_modules","_index","_types2","isDeclareExportDeclaration","isStatement","AnyTypeAnnotation","word","ArrayTypeAnnotation","node","print","elementType","token","BooleanTypeAnnotation","BooleanLiteralTypeAnnotation","value","NullLiteralTypeAnnotation","DeclareClass","parent","space","_interfaceish","DeclareFunction","id","typeAnnotation","predicate","semicolon","InferredPredicate","DeclaredPredicate","DeclareInterface","InterfaceDeclaration","DeclareModule","body","DeclareModuleExports","DeclareTypeAlias","TypeAlias","DeclareOpaqueType","OpaqueType","DeclareVariable","DeclareExportDeclaration","default","FlowExportDeclaration","call","DeclareExportAllDeclaration","ExportAllDeclaration","EnumDeclaration","enumExplicitType","context","name","hasExplicitType","enumBody","members","indent","newline","member","hasUnknownMembers","dedent","EnumBooleanBody","explicitType","EnumNumberBody","EnumStringBody","EnumSymbolBody","EnumDefaultedMember","enumInitializedMember","init","EnumBooleanMember","EnumNumberMember","EnumStringMember","declaration","declar","specifiers","length","printList","source","ExistsTypeAnnotation","FunctionTypeAnnotation","typeParameters","this","params","rest","type","method","returnType","FunctionTypeParam","optional","InterfaceExtends","_node$extends","extends","_node$mixins","_node$implements","mixins","implements","_variance","_node$variance","kind","variance","andSeparator","occurrenceCount","InterfaceTypeAnnotation","_node$extends2","IntersectionTypeAnnotation","printJoin","types","undefined","MixedTypeAnnotation","EmptyTypeAnnotation","NullableTypeAnnotation","NumberTypeAnnotation","StringTypeAnnotation","ThisTypeAnnotation","TupleTypeAnnotation","TypeofTypeAnnotation","argument","right","TypeAnnotation","tokenContext","TokenContext","arrowFlowReturnType","TypeParameterInstantiation","TypeParameter","bound","supertype","impltype","ObjectTypeAnnotation","exact","props","properties","callProperties","indexers","internalSlots","addNewlines","leading","inexact","ObjectTypeInternalSlot","static","ObjectTypeCallProperty","ObjectTypeIndexer","key","ObjectTypeProperty","proto","ObjectTypeSpreadProperty","QualifiedTypeIdentifier","qualification","SymbolTypeAnnotation","orSeparator","UnionTypeAnnotation","TypeCastExpression","expression","Variance","VoidTypeAnnotation","IndexedAccessType","objectType","indexType","OptionalIndexedAccessType"],"sources":["../../src/generators/flow.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport { isDeclareExportDeclaration, isStatement } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { ExportAllDeclaration } from \"./modules.ts\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function AnyTypeAnnotation(this: Printer) {\n this.word(\"any\");\n}\n\nexport function ArrayTypeAnnotation(\n this: Printer,\n node: t.ArrayTypeAnnotation,\n) {\n this.print(node.elementType, true);\n this.token(\"[\");\n this.token(\"]\");\n}\n\nexport function BooleanTypeAnnotation(this: Printer) {\n this.word(\"boolean\");\n}\n\nexport function BooleanLiteralTypeAnnotation(\n this: Printer,\n node: t.BooleanLiteralTypeAnnotation,\n) {\n this.word(node.value ? \"true\" : \"false\");\n}\n\nexport function NullLiteralTypeAnnotation(this: Printer) {\n this.word(\"null\");\n}\n\nexport function DeclareClass(\n this: Printer,\n node: t.DeclareClass,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"class\");\n this.space();\n this._interfaceish(node);\n}\n\nexport function DeclareFunction(\n this: Printer,\n node: t.DeclareFunction,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"function\");\n this.space();\n this.print(node.id);\n // @ts-ignore(Babel 7 vs Babel 8) TODO(Babel 8) Remove this comment, since we'll remove the Noop node\n this.print(node.id.typeAnnotation.typeAnnotation);\n\n if (node.predicate) {\n this.space();\n this.print(node.predicate);\n }\n\n this.semicolon();\n}\n\nexport function InferredPredicate(this: Printer) {\n this.token(\"%\");\n this.word(\"checks\");\n}\n\nexport function DeclaredPredicate(this: Printer, node: t.DeclaredPredicate) {\n this.token(\"%\");\n this.word(\"checks\");\n this.token(\"(\");\n this.print(node.value);\n this.token(\")\");\n}\n\nexport function DeclareInterface(this: Printer, node: t.DeclareInterface) {\n this.word(\"declare\");\n this.space();\n this.InterfaceDeclaration(node);\n}\n\nexport function DeclareModule(this: Printer, node: t.DeclareModule) {\n this.word(\"declare\");\n this.space();\n this.word(\"module\");\n this.space();\n this.print(node.id);\n this.space();\n this.print(node.body);\n}\n\nexport function DeclareModuleExports(\n this: Printer,\n node: t.DeclareModuleExports,\n) {\n this.word(\"declare\");\n this.space();\n this.word(\"module\");\n this.token(\".\");\n this.word(\"exports\");\n this.print(node.typeAnnotation);\n}\n\nexport function DeclareTypeAlias(this: Printer, node: t.DeclareTypeAlias) {\n this.word(\"declare\");\n this.space();\n this.TypeAlias(node);\n}\n\nexport function DeclareOpaqueType(\n this: Printer,\n node: t.DeclareOpaqueType,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.OpaqueType(node);\n}\n\nexport function DeclareVariable(\n this: Printer,\n node: t.DeclareVariable,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"var\");\n this.space();\n this.print(node.id);\n this.print(node.id.typeAnnotation);\n this.semicolon();\n}\n\nexport function DeclareExportDeclaration(\n this: Printer,\n node: t.DeclareExportDeclaration,\n) {\n this.word(\"declare\");\n this.space();\n this.word(\"export\");\n this.space();\n if (node.default) {\n this.word(\"default\");\n this.space();\n }\n\n FlowExportDeclaration.call(this, node);\n}\n\nexport function DeclareExportAllDeclaration(\n this: Printer,\n node: t.DeclareExportAllDeclaration,\n) {\n this.word(\"declare\");\n this.space();\n ExportAllDeclaration.call(this, node);\n}\n\nexport function EnumDeclaration(this: Printer, node: t.EnumDeclaration) {\n const { id, body } = node;\n this.word(\"enum\");\n this.space();\n this.print(id);\n this.print(body);\n}\n\nfunction enumExplicitType(\n context: Printer,\n name: string,\n hasExplicitType: boolean,\n) {\n if (hasExplicitType) {\n context.space();\n context.word(\"of\");\n context.space();\n context.word(name);\n }\n context.space();\n}\n\nfunction enumBody(context: Printer, node: t.EnumBody) {\n const { members } = node;\n context.token(\"{\");\n context.indent();\n context.newline();\n for (const member of members) {\n context.print(member);\n context.newline();\n }\n if (node.hasUnknownMembers) {\n context.token(\"...\");\n context.newline();\n }\n context.dedent();\n context.token(\"}\");\n}\n\nexport function EnumBooleanBody(this: Printer, node: t.EnumBooleanBody) {\n const { explicitType } = node;\n enumExplicitType(this, \"boolean\", explicitType);\n enumBody(this, node);\n}\n\nexport function EnumNumberBody(this: Printer, node: t.EnumNumberBody) {\n const { explicitType } = node;\n enumExplicitType(this, \"number\", explicitType);\n enumBody(this, node);\n}\n\nexport function EnumStringBody(this: Printer, node: t.EnumStringBody) {\n const { explicitType } = node;\n enumExplicitType(this, \"string\", explicitType);\n enumBody(this, node);\n}\n\nexport function EnumSymbolBody(this: Printer, node: t.EnumSymbolBody) {\n enumExplicitType(this, \"symbol\", true);\n enumBody(this, node);\n}\n\nexport function EnumDefaultedMember(\n this: Printer,\n node: t.EnumDefaultedMember,\n) {\n const { id } = node;\n this.print(id);\n this.token(\",\");\n}\n\nfunction enumInitializedMember(\n context: Printer,\n node: t.EnumBooleanMember | t.EnumNumberMember | t.EnumStringMember,\n) {\n context.print(node.id);\n context.space();\n context.token(\"=\");\n context.space();\n context.print(node.init);\n context.token(\",\");\n}\n\nexport function EnumBooleanMember(this: Printer, node: t.EnumBooleanMember) {\n enumInitializedMember(this, node);\n}\n\nexport function EnumNumberMember(this: Printer, node: t.EnumNumberMember) {\n enumInitializedMember(this, node);\n}\n\nexport function EnumStringMember(this: Printer, node: t.EnumStringMember) {\n enumInitializedMember(this, node);\n}\n\nfunction FlowExportDeclaration(\n this: Printer,\n node: t.DeclareExportDeclaration,\n) {\n if (node.declaration) {\n const declar = node.declaration;\n this.print(declar);\n if (!isStatement(declar)) this.semicolon();\n } else {\n this.token(\"{\");\n if (node.specifiers.length) {\n this.space();\n this.printList(node.specifiers);\n this.space();\n }\n this.token(\"}\");\n\n if (node.source) {\n this.space();\n this.word(\"from\");\n this.space();\n this.print(node.source);\n }\n\n this.semicolon();\n }\n}\n\nexport function ExistsTypeAnnotation(this: Printer) {\n this.token(\"*\");\n}\n\nexport function FunctionTypeAnnotation(\n this: Printer,\n node: t.FunctionTypeAnnotation,\n parent?: t.Node,\n) {\n this.print(node.typeParameters);\n this.token(\"(\");\n\n if (node.this) {\n this.word(\"this\");\n this.token(\":\");\n this.space();\n this.print(node.this.typeAnnotation);\n if (node.params.length || node.rest) {\n this.token(\",\");\n this.space();\n }\n }\n\n this.printList(node.params);\n\n if (node.rest) {\n if (node.params.length) {\n this.token(\",\");\n this.space();\n }\n this.token(\"...\");\n this.print(node.rest);\n }\n\n this.token(\")\");\n\n // this node type is overloaded, not sure why but it makes it EXTREMELY annoying\n\n const type = parent?.type;\n if (\n type != null &&\n (type === \"ObjectTypeCallProperty\" ||\n type === \"ObjectTypeInternalSlot\" ||\n type === \"DeclareFunction\" ||\n (type === \"ObjectTypeProperty\" && parent.method))\n ) {\n this.token(\":\");\n } else {\n this.space();\n this.token(\"=>\");\n }\n\n this.space();\n this.print(node.returnType);\n}\n\nexport function FunctionTypeParam(this: Printer, node: t.FunctionTypeParam) {\n this.print(node.name);\n if (node.optional) this.token(\"?\");\n if (node.name) {\n this.token(\":\");\n this.space();\n }\n this.print(node.typeAnnotation);\n}\n\nexport function InterfaceExtends(this: Printer, node: t.InterfaceExtends) {\n this.print(node.id);\n this.print(node.typeParameters, true);\n}\n\nexport {\n InterfaceExtends as ClassImplements,\n InterfaceExtends as GenericTypeAnnotation,\n};\n\nexport function _interfaceish(\n this: Printer,\n node: t.InterfaceDeclaration | t.DeclareInterface | t.DeclareClass,\n) {\n this.print(node.id);\n this.print(node.typeParameters);\n if (node.extends?.length) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.printList(node.extends);\n }\n if (node.type === \"DeclareClass\") {\n if (node.mixins?.length) {\n this.space();\n this.word(\"mixins\");\n this.space();\n this.printList(node.mixins);\n }\n if (node.implements?.length) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements);\n }\n }\n this.space();\n this.print(node.body);\n}\n\nexport function _variance(\n this: Printer,\n node:\n | t.TypeParameter\n | t.ObjectTypeIndexer\n | t.ObjectTypeProperty\n | t.ClassProperty\n | t.ClassPrivateProperty\n | t.ClassAccessorProperty,\n) {\n const kind = node.variance?.kind;\n if (kind != null) {\n if (kind === \"plus\") {\n this.token(\"+\");\n } else if (kind === \"minus\") {\n this.token(\"-\");\n }\n }\n}\n\nexport function InterfaceDeclaration(\n this: Printer,\n node: t.InterfaceDeclaration | t.DeclareInterface,\n) {\n this.word(\"interface\");\n this.space();\n this._interfaceish(node);\n}\n\nfunction andSeparator(this: Printer, occurrenceCount: number) {\n this.space();\n this.token(\"&\", false, occurrenceCount);\n this.space();\n}\n\nexport function InterfaceTypeAnnotation(\n this: Printer,\n node: t.InterfaceTypeAnnotation,\n) {\n this.word(\"interface\");\n if (node.extends?.length) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.printList(node.extends);\n }\n this.space();\n this.print(node.body);\n}\n\nexport function IntersectionTypeAnnotation(\n this: Printer,\n node: t.IntersectionTypeAnnotation,\n) {\n this.printJoin(node.types, undefined, undefined, andSeparator);\n}\n\nexport function MixedTypeAnnotation(this: Printer) {\n this.word(\"mixed\");\n}\n\nexport function EmptyTypeAnnotation(this: Printer) {\n this.word(\"empty\");\n}\n\nexport function NullableTypeAnnotation(\n this: Printer,\n node: t.NullableTypeAnnotation,\n) {\n this.token(\"?\");\n this.print(node.typeAnnotation);\n}\n\nexport {\n NumericLiteral as NumberLiteralTypeAnnotation,\n StringLiteral as StringLiteralTypeAnnotation,\n} from \"./types.ts\";\n\nexport function NumberTypeAnnotation(this: Printer) {\n this.word(\"number\");\n}\n\nexport function StringTypeAnnotation(this: Printer) {\n this.word(\"string\");\n}\n\nexport function ThisTypeAnnotation(this: Printer) {\n this.word(\"this\");\n}\n\nexport function TupleTypeAnnotation(\n this: Printer,\n node: t.TupleTypeAnnotation,\n) {\n this.token(\"[\");\n this.printList(node.types);\n this.token(\"]\");\n}\n\nexport function TypeofTypeAnnotation(\n this: Printer,\n node: t.TypeofTypeAnnotation,\n) {\n this.word(\"typeof\");\n this.space();\n this.print(node.argument);\n}\n\nexport function TypeAlias(\n this: Printer,\n node: t.TypeAlias | t.DeclareTypeAlias,\n) {\n this.word(\"type\");\n this.space();\n this.print(node.id);\n this.print(node.typeParameters);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.right);\n this.semicolon();\n}\n\nexport function TypeAnnotation(\n this: Printer,\n node: t.TypeAnnotation,\n parent: t.Node,\n) {\n this.token(\":\");\n this.space();\n if (parent.type === \"ArrowFunctionExpression\") {\n this.tokenContext |= TokenContext.arrowFlowReturnType;\n } else if (\n // @ts-expect-error todo(flow->ts) can this be removed? `.optional` looks to be not existing property\n node.optional\n ) {\n this.token(\"?\");\n }\n this.print(node.typeAnnotation);\n}\n\nexport function TypeParameterInstantiation(\n this: Printer,\n node: t.TypeParameterInstantiation,\n): void {\n this.token(\"<\");\n this.printList(node.params);\n this.token(\">\");\n}\n\nexport { TypeParameterInstantiation as TypeParameterDeclaration };\n\nexport function TypeParameter(this: Printer, node: t.TypeParameter) {\n this._variance(node);\n\n this.word(node.name);\n\n if (node.bound) {\n this.print(node.bound);\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 OpaqueType(\n this: Printer,\n node: t.OpaqueType | t.DeclareOpaqueType,\n) {\n this.word(\"opaque\");\n this.space();\n this.word(\"type\");\n this.space();\n this.print(node.id);\n this.print(node.typeParameters);\n if (node.supertype) {\n this.token(\":\");\n this.space();\n this.print(node.supertype);\n }\n\n if (node.impltype) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.impltype);\n }\n this.semicolon();\n}\n\nexport function ObjectTypeAnnotation(\n this: Printer,\n node: t.ObjectTypeAnnotation,\n) {\n if (node.exact) {\n this.token(\"{|\");\n } else {\n this.token(\"{\");\n }\n\n // TODO: remove the array fallbacks and instead enforce the types to require an array\n const props = [\n ...node.properties,\n ...(node.callProperties || []),\n ...(node.indexers || []),\n ...(node.internalSlots || []),\n ];\n\n if (props.length) {\n this.newline();\n\n this.space();\n\n this.printJoin(\n props,\n true,\n true,\n undefined,\n undefined,\n function addNewlines(leading) {\n if (leading && !props[0]) return 1;\n },\n () => {\n if (props.length !== 1 || node.inexact) {\n this.token(\",\");\n this.space();\n }\n },\n );\n\n this.space();\n }\n\n if (node.inexact) {\n this.indent();\n this.token(\"...\");\n if (props.length) {\n this.newline();\n }\n this.dedent();\n }\n\n if (node.exact) {\n this.token(\"|}\");\n } else {\n this.token(\"}\");\n }\n}\n\nexport function ObjectTypeInternalSlot(\n this: Printer,\n node: t.ObjectTypeInternalSlot,\n) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n this.token(\"[\");\n this.token(\"[\");\n this.print(node.id);\n this.token(\"]\");\n this.token(\"]\");\n if (node.optional) this.token(\"?\");\n if (!node.method) {\n this.token(\":\");\n this.space();\n }\n this.print(node.value);\n}\n\nexport function ObjectTypeCallProperty(\n this: Printer,\n node: t.ObjectTypeCallProperty,\n) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n this.print(node.value);\n}\n\nexport function ObjectTypeIndexer(this: Printer, node: t.ObjectTypeIndexer) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n this._variance(node);\n this.token(\"[\");\n if (node.id) {\n this.print(node.id);\n this.token(\":\");\n this.space();\n }\n this.print(node.key);\n this.token(\"]\");\n this.token(\":\");\n this.space();\n this.print(node.value);\n}\n\nexport function ObjectTypeProperty(this: Printer, node: t.ObjectTypeProperty) {\n if (node.proto) {\n this.word(\"proto\");\n this.space();\n }\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n if (node.kind === \"get\" || node.kind === \"set\") {\n this.word(node.kind);\n this.space();\n }\n this._variance(node);\n this.print(node.key);\n if (node.optional) this.token(\"?\");\n if (!node.method) {\n this.token(\":\");\n this.space();\n }\n this.print(node.value);\n}\n\nexport function ObjectTypeSpreadProperty(\n this: Printer,\n node: t.ObjectTypeSpreadProperty,\n) {\n this.token(\"...\");\n this.print(node.argument);\n}\n\nexport function QualifiedTypeIdentifier(\n this: Printer,\n node: t.QualifiedTypeIdentifier,\n) {\n this.print(node.qualification);\n this.token(\".\");\n this.print(node.id);\n}\n\nexport function SymbolTypeAnnotation(this: Printer) {\n this.word(\"symbol\");\n}\n\nfunction orSeparator(this: Printer, occurrenceCount: number) {\n this.space();\n this.token(\"|\", false, occurrenceCount);\n this.space();\n}\n\nexport function UnionTypeAnnotation(\n this: Printer,\n node: t.UnionTypeAnnotation,\n) {\n this.printJoin(node.types, undefined, undefined, orSeparator);\n}\n\nexport function TypeCastExpression(this: Printer, node: t.TypeCastExpression) {\n this.token(\"(\");\n this.print(node.expression);\n this.print(node.typeAnnotation);\n this.token(\")\");\n}\n\nexport function Variance(this: Printer, node: t.Variance) {\n if (node.kind === \"plus\") {\n this.token(\"+\");\n } else {\n this.token(\"-\");\n }\n}\n\nexport function VoidTypeAnnotation(this: Printer) {\n this.word(\"void\");\n}\n\nexport function IndexedAccessType(this: Printer, node: t.IndexedAccessType) {\n this.print(node.objectType, true);\n this.token(\"[\");\n this.print(node.indexType);\n this.token(\"]\");\n}\n\nexport function OptionalIndexedAccessType(\n this: Printer,\n node: t.OptionalIndexedAccessType,\n) {\n this.print(node.objectType);\n if (node.optional) {\n this.token(\"?.\");\n }\n this.token(\"[\");\n this.print(node.indexType);\n this.token(\"]\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAqdA,IAAAG,OAAA,GAAAH,OAAA;AAGoB;EA3dXI,0BAA0B;EAAEC;AAAW,IAAAN,EAAA;AAKzC,SAASO,iBAAiBA,CAAA,EAAgB;EAC/C,IAAI,CAACC,IAAI,CAAC,KAAK,CAAC;AAClB;AAEO,SAASC,mBAAmBA,CAEjCC,IAA2B,EAC3B;EACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,WAAW,EAAE,IAAI,CAAC;EAClC,IAAI,CAACC,SAAK,GAAI,CAAC;EACf,IAAI,CAACA,SAAK,GAAI,CAAC;AACjB;AAEO,SAASC,qBAAqBA,CAAA,EAAgB;EACnD,IAAI,CAACN,IAAI,CAAC,SAAS,CAAC;AACtB;AAEO,SAASO,4BAA4BA,CAE1CL,IAAoC,EACpC;EACA,IAAI,CAACF,IAAI,CAACE,IAAI,CAACM,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAC1C;AAEO,SAASC,yBAAyBA,CAAA,EAAgB;EACvD,IAAI,CAACT,IAAI,CAAC,MAAM,CAAC;AACnB;AAEO,SAASU,YAAYA,CAE1BR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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
var _templateLiterals = require("./template-literals.js");
|
| 7 |
+
Object.keys(_templateLiterals).forEach(function (key) {
|
| 8 |
+
if (key === "default" || key === "__esModule") return;
|
| 9 |
+
if (key in exports && exports[key] === _templateLiterals[key]) return;
|
| 10 |
+
Object.defineProperty(exports, key, {
|
| 11 |
+
enumerable: true,
|
| 12 |
+
get: function () {
|
| 13 |
+
return _templateLiterals[key];
|
| 14 |
+
}
|
| 15 |
+
});
|
| 16 |
+
});
|
| 17 |
+
var _expressions = require("./expressions.js");
|
| 18 |
+
Object.keys(_expressions).forEach(function (key) {
|
| 19 |
+
if (key === "default" || key === "__esModule") return;
|
| 20 |
+
if (key in exports && exports[key] === _expressions[key]) return;
|
| 21 |
+
Object.defineProperty(exports, key, {
|
| 22 |
+
enumerable: true,
|
| 23 |
+
get: function () {
|
| 24 |
+
return _expressions[key];
|
| 25 |
+
}
|
| 26 |
+
});
|
| 27 |
+
});
|
| 28 |
+
var _statements = require("./statements.js");
|
| 29 |
+
Object.keys(_statements).forEach(function (key) {
|
| 30 |
+
if (key === "default" || key === "__esModule") return;
|
| 31 |
+
if (key in exports && exports[key] === _statements[key]) return;
|
| 32 |
+
Object.defineProperty(exports, key, {
|
| 33 |
+
enumerable: true,
|
| 34 |
+
get: function () {
|
| 35 |
+
return _statements[key];
|
| 36 |
+
}
|
| 37 |
+
});
|
| 38 |
+
});
|
| 39 |
+
var _classes = require("./classes.js");
|
| 40 |
+
Object.keys(_classes).forEach(function (key) {
|
| 41 |
+
if (key === "default" || key === "__esModule") return;
|
| 42 |
+
if (key in exports && exports[key] === _classes[key]) return;
|
| 43 |
+
Object.defineProperty(exports, key, {
|
| 44 |
+
enumerable: true,
|
| 45 |
+
get: function () {
|
| 46 |
+
return _classes[key];
|
| 47 |
+
}
|
| 48 |
+
});
|
| 49 |
+
});
|
| 50 |
+
var _methods = require("./methods.js");
|
| 51 |
+
Object.keys(_methods).forEach(function (key) {
|
| 52 |
+
if (key === "default" || key === "__esModule") return;
|
| 53 |
+
if (key in exports && exports[key] === _methods[key]) return;
|
| 54 |
+
Object.defineProperty(exports, key, {
|
| 55 |
+
enumerable: true,
|
| 56 |
+
get: function () {
|
| 57 |
+
return _methods[key];
|
| 58 |
+
}
|
| 59 |
+
});
|
| 60 |
+
});
|
| 61 |
+
var _modules = require("./modules.js");
|
| 62 |
+
Object.keys(_modules).forEach(function (key) {
|
| 63 |
+
if (key === "default" || key === "__esModule") return;
|
| 64 |
+
if (key in exports && exports[key] === _modules[key]) return;
|
| 65 |
+
Object.defineProperty(exports, key, {
|
| 66 |
+
enumerable: true,
|
| 67 |
+
get: function () {
|
| 68 |
+
return _modules[key];
|
| 69 |
+
}
|
| 70 |
+
});
|
| 71 |
+
});
|
| 72 |
+
var _types = require("./types.js");
|
| 73 |
+
Object.keys(_types).forEach(function (key) {
|
| 74 |
+
if (key === "default" || key === "__esModule") return;
|
| 75 |
+
if (key in exports && exports[key] === _types[key]) return;
|
| 76 |
+
Object.defineProperty(exports, key, {
|
| 77 |
+
enumerable: true,
|
| 78 |
+
get: function () {
|
| 79 |
+
return _types[key];
|
| 80 |
+
}
|
| 81 |
+
});
|
| 82 |
+
});
|
| 83 |
+
var _flow = require("./flow.js");
|
| 84 |
+
Object.keys(_flow).forEach(function (key) {
|
| 85 |
+
if (key === "default" || key === "__esModule") return;
|
| 86 |
+
if (key in exports && exports[key] === _flow[key]) return;
|
| 87 |
+
Object.defineProperty(exports, key, {
|
| 88 |
+
enumerable: true,
|
| 89 |
+
get: function () {
|
| 90 |
+
return _flow[key];
|
| 91 |
+
}
|
| 92 |
+
});
|
| 93 |
+
});
|
| 94 |
+
var _base = require("./base.js");
|
| 95 |
+
Object.keys(_base).forEach(function (key) {
|
| 96 |
+
if (key === "default" || key === "__esModule") return;
|
| 97 |
+
if (key in exports && exports[key] === _base[key]) return;
|
| 98 |
+
Object.defineProperty(exports, key, {
|
| 99 |
+
enumerable: true,
|
| 100 |
+
get: function () {
|
| 101 |
+
return _base[key];
|
| 102 |
+
}
|
| 103 |
+
});
|
| 104 |
+
});
|
| 105 |
+
var _jsx = require("./jsx.js");
|
| 106 |
+
Object.keys(_jsx).forEach(function (key) {
|
| 107 |
+
if (key === "default" || key === "__esModule") return;
|
| 108 |
+
if (key in exports && exports[key] === _jsx[key]) return;
|
| 109 |
+
Object.defineProperty(exports, key, {
|
| 110 |
+
enumerable: true,
|
| 111 |
+
get: function () {
|
| 112 |
+
return _jsx[key];
|
| 113 |
+
}
|
| 114 |
+
});
|
| 115 |
+
});
|
| 116 |
+
var _typescript = require("./typescript.js");
|
| 117 |
+
Object.keys(_typescript).forEach(function (key) {
|
| 118 |
+
if (key === "default" || key === "__esModule") return;
|
| 119 |
+
if (key in exports && exports[key] === _typescript[key]) return;
|
| 120 |
+
Object.defineProperty(exports, key, {
|
| 121 |
+
enumerable: true,
|
| 122 |
+
get: function () {
|
| 123 |
+
return _typescript[key];
|
| 124 |
+
}
|
| 125 |
+
});
|
| 126 |
+
});
|
| 127 |
+
|
| 128 |
+
//# sourceMappingURL=index.js.map
|
ui/node_modules/@babel/generator/lib/generators/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_templateLiterals","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_expressions","_statements","_classes","_methods","_modules","_types","_flow","_base","_jsx","_typescript"],"sources":["../../src/generators/index.ts"],"sourcesContent":["export * from \"./template-literals.ts\";\nexport * from \"./expressions.ts\";\nexport * from \"./statements.ts\";\nexport * from \"./classes.ts\";\nexport * from \"./methods.ts\";\nexport * from \"./modules.ts\";\nexport * from \"./types.ts\";\nexport * from \"./flow.ts\";\nexport * from \"./base.ts\";\nexport * from \"./jsx.ts\";\nexport * from \"./typescript.ts\";\n"],"mappings":";;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,iBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,iBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,iBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,YAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,YAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,YAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,YAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,WAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,WAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IA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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.JSXAttribute = JSXAttribute;
|
| 7 |
+
exports.JSXClosingElement = JSXClosingElement;
|
| 8 |
+
exports.JSXClosingFragment = JSXClosingFragment;
|
| 9 |
+
exports.JSXElement = JSXElement;
|
| 10 |
+
exports.JSXEmptyExpression = JSXEmptyExpression;
|
| 11 |
+
exports.JSXExpressionContainer = JSXExpressionContainer;
|
| 12 |
+
exports.JSXFragment = JSXFragment;
|
| 13 |
+
exports.JSXIdentifier = JSXIdentifier;
|
| 14 |
+
exports.JSXMemberExpression = JSXMemberExpression;
|
| 15 |
+
exports.JSXNamespacedName = JSXNamespacedName;
|
| 16 |
+
exports.JSXOpeningElement = JSXOpeningElement;
|
| 17 |
+
exports.JSXOpeningFragment = JSXOpeningFragment;
|
| 18 |
+
exports.JSXSpreadAttribute = JSXSpreadAttribute;
|
| 19 |
+
exports.JSXSpreadChild = JSXSpreadChild;
|
| 20 |
+
exports.JSXText = JSXText;
|
| 21 |
+
function JSXAttribute(node) {
|
| 22 |
+
this.print(node.name);
|
| 23 |
+
if (node.value) {
|
| 24 |
+
this.tokenChar(61);
|
| 25 |
+
this.print(node.value);
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
function JSXIdentifier(node) {
|
| 29 |
+
this.word(node.name);
|
| 30 |
+
}
|
| 31 |
+
function JSXNamespacedName(node) {
|
| 32 |
+
this.print(node.namespace);
|
| 33 |
+
this.tokenChar(58);
|
| 34 |
+
this.print(node.name);
|
| 35 |
+
}
|
| 36 |
+
function JSXMemberExpression(node) {
|
| 37 |
+
this.print(node.object);
|
| 38 |
+
this.tokenChar(46);
|
| 39 |
+
this.print(node.property);
|
| 40 |
+
}
|
| 41 |
+
function JSXSpreadAttribute(node) {
|
| 42 |
+
this.tokenChar(123);
|
| 43 |
+
this.token("...");
|
| 44 |
+
this.print(node.argument);
|
| 45 |
+
this.rightBrace(node);
|
| 46 |
+
}
|
| 47 |
+
function JSXExpressionContainer(node) {
|
| 48 |
+
this.tokenChar(123);
|
| 49 |
+
this.print(node.expression);
|
| 50 |
+
this.rightBrace(node);
|
| 51 |
+
}
|
| 52 |
+
function JSXSpreadChild(node) {
|
| 53 |
+
this.tokenChar(123);
|
| 54 |
+
this.token("...");
|
| 55 |
+
this.print(node.expression);
|
| 56 |
+
this.rightBrace(node);
|
| 57 |
+
}
|
| 58 |
+
function JSXText(node) {
|
| 59 |
+
const raw = this.getPossibleRaw(node);
|
| 60 |
+
if (raw !== undefined) {
|
| 61 |
+
this.token(raw, true);
|
| 62 |
+
} else {
|
| 63 |
+
this.token(node.value, true);
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
+
function JSXElement(node) {
|
| 67 |
+
const open = node.openingElement;
|
| 68 |
+
this.print(open);
|
| 69 |
+
if (open.selfClosing) return;
|
| 70 |
+
this.indent();
|
| 71 |
+
for (const child of node.children) {
|
| 72 |
+
this.print(child);
|
| 73 |
+
}
|
| 74 |
+
this.dedent();
|
| 75 |
+
this.print(node.closingElement);
|
| 76 |
+
}
|
| 77 |
+
function spaceSeparator() {
|
| 78 |
+
this.space();
|
| 79 |
+
}
|
| 80 |
+
function JSXOpeningElement(node) {
|
| 81 |
+
this.tokenChar(60);
|
| 82 |
+
this.print(node.name);
|
| 83 |
+
{
|
| 84 |
+
if (node.typeArguments) {
|
| 85 |
+
this.print(node.typeArguments);
|
| 86 |
+
}
|
| 87 |
+
this.print(node.typeParameters);
|
| 88 |
+
}
|
| 89 |
+
if (node.attributes.length > 0) {
|
| 90 |
+
this.space();
|
| 91 |
+
this.printJoin(node.attributes, undefined, undefined, spaceSeparator);
|
| 92 |
+
}
|
| 93 |
+
if (node.selfClosing) {
|
| 94 |
+
this.space();
|
| 95 |
+
this.tokenChar(47);
|
| 96 |
+
}
|
| 97 |
+
this.tokenChar(62);
|
| 98 |
+
}
|
| 99 |
+
function JSXClosingElement(node) {
|
| 100 |
+
this.tokenChar(60);
|
| 101 |
+
this.tokenChar(47);
|
| 102 |
+
this.print(node.name);
|
| 103 |
+
this.tokenChar(62);
|
| 104 |
+
}
|
| 105 |
+
function JSXEmptyExpression() {
|
| 106 |
+
this.printInnerComments();
|
| 107 |
+
}
|
| 108 |
+
function JSXFragment(node) {
|
| 109 |
+
this.print(node.openingFragment);
|
| 110 |
+
this.indent();
|
| 111 |
+
for (const child of node.children) {
|
| 112 |
+
this.print(child);
|
| 113 |
+
}
|
| 114 |
+
this.dedent();
|
| 115 |
+
this.print(node.closingFragment);
|
| 116 |
+
}
|
| 117 |
+
function JSXOpeningFragment() {
|
| 118 |
+
this.tokenChar(60);
|
| 119 |
+
this.tokenChar(62);
|
| 120 |
+
}
|
| 121 |
+
function JSXClosingFragment() {
|
| 122 |
+
this.token("</");
|
| 123 |
+
this.tokenChar(62);
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
//# sourceMappingURL=jsx.js.map
|
ui/node_modules/@babel/generator/lib/generators/jsx.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["JSXAttribute","node","print","name","value","token","JSXIdentifier","word","JSXNamespacedName","namespace","JSXMemberExpression","object","property","JSXSpreadAttribute","argument","rightBrace","JSXExpressionContainer","expression","JSXSpreadChild","JSXText","raw","getPossibleRaw","undefined","JSXElement","open","openingElement","selfClosing","indent","child","children","dedent","closingElement","spaceSeparator","space","JSXOpeningElement","typeArguments","typeParameters","attributes","length","printJoin","JSXClosingElement","JSXEmptyExpression","printInnerComments","JSXFragment","openingFragment","closingFragment","JSXOpeningFragment","JSXClosingFragment"],"sources":["../../src/generators/jsx.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\n\nexport function JSXAttribute(this: Printer, node: t.JSXAttribute) {\n this.print(node.name);\n if (node.value) {\n this.token(\"=\");\n this.print(node.value);\n }\n}\n\nexport function JSXIdentifier(this: Printer, node: t.JSXIdentifier) {\n this.word(node.name);\n}\n\nexport function JSXNamespacedName(this: Printer, node: t.JSXNamespacedName) {\n this.print(node.namespace);\n this.token(\":\");\n this.print(node.name);\n}\n\nexport function JSXMemberExpression(\n this: Printer,\n node: t.JSXMemberExpression,\n) {\n this.print(node.object);\n this.token(\".\");\n this.print(node.property);\n}\n\nexport function JSXSpreadAttribute(this: Printer, node: t.JSXSpreadAttribute) {\n this.token(\"{\");\n this.token(\"...\");\n this.print(node.argument);\n this.rightBrace(node);\n}\n\nexport function JSXExpressionContainer(\n this: Printer,\n node: t.JSXExpressionContainer,\n) {\n this.token(\"{\");\n this.print(node.expression);\n this.rightBrace(node);\n}\n\nexport function JSXSpreadChild(this: Printer, node: t.JSXSpreadChild) {\n this.token(\"{\");\n this.token(\"...\");\n this.print(node.expression);\n this.rightBrace(node);\n}\n\nexport function JSXText(this: Printer, node: t.JSXText) {\n const raw = this.getPossibleRaw(node);\n\n if (raw !== undefined) {\n this.token(raw, true);\n } else {\n this.token(node.value, true);\n }\n}\n\nexport function JSXElement(this: Printer, node: t.JSXElement) {\n const open = node.openingElement;\n this.print(open);\n if (open.selfClosing) return;\n\n this.indent();\n for (const child of node.children) {\n this.print(child);\n }\n this.dedent();\n\n this.print(node.closingElement);\n}\n\nfunction spaceSeparator(this: Printer) {\n this.space();\n}\n\nexport function JSXOpeningElement(this: Printer, node: t.JSXOpeningElement) {\n this.token(\"<\");\n this.print(node.name);\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 if (node.typeArguments) {\n this.print(node.typeArguments); // Flow AST\n }\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters); // Legacy TS AST\n }\n\n if (node.attributes.length > 0) {\n this.space();\n this.printJoin(node.attributes, undefined, undefined, spaceSeparator);\n }\n if (node.selfClosing) {\n this.space();\n this.token(\"/\");\n }\n this.token(\">\");\n}\n\nexport function JSXClosingElement(this: Printer, node: t.JSXClosingElement) {\n this.token(\"<\");\n this.token(\"/\");\n this.print(node.name);\n this.token(\">\");\n}\n\nexport function JSXEmptyExpression(this: Printer) {\n // This node is empty, so forcefully print its inner comments.\n this.printInnerComments();\n}\n\nexport function JSXFragment(this: Printer, node: t.JSXFragment) {\n this.print(node.openingFragment);\n\n this.indent();\n for (const child of node.children) {\n this.print(child);\n }\n this.dedent();\n\n this.print(node.closingFragment);\n}\n\nexport function JSXOpeningFragment(this: Printer) {\n this.token(\"<\");\n this.token(\">\");\n}\n\nexport function JSXClosingFragment(this: Printer) {\n this.token(\"</\");\n this.token(\">\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGO,SAASA,YAAYA,CAAgBC,IAAoB,EAAE;EAChE,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,IAAI,CAAC;EACrB,IAAIF,IAAI,CAACG,KAAK,EAAE;IACd,IAAI,CAACC,SAAK,GAAI,CAAC;IACf,IAAI,CAACH,KAAK,CAACD,IAAI,CAACG,KAAK,CAAC;EACxB;AACF;AAEO,SAASE,aAAaA,CAAgBL,IAAqB,EAAE;EAClE,IAAI,CAACM,IAAI,CAACN,IAAI,CAACE,IAAI,CAAC;AACtB;AAEO,SAASK,iBAAiBA,CAAgBP,IAAyB,EAAE;EAC1E,IAAI,CAACC,KA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ArrowFunctionExpression = ArrowFunctionExpression;
|
| 7 |
+
exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression;
|
| 8 |
+
exports._functionHead = _functionHead;
|
| 9 |
+
exports._methodHead = _methodHead;
|
| 10 |
+
exports._param = _param;
|
| 11 |
+
exports._parameters = _parameters;
|
| 12 |
+
exports._params = _params;
|
| 13 |
+
exports._predicate = _predicate;
|
| 14 |
+
exports._shouldPrintArrowParamsParens = _shouldPrintArrowParamsParens;
|
| 15 |
+
var _t = require("@babel/types");
|
| 16 |
+
var _index = require("../node/index.js");
|
| 17 |
+
const {
|
| 18 |
+
isIdentifier
|
| 19 |
+
} = _t;
|
| 20 |
+
function _params(node, idNode, parentNode) {
|
| 21 |
+
this.print(node.typeParameters);
|
| 22 |
+
const nameInfo = _getFuncIdName.call(this, idNode, parentNode);
|
| 23 |
+
if (nameInfo) {
|
| 24 |
+
this.sourceIdentifierName(nameInfo.name, nameInfo.pos);
|
| 25 |
+
}
|
| 26 |
+
this.tokenChar(40);
|
| 27 |
+
this._parameters(node.params, ")");
|
| 28 |
+
const noLineTerminator = node.type === "ArrowFunctionExpression";
|
| 29 |
+
this.print(node.returnType, noLineTerminator);
|
| 30 |
+
this._noLineTerminator = noLineTerminator;
|
| 31 |
+
}
|
| 32 |
+
function _parameters(parameters, endToken) {
|
| 33 |
+
const exit = this.enterDelimited();
|
| 34 |
+
const trailingComma = this.shouldPrintTrailingComma(endToken);
|
| 35 |
+
const paramLength = parameters.length;
|
| 36 |
+
for (let i = 0; i < paramLength; i++) {
|
| 37 |
+
this._param(parameters[i]);
|
| 38 |
+
if (trailingComma || i < paramLength - 1) {
|
| 39 |
+
this.token(",", null, i);
|
| 40 |
+
this.space();
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
this.token(endToken);
|
| 44 |
+
exit();
|
| 45 |
+
}
|
| 46 |
+
function _param(parameter) {
|
| 47 |
+
this.printJoin(parameter.decorators);
|
| 48 |
+
this.print(parameter);
|
| 49 |
+
if (parameter.optional) {
|
| 50 |
+
this.tokenChar(63);
|
| 51 |
+
}
|
| 52 |
+
this.print(parameter.typeAnnotation);
|
| 53 |
+
}
|
| 54 |
+
function _methodHead(node) {
|
| 55 |
+
const kind = node.kind;
|
| 56 |
+
const key = node.key;
|
| 57 |
+
if (kind === "get" || kind === "set") {
|
| 58 |
+
this.word(kind);
|
| 59 |
+
this.space();
|
| 60 |
+
}
|
| 61 |
+
if (node.async) {
|
| 62 |
+
this.word("async", true);
|
| 63 |
+
this.space();
|
| 64 |
+
}
|
| 65 |
+
if (kind === "method" || kind === "init") {
|
| 66 |
+
if (node.generator) {
|
| 67 |
+
this.tokenChar(42);
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
if (node.computed) {
|
| 71 |
+
this.tokenChar(91);
|
| 72 |
+
this.print(key);
|
| 73 |
+
this.tokenChar(93);
|
| 74 |
+
} else {
|
| 75 |
+
this.print(key);
|
| 76 |
+
}
|
| 77 |
+
if (node.optional) {
|
| 78 |
+
this.tokenChar(63);
|
| 79 |
+
}
|
| 80 |
+
this._params(node, node.computed && node.key.type !== "StringLiteral" ? undefined : node.key, undefined);
|
| 81 |
+
}
|
| 82 |
+
function _predicate(node, noLineTerminatorAfter) {
|
| 83 |
+
if (node.predicate) {
|
| 84 |
+
if (!node.returnType) {
|
| 85 |
+
this.tokenChar(58);
|
| 86 |
+
}
|
| 87 |
+
this.space();
|
| 88 |
+
this.print(node.predicate, noLineTerminatorAfter);
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
function _functionHead(node, parent) {
|
| 92 |
+
if (node.async) {
|
| 93 |
+
this.word("async");
|
| 94 |
+
if (!this.format.preserveFormat) {
|
| 95 |
+
this._endsWithInnerRaw = false;
|
| 96 |
+
}
|
| 97 |
+
this.space();
|
| 98 |
+
}
|
| 99 |
+
this.word("function");
|
| 100 |
+
if (node.generator) {
|
| 101 |
+
if (!this.format.preserveFormat) {
|
| 102 |
+
this._endsWithInnerRaw = false;
|
| 103 |
+
}
|
| 104 |
+
this.tokenChar(42);
|
| 105 |
+
}
|
| 106 |
+
this.space();
|
| 107 |
+
if (node.id) {
|
| 108 |
+
this.print(node.id);
|
| 109 |
+
}
|
| 110 |
+
this._params(node, node.id, parent);
|
| 111 |
+
if (node.type !== "TSDeclareFunction") {
|
| 112 |
+
this._predicate(node);
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
function FunctionExpression(node, parent) {
|
| 116 |
+
this._functionHead(node, parent);
|
| 117 |
+
this.space();
|
| 118 |
+
this.print(node.body);
|
| 119 |
+
}
|
| 120 |
+
function ArrowFunctionExpression(node, parent) {
|
| 121 |
+
if (node.async) {
|
| 122 |
+
this.word("async", true);
|
| 123 |
+
this.space();
|
| 124 |
+
}
|
| 125 |
+
if (this._shouldPrintArrowParamsParens(node)) {
|
| 126 |
+
this._params(node, undefined, parent);
|
| 127 |
+
} else {
|
| 128 |
+
this.print(node.params[0], true);
|
| 129 |
+
}
|
| 130 |
+
this._predicate(node, true);
|
| 131 |
+
this.space();
|
| 132 |
+
this.printInnerComments();
|
| 133 |
+
this.token("=>");
|
| 134 |
+
this.space();
|
| 135 |
+
this.tokenContext |= _index.TokenContext.arrowBody;
|
| 136 |
+
this.print(node.body);
|
| 137 |
+
}
|
| 138 |
+
function _shouldPrintArrowParamsParens(node) {
|
| 139 |
+
var _firstParam$leadingCo, _firstParam$trailingC;
|
| 140 |
+
if (node.params.length !== 1) return true;
|
| 141 |
+
if (node.typeParameters || node.returnType || node.predicate) {
|
| 142 |
+
return true;
|
| 143 |
+
}
|
| 144 |
+
const firstParam = node.params[0];
|
| 145 |
+
if (!isIdentifier(firstParam) || firstParam.typeAnnotation || firstParam.optional || (_firstParam$leadingCo = firstParam.leadingComments) != null && _firstParam$leadingCo.length || (_firstParam$trailingC = firstParam.trailingComments) != null && _firstParam$trailingC.length) {
|
| 146 |
+
return true;
|
| 147 |
+
}
|
| 148 |
+
if (this.tokenMap) {
|
| 149 |
+
if (node.loc == null) return true;
|
| 150 |
+
if (this.tokenMap.findMatching(node, "(") !== null) return true;
|
| 151 |
+
const arrowToken = this.tokenMap.findMatching(node, "=>");
|
| 152 |
+
if ((arrowToken == null ? void 0 : arrowToken.loc) == null) return true;
|
| 153 |
+
return arrowToken.loc.start.line !== node.loc.start.line;
|
| 154 |
+
}
|
| 155 |
+
if (this.format.retainLines) return true;
|
| 156 |
+
return false;
|
| 157 |
+
}
|
| 158 |
+
function _getFuncIdName(idNode, parent) {
|
| 159 |
+
let id = idNode;
|
| 160 |
+
if (!id && parent) {
|
| 161 |
+
const parentType = parent.type;
|
| 162 |
+
if (parentType === "VariableDeclarator") {
|
| 163 |
+
id = parent.id;
|
| 164 |
+
} else if (parentType === "AssignmentExpression" || parentType === "AssignmentPattern") {
|
| 165 |
+
id = parent.left;
|
| 166 |
+
} else if (parentType === "ObjectProperty" || parentType === "ClassProperty") {
|
| 167 |
+
if (!parent.computed || parent.key.type === "StringLiteral") {
|
| 168 |
+
id = parent.key;
|
| 169 |
+
}
|
| 170 |
+
} else if (parentType === "ClassPrivateProperty" || parentType === "ClassAccessorProperty") {
|
| 171 |
+
id = parent.key;
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
if (!id) return;
|
| 175 |
+
let nameInfo;
|
| 176 |
+
if (id.type === "Identifier") {
|
| 177 |
+
var _id$loc, _id$loc2;
|
| 178 |
+
nameInfo = {
|
| 179 |
+
pos: (_id$loc = id.loc) == null ? void 0 : _id$loc.start,
|
| 180 |
+
name: ((_id$loc2 = id.loc) == null ? void 0 : _id$loc2.identifierName) || id.name
|
| 181 |
+
};
|
| 182 |
+
} else if (id.type === "PrivateName") {
|
| 183 |
+
var _id$loc3;
|
| 184 |
+
nameInfo = {
|
| 185 |
+
pos: (_id$loc3 = id.loc) == null ? void 0 : _id$loc3.start,
|
| 186 |
+
name: "#" + id.id.name
|
| 187 |
+
};
|
| 188 |
+
} else if (id.type === "StringLiteral") {
|
| 189 |
+
var _id$loc4;
|
| 190 |
+
nameInfo = {
|
| 191 |
+
pos: (_id$loc4 = id.loc) == null ? void 0 : _id$loc4.start,
|
| 192 |
+
name: id.value
|
| 193 |
+
};
|
| 194 |
+
}
|
| 195 |
+
return nameInfo;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
//# sourceMappingURL=methods.js.map
|
ui/node_modules/@babel/generator/lib/generators/methods.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_index","isIdentifier","_params","node","idNode","parentNode","print","typeParameters","nameInfo","_getFuncIdName","call","sourceIdentifierName","name","pos","token","_parameters","params","noLineTerminator","type","returnType","_noLineTerminator","parameters","endToken","exit","enterDelimited","trailingComma","shouldPrintTrailingComma","paramLength","length","i","_param","space","parameter","printJoin","decorators","optional","typeAnnotation","_methodHead","kind","key","word","async","generator","computed","undefined","_predicate","noLineTerminatorAfter","predicate","_functionHead","parent","format","preserveFormat","_endsWithInnerRaw","id","FunctionExpression","body","ArrowFunctionExpression","_shouldPrintArrowParamsParens","printInnerComments","tokenContext","TokenContext","arrowBody","_firstParam$leadingCo","_firstParam$trailingC","firstParam","leadingComments","trailingComments","tokenMap","loc","findMatching","arrowToken","start","line","retainLines","parentType","left","_id$loc","_id$loc2","identifierName","_id$loc3","_id$loc4","value"],"sources":["../../src/generators/methods.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\nimport { isIdentifier, type ParentMaps } from \"@babel/types\";\nimport { TokenContext } from \"../node/index.ts\";\n\ntype ParentsOf<T extends t.Node> = ParentMaps[T[\"type\"]];\n\nexport function _params(\n this: Printer,\n node: t.Function | t.TSDeclareMethod | t.TSDeclareFunction,\n idNode: t.Expression | t.PrivateName,\n parentNode: ParentsOf<typeof node>,\n) {\n this.print(node.typeParameters);\n\n const nameInfo = _getFuncIdName.call(this, idNode, parentNode);\n if (nameInfo) {\n this.sourceIdentifierName(nameInfo.name, nameInfo.pos);\n }\n\n this.token(\"(\");\n this._parameters(node.params, \")\");\n\n const noLineTerminator = node.type === \"ArrowFunctionExpression\";\n this.print(node.returnType, noLineTerminator);\n\n this._noLineTerminator = noLineTerminator;\n}\n\nexport function _parameters(\n this: Printer,\n parameters: t.Function[\"params\"],\n endToken: string,\n) {\n const exit = this.enterDelimited();\n\n const trailingComma = this.shouldPrintTrailingComma(endToken);\n\n const paramLength = parameters.length;\n for (let i = 0; i < paramLength; i++) {\n this._param(parameters[i]);\n\n if (trailingComma || i < paramLength - 1) {\n this.token(\",\", null, i);\n this.space();\n }\n }\n\n this.token(endToken);\n exit();\n}\n\nexport function _param(\n this: Printer,\n parameter: t.Identifier | t.RestElement | t.Pattern | t.TSParameterProperty,\n) {\n this.printJoin(parameter.decorators);\n this.print(parameter);\n if (\n // @ts-expect-error optional is not in TSParameterProperty\n parameter.optional\n ) {\n this.token(\"?\"); // TS / flow\n }\n\n this.print(\n // @ts-expect-error typeAnnotation is not in TSParameterProperty\n parameter.typeAnnotation,\n ); // TS / flow\n}\n\nexport function _methodHead(this: Printer, node: t.Method | t.TSDeclareMethod) {\n const kind = node.kind;\n const key = node.key;\n\n if (kind === \"get\" || kind === \"set\") {\n this.word(kind);\n this.space();\n }\n\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n\n if (\n kind === \"method\" ||\n // @ts-expect-error Fixme: kind: \"init\" is not defined\n kind === \"init\"\n ) {\n if (node.generator) {\n this.token(\"*\");\n }\n }\n\n if (node.computed) {\n this.token(\"[\");\n this.print(key);\n this.token(\"]\");\n } else {\n this.print(key);\n }\n\n if (\n // @ts-expect-error optional is not in ObjectMethod\n node.optional\n ) {\n // TS\n this.token(\"?\");\n }\n\n this._params(\n node,\n node.computed && node.key.type !== \"StringLiteral\" ? undefined : node.key,\n undefined,\n );\n}\n\nexport function _predicate(\n this: Printer,\n node:\n | t.FunctionDeclaration\n | t.FunctionExpression\n | t.ArrowFunctionExpression,\n noLineTerminatorAfter?: boolean,\n) {\n if (node.predicate) {\n if (!node.returnType) {\n this.token(\":\");\n }\n this.space();\n this.print(node.predicate, noLineTerminatorAfter);\n }\n}\n\nexport function _functionHead(\n this: Printer,\n node: t.FunctionDeclaration | t.FunctionExpression | t.TSDeclareFunction,\n parent: ParentsOf<typeof node>,\n) {\n if (node.async) {\n this.word(\"async\");\n if (!this.format.preserveFormat) {\n // We prevent inner comments from being printed here,\n // so that they are always consistently printed in the\n // same place regardless of the function type.\n this._endsWithInnerRaw = false;\n }\n this.space();\n }\n this.word(\"function\");\n if (node.generator) {\n if (!this.format.preserveFormat) {\n // We prevent inner comments from being printed here,\n // so that they are always consistently printed in the\n // same place regardless of the function type.\n this._endsWithInnerRaw = false;\n }\n this.token(\"*\");\n }\n\n this.space();\n if (node.id) {\n this.print(node.id);\n }\n\n this._params(node, node.id, parent);\n if (node.type !== \"TSDeclareFunction\") {\n this._predicate(node);\n }\n}\n\nexport function FunctionExpression(\n this: Printer,\n node: t.FunctionExpression,\n parent: ParentsOf<typeof node>,\n) {\n this._functionHead(node, parent);\n this.space();\n this.print(node.body);\n}\n\nexport { FunctionExpression as FunctionDeclaration };\n\nexport function ArrowFunctionExpression(\n this: Printer,\n node: t.ArrowFunctionExpression,\n parent: ParentsOf<typeof node>,\n) {\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n\n if (this._shouldPrintArrowParamsParens(node)) {\n this._params(node, undefined, parent);\n } else {\n this.print(node.params[0], true);\n }\n\n this._predicate(node, true);\n this.space();\n // When printing (x)/*1*/=>{}, we remove the parentheses\n // and thus there aren't two contiguous inner tokens.\n // We forcefully print inner comments here.\n this.printInnerComments();\n this.token(\"=>\");\n\n this.space();\n\n this.tokenContext |= TokenContext.arrowBody;\n this.print(node.body);\n}\n\n// Try to avoid printing parens in simple cases, but only if we're pretty\n// sure that they aren't needed by type annotations or potential newlines.\nexport function _shouldPrintArrowParamsParens(\n this: Printer,\n node: t.ArrowFunctionExpression,\n): boolean {\n if (node.params.length !== 1) return true;\n\n if (node.typeParameters || node.returnType || node.predicate) {\n return true;\n }\n\n const firstParam = node.params[0];\n if (\n !isIdentifier(firstParam) ||\n firstParam.typeAnnotation ||\n firstParam.optional ||\n // Flow does not support `foo /*: string*/ => {};`\n firstParam.leadingComments?.length ||\n firstParam.trailingComments?.length\n ) {\n return true;\n }\n\n if (this.tokenMap) {\n if (node.loc == null) return true;\n if (this.tokenMap.findMatching(node, \"(\") !== null) return true;\n const arrowToken = this.tokenMap.findMatching(node, \"=>\");\n if (arrowToken?.loc == null) return true;\n return arrowToken.loc.start.line !== node.loc.start.line;\n }\n\n if (this.format.retainLines) return true;\n\n return false;\n}\n\nfunction _getFuncIdName(\n this: Printer,\n idNode: t.Expression | t.PrivateName,\n parent: ParentsOf<t.Function | t.TSDeclareMethod | t.TSDeclareFunction>,\n) {\n let id: t.Expression | t.PrivateName | t.LVal = idNode;\n\n if (!id && parent) {\n const parentType = parent.type;\n\n if (parentType === \"VariableDeclarator\") {\n id = parent.id;\n } else if (\n parentType === \"AssignmentExpression\" ||\n parentType === \"AssignmentPattern\"\n ) {\n id = parent.left;\n } else if (\n parentType === \"ObjectProperty\" ||\n parentType === \"ClassProperty\"\n ) {\n if (!parent.computed || parent.key.type === \"StringLiteral\") {\n id = parent.key;\n }\n } else if (\n parentType === \"ClassPrivateProperty\" ||\n parentType === \"ClassAccessorProperty\"\n ) {\n id = parent.key;\n }\n }\n\n if (!id) return;\n\n let nameInfo;\n\n if (id.type === \"Identifier\") {\n nameInfo = {\n pos: id.loc?.start,\n name: id.loc?.identifierName || id.name,\n };\n } else if (id.type === \"PrivateName\") {\n nameInfo = {\n pos: id.loc?.start,\n name: \"#\" + id.id.name,\n };\n } else if (id.type === \"StringLiteral\") {\n nameInfo = {\n pos: id.loc?.start,\n name: id.value,\n };\n }\n\n return nameInfo;\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA,IAAAA,EAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAgD;EADvCE;AAAY,IAAA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aration;
|
| 8 |
+
exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
|
| 9 |
+
exports.ExportNamedDeclaration = ExportNamedDeclaration;
|
| 10 |
+
exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
|
| 11 |
+
exports.ExportSpecifier = ExportSpecifier;
|
| 12 |
+
exports.ImportAttribute = ImportAttribute;
|
| 13 |
+
exports.ImportDeclaration = ImportDeclaration;
|
| 14 |
+
exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
|
| 15 |
+
exports.ImportExpression = ImportExpression;
|
| 16 |
+
exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
|
| 17 |
+
exports.ImportSpecifier = ImportSpecifier;
|
| 18 |
+
exports._printAttributes = _printAttributes;
|
| 19 |
+
var _t = require("@babel/types");
|
| 20 |
+
var _index = require("../node/index.js");
|
| 21 |
+
const {
|
| 22 |
+
isClassDeclaration,
|
| 23 |
+
isExportDefaultSpecifier,
|
| 24 |
+
isExportNamespaceSpecifier,
|
| 25 |
+
isImportDefaultSpecifier,
|
| 26 |
+
isImportNamespaceSpecifier,
|
| 27 |
+
isStatement
|
| 28 |
+
} = _t;
|
| 29 |
+
function ImportSpecifier(node) {
|
| 30 |
+
if (node.importKind === "type" || node.importKind === "typeof") {
|
| 31 |
+
this.word(node.importKind);
|
| 32 |
+
this.space();
|
| 33 |
+
}
|
| 34 |
+
this.print(node.imported);
|
| 35 |
+
if (node.local && node.local.name !== node.imported.name) {
|
| 36 |
+
this.space();
|
| 37 |
+
this.word("as");
|
| 38 |
+
this.space();
|
| 39 |
+
this.print(node.local);
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
function ImportDefaultSpecifier(node) {
|
| 43 |
+
this.print(node.local);
|
| 44 |
+
}
|
| 45 |
+
function ExportDefaultSpecifier(node) {
|
| 46 |
+
this.print(node.exported);
|
| 47 |
+
}
|
| 48 |
+
function ExportSpecifier(node) {
|
| 49 |
+
if (node.exportKind === "type") {
|
| 50 |
+
this.word("type");
|
| 51 |
+
this.space();
|
| 52 |
+
}
|
| 53 |
+
this.print(node.local);
|
| 54 |
+
if (node.exported && node.local.name !== node.exported.name) {
|
| 55 |
+
this.space();
|
| 56 |
+
this.word("as");
|
| 57 |
+
this.space();
|
| 58 |
+
this.print(node.exported);
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
function ExportNamespaceSpecifier(node) {
|
| 62 |
+
this.tokenChar(42);
|
| 63 |
+
this.space();
|
| 64 |
+
this.word("as");
|
| 65 |
+
this.space();
|
| 66 |
+
this.print(node.exported);
|
| 67 |
+
}
|
| 68 |
+
let warningShown = false;
|
| 69 |
+
function _printAttributes(node, hasPreviousBrace) {
|
| 70 |
+
var _node$extra;
|
| 71 |
+
const {
|
| 72 |
+
importAttributesKeyword
|
| 73 |
+
} = this.format;
|
| 74 |
+
const {
|
| 75 |
+
attributes,
|
| 76 |
+
assertions
|
| 77 |
+
} = node;
|
| 78 |
+
if (attributes && !importAttributesKeyword && node.extra && (node.extra.deprecatedAssertSyntax || node.extra.deprecatedWithLegacySyntax) && !warningShown) {
|
| 79 |
+
warningShown = true;
|
| 80 |
+
console.warn(`\
|
| 81 |
+
You are using import attributes, without specifying the desired output syntax.
|
| 82 |
+
Please specify the "importAttributesKeyword" generator option, whose value can be one of:
|
| 83 |
+
- "with" : \`import { a } from "b" with { type: "json" };\`
|
| 84 |
+
- "assert" : \`import { a } from "b" assert { type: "json" };\`
|
| 85 |
+
- "with-legacy" : \`import { a } from "b" with type: "json";\`
|
| 86 |
+
`);
|
| 87 |
+
}
|
| 88 |
+
const useAssertKeyword = importAttributesKeyword === "assert" || !importAttributesKeyword && assertions;
|
| 89 |
+
this.word(useAssertKeyword ? "assert" : "with");
|
| 90 |
+
this.space();
|
| 91 |
+
if (!useAssertKeyword && (importAttributesKeyword === "with-legacy" || !importAttributesKeyword && (_node$extra = node.extra) != null && _node$extra.deprecatedWithLegacySyntax)) {
|
| 92 |
+
this.printList(attributes || assertions);
|
| 93 |
+
return;
|
| 94 |
+
}
|
| 95 |
+
const occurrenceCount = hasPreviousBrace ? 1 : 0;
|
| 96 |
+
this.token("{", null, occurrenceCount);
|
| 97 |
+
this.space();
|
| 98 |
+
this.printList(attributes || assertions, this.shouldPrintTrailingComma("}"));
|
| 99 |
+
this.space();
|
| 100 |
+
this.token("}", null, occurrenceCount);
|
| 101 |
+
}
|
| 102 |
+
function ExportAllDeclaration(node) {
|
| 103 |
+
var _node$attributes, _node$assertions;
|
| 104 |
+
this.word("export");
|
| 105 |
+
this.space();
|
| 106 |
+
if (node.exportKind === "type") {
|
| 107 |
+
this.word("type");
|
| 108 |
+
this.space();
|
| 109 |
+
}
|
| 110 |
+
this.tokenChar(42);
|
| 111 |
+
this.space();
|
| 112 |
+
this.word("from");
|
| 113 |
+
this.space();
|
| 114 |
+
if ((_node$attributes = node.attributes) != null && _node$attributes.length || (_node$assertions = node.assertions) != null && _node$assertions.length) {
|
| 115 |
+
this.print(node.source, true);
|
| 116 |
+
this.space();
|
| 117 |
+
this._printAttributes(node, false);
|
| 118 |
+
} else {
|
| 119 |
+
this.print(node.source);
|
| 120 |
+
}
|
| 121 |
+
this.semicolon();
|
| 122 |
+
}
|
| 123 |
+
function maybePrintDecoratorsBeforeExport(printer, node) {
|
| 124 |
+
if (isClassDeclaration(node.declaration) && printer._shouldPrintDecoratorsBeforeExport(node)) {
|
| 125 |
+
printer.printJoin(node.declaration.decorators);
|
| 126 |
+
}
|
| 127 |
+
}
|
| 128 |
+
function ExportNamedDeclaration(node) {
|
| 129 |
+
maybePrintDecoratorsBeforeExport(this, node);
|
| 130 |
+
this.word("export");
|
| 131 |
+
this.space();
|
| 132 |
+
if (node.declaration) {
|
| 133 |
+
const declar = node.declaration;
|
| 134 |
+
this.print(declar);
|
| 135 |
+
if (!isStatement(declar)) this.semicolon();
|
| 136 |
+
} else {
|
| 137 |
+
if (node.exportKind === "type") {
|
| 138 |
+
this.word("type");
|
| 139 |
+
this.space();
|
| 140 |
+
}
|
| 141 |
+
const specifiers = node.specifiers.slice(0);
|
| 142 |
+
let hasSpecial = false;
|
| 143 |
+
for (;;) {
|
| 144 |
+
const first = specifiers[0];
|
| 145 |
+
if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) {
|
| 146 |
+
hasSpecial = true;
|
| 147 |
+
this.print(specifiers.shift());
|
| 148 |
+
if (specifiers.length) {
|
| 149 |
+
this.tokenChar(44);
|
| 150 |
+
this.space();
|
| 151 |
+
}
|
| 152 |
+
} else {
|
| 153 |
+
break;
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
let hasBrace = false;
|
| 157 |
+
if (specifiers.length || !specifiers.length && !hasSpecial) {
|
| 158 |
+
hasBrace = true;
|
| 159 |
+
this.tokenChar(123);
|
| 160 |
+
if (specifiers.length) {
|
| 161 |
+
this.space();
|
| 162 |
+
this.printList(specifiers, this.shouldPrintTrailingComma("}"));
|
| 163 |
+
this.space();
|
| 164 |
+
}
|
| 165 |
+
this.tokenChar(125);
|
| 166 |
+
}
|
| 167 |
+
if (node.source) {
|
| 168 |
+
var _node$attributes2, _node$assertions2;
|
| 169 |
+
this.space();
|
| 170 |
+
this.word("from");
|
| 171 |
+
this.space();
|
| 172 |
+
if ((_node$attributes2 = node.attributes) != null && _node$attributes2.length || (_node$assertions2 = node.assertions) != null && _node$assertions2.length) {
|
| 173 |
+
this.print(node.source, true);
|
| 174 |
+
this.space();
|
| 175 |
+
this._printAttributes(node, hasBrace);
|
| 176 |
+
} else {
|
| 177 |
+
this.print(node.source);
|
| 178 |
+
}
|
| 179 |
+
}
|
| 180 |
+
this.semicolon();
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
function ExportDefaultDeclaration(node) {
|
| 184 |
+
maybePrintDecoratorsBeforeExport(this, node);
|
| 185 |
+
this.word("export");
|
| 186 |
+
this.noIndentInnerCommentsHere();
|
| 187 |
+
this.space();
|
| 188 |
+
this.word("default");
|
| 189 |
+
this.space();
|
| 190 |
+
this.tokenContext |= _index.TokenContext.exportDefault;
|
| 191 |
+
const declar = node.declaration;
|
| 192 |
+
this.print(declar);
|
| 193 |
+
if (!isStatement(declar)) this.semicolon();
|
| 194 |
+
}
|
| 195 |
+
function ImportDeclaration(node) {
|
| 196 |
+
var _node$attributes3, _node$assertions3;
|
| 197 |
+
this.word("import");
|
| 198 |
+
this.space();
|
| 199 |
+
const isTypeKind = node.importKind === "type" || node.importKind === "typeof";
|
| 200 |
+
if (isTypeKind) {
|
| 201 |
+
this.noIndentInnerCommentsHere();
|
| 202 |
+
this.word(node.importKind);
|
| 203 |
+
this.space();
|
| 204 |
+
} else if (node.module) {
|
| 205 |
+
this.noIndentInnerCommentsHere();
|
| 206 |
+
this.word("module");
|
| 207 |
+
this.space();
|
| 208 |
+
} else if (node.phase) {
|
| 209 |
+
this.noIndentInnerCommentsHere();
|
| 210 |
+
this.word(node.phase);
|
| 211 |
+
this.space();
|
| 212 |
+
}
|
| 213 |
+
const specifiers = node.specifiers.slice(0);
|
| 214 |
+
const hasSpecifiers = !!specifiers.length;
|
| 215 |
+
while (hasSpecifiers) {
|
| 216 |
+
const first = specifiers[0];
|
| 217 |
+
if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
|
| 218 |
+
this.print(specifiers.shift());
|
| 219 |
+
if (specifiers.length) {
|
| 220 |
+
this.tokenChar(44);
|
| 221 |
+
this.space();
|
| 222 |
+
}
|
| 223 |
+
} else {
|
| 224 |
+
break;
|
| 225 |
+
}
|
| 226 |
+
}
|
| 227 |
+
let hasBrace = false;
|
| 228 |
+
if (specifiers.length) {
|
| 229 |
+
hasBrace = true;
|
| 230 |
+
this.tokenChar(123);
|
| 231 |
+
this.space();
|
| 232 |
+
this.printList(specifiers, this.shouldPrintTrailingComma("}"));
|
| 233 |
+
this.space();
|
| 234 |
+
this.tokenChar(125);
|
| 235 |
+
} else if (isTypeKind && !hasSpecifiers) {
|
| 236 |
+
hasBrace = true;
|
| 237 |
+
this.tokenChar(123);
|
| 238 |
+
this.tokenChar(125);
|
| 239 |
+
}
|
| 240 |
+
if (hasSpecifiers || isTypeKind) {
|
| 241 |
+
this.space();
|
| 242 |
+
this.word("from");
|
| 243 |
+
this.space();
|
| 244 |
+
}
|
| 245 |
+
if ((_node$attributes3 = node.attributes) != null && _node$attributes3.length || (_node$assertions3 = node.assertions) != null && _node$assertions3.length) {
|
| 246 |
+
this.print(node.source, true);
|
| 247 |
+
this.space();
|
| 248 |
+
this._printAttributes(node, hasBrace);
|
| 249 |
+
} else {
|
| 250 |
+
this.print(node.source);
|
| 251 |
+
}
|
| 252 |
+
this.semicolon();
|
| 253 |
+
}
|
| 254 |
+
function ImportAttribute(node) {
|
| 255 |
+
this.print(node.key);
|
| 256 |
+
this.tokenChar(58);
|
| 257 |
+
this.space();
|
| 258 |
+
this.print(node.value);
|
| 259 |
+
}
|
| 260 |
+
function ImportNamespaceSpecifier(node) {
|
| 261 |
+
this.tokenChar(42);
|
| 262 |
+
this.space();
|
| 263 |
+
this.word("as");
|
| 264 |
+
this.space();
|
| 265 |
+
this.print(node.local);
|
| 266 |
+
}
|
| 267 |
+
function ImportExpression(node) {
|
| 268 |
+
this.word("import");
|
| 269 |
+
if (node.phase) {
|
| 270 |
+
this.tokenChar(46);
|
| 271 |
+
this.word(node.phase);
|
| 272 |
+
}
|
| 273 |
+
this.tokenChar(40);
|
| 274 |
+
this.print(node.source);
|
| 275 |
+
if (node.options != null) {
|
| 276 |
+
this.tokenChar(44);
|
| 277 |
+
this.space();
|
| 278 |
+
this.print(node.options);
|
| 279 |
+
}
|
| 280 |
+
this.tokenChar(41);
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
//# sourceMappingURL=modules.js.map
|
ui/node_modules/@babel/generator/lib/generators/modules.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_index","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","importAttributesKeyword","format","attributes","assertions","extra","deprecatedAssertSyntax","deprecatedWithLegacySyntax","console","warn","useAssertKeyword","printList","occurrenceCount","shouldPrintTrailingComma","ExportAllDeclaration","_node$attributes","_node$assertions","length","source","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"],"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\";\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[] }>,\n hasPreviousBrace: boolean,\n) {\n const { importAttributesKeyword } = this.format;\n const { attributes, assertions } = node;\n\n if (\n !process.env.BABEL_8_BREAKING &&\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 !process.env.BABEL_8_BREAKING &&\n !useAssertKeyword &&\n (importAttributesKeyword === \"with-legacy\" ||\n (!importAttributesKeyword && node.extra?.deprecatedWithLegacySyntax))\n ) {\n // with-legacy\n this.printList(attributes || assertions);\n return;\n }\n\n const occurrenceCount = hasPreviousBrace ? 1 : 0;\n\n this.token(\"{\", null, occurrenceCount);\n this.space();\n this.printList(attributes || assertions, this.shouldPrintTrailingComma(\"}\"));\n this.space();\n this.token(\"}\", null, 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 (node.attributes?.length || node.assertions?.length) {\n this.print(node.source, true);\n this.space();\n this._printAttributes(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 printer._shouldPrintDecoratorsBeforeExport(\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 (node.attributes?.length || node.assertions?.length) {\n this.print(node.source, true);\n this.space();\n this._printAttributes(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 (node.attributes?.length || node.assertions?.length) {\n this.print(node.source, true);\n this.space();\n this._printAttributes(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 this.print(node.source);\n if (node.options != null) {\n this.token(\",\");\n this.space();\n this.print(node.options);\n }\n this.token(\")\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AASA,IAAAC,MAAA,GAAAD,OAAA;AAAgD;EAR9CE,kBAAkB;EAClBC,wBAAwB;EACxBC,0BAA0B;EAC1BC,wBAAwB;EACxBC,0BAA0B;EAC1BC;AAAW,IAAAR,EAAA;AAKN,SAASS,eAAeA,CAAgBC,IAAuB,EAAE;EACtE,IAAIA,IAAI,CAACC,UAAU,KAAK,MAAM,IAAID,IAAI,CAACC,UAAU,KAAK,QAAQ,EAAE;IAC9D,IAAI,CAACC,IAAI,CAACF,IAAI,CAACC,UAAU,CAAC;IAC1B,IAAI,CAACE,KAAK,CAAC,CAAC;EACd;EAEA,IAAI,CAACC,KAAK,CAACJ,IAAI,CAACK,QAAQ,CAAC;EAEzB,IAAIL,IAAI,CAACM,KAAK,IAAIN,IAAI,CAACM,KAAK,CAACC,IAAI,KAAKP,IAAI,CAACK,QAAQ,CAACE,IAAI,EAAE;IACxD,IAAI,CAACJ,KAAK,CAAC,CAAC;IACZ,IAAI,CAACD,IAAI,CAAC,IAAI,CAAC;IACf,IAAI,CAACC,KAAK,CAAC,CAAC;IACZ,IAAI,CAACC,KAAK,CAACJ,IAAI,CAACM,KAAK,CAAC;EACxB;AACF;AAEO,SAASE,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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.ForOfStatement = exports.ForInStatement = void 0;
|
| 12 |
+
exports.ForStatement = ForStatement;
|
| 13 |
+
exports.IfStatement = IfStatement;
|
| 14 |
+
exports.LabeledStatement = LabeledStatement;
|
| 15 |
+
exports.ReturnStatement = ReturnStatement;
|
| 16 |
+
exports.SwitchCase = SwitchCase;
|
| 17 |
+
exports.SwitchStatement = SwitchStatement;
|
| 18 |
+
exports.ThrowStatement = ThrowStatement;
|
| 19 |
+
exports.TryStatement = TryStatement;
|
| 20 |
+
exports.VariableDeclaration = VariableDeclaration;
|
| 21 |
+
exports.VariableDeclarator = VariableDeclarator;
|
| 22 |
+
exports.WhileStatement = WhileStatement;
|
| 23 |
+
exports.WithStatement = WithStatement;
|
| 24 |
+
var _t = require("@babel/types");
|
| 25 |
+
var _index = require("../node/index.js");
|
| 26 |
+
const {
|
| 27 |
+
isFor,
|
| 28 |
+
isForStatement,
|
| 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);
|
| 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 |
+
{
|
| 80 |
+
const exit = this.enterForStatementInit();
|
| 81 |
+
this.tokenContext |= _index.TokenContext.forHead;
|
| 82 |
+
this.print(node.init);
|
| 83 |
+
exit();
|
| 84 |
+
}
|
| 85 |
+
this.tokenChar(59);
|
| 86 |
+
if (node.test) {
|
| 87 |
+
this.space();
|
| 88 |
+
this.print(node.test);
|
| 89 |
+
}
|
| 90 |
+
this.token(";", false, 1);
|
| 91 |
+
if (node.update) {
|
| 92 |
+
this.space();
|
| 93 |
+
this.print(node.update);
|
| 94 |
+
}
|
| 95 |
+
this.tokenChar(41);
|
| 96 |
+
this.printBlock(node);
|
| 97 |
+
}
|
| 98 |
+
function WhileStatement(node) {
|
| 99 |
+
this.word("while");
|
| 100 |
+
this.space();
|
| 101 |
+
this.tokenChar(40);
|
| 102 |
+
this.print(node.test);
|
| 103 |
+
this.tokenChar(41);
|
| 104 |
+
this.printBlock(node);
|
| 105 |
+
}
|
| 106 |
+
function ForXStatement(node) {
|
| 107 |
+
this.word("for");
|
| 108 |
+
this.space();
|
| 109 |
+
const isForOf = node.type === "ForOfStatement";
|
| 110 |
+
if (isForOf && node.await) {
|
| 111 |
+
this.word("await");
|
| 112 |
+
this.space();
|
| 113 |
+
}
|
| 114 |
+
this.noIndentInnerCommentsHere();
|
| 115 |
+
this.tokenChar(40);
|
| 116 |
+
{
|
| 117 |
+
const exit = isForOf ? null : this.enterForStatementInit();
|
| 118 |
+
this.tokenContext |= isForOf ? _index.TokenContext.forOfHead : _index.TokenContext.forInHead;
|
| 119 |
+
this.print(node.left);
|
| 120 |
+
exit == null || exit();
|
| 121 |
+
}
|
| 122 |
+
this.space();
|
| 123 |
+
this.word(isForOf ? "of" : "in");
|
| 124 |
+
this.space();
|
| 125 |
+
this.print(node.right);
|
| 126 |
+
this.tokenChar(41);
|
| 127 |
+
this.printBlock(node);
|
| 128 |
+
}
|
| 129 |
+
const ForInStatement = exports.ForInStatement = ForXStatement;
|
| 130 |
+
const ForOfStatement = exports.ForOfStatement = ForXStatement;
|
| 131 |
+
function DoWhileStatement(node) {
|
| 132 |
+
this.word("do");
|
| 133 |
+
this.space();
|
| 134 |
+
this.print(node.body);
|
| 135 |
+
this.space();
|
| 136 |
+
this.word("while");
|
| 137 |
+
this.space();
|
| 138 |
+
this.tokenChar(40);
|
| 139 |
+
this.print(node.test);
|
| 140 |
+
this.tokenChar(41);
|
| 141 |
+
this.semicolon();
|
| 142 |
+
}
|
| 143 |
+
function printStatementAfterKeyword(printer, node) {
|
| 144 |
+
if (node) {
|
| 145 |
+
printer.space();
|
| 146 |
+
printer.printTerminatorless(node);
|
| 147 |
+
}
|
| 148 |
+
printer.semicolon();
|
| 149 |
+
}
|
| 150 |
+
function BreakStatement(node) {
|
| 151 |
+
this.word("break");
|
| 152 |
+
printStatementAfterKeyword(this, node.label);
|
| 153 |
+
}
|
| 154 |
+
function ContinueStatement(node) {
|
| 155 |
+
this.word("continue");
|
| 156 |
+
printStatementAfterKeyword(this, node.label);
|
| 157 |
+
}
|
| 158 |
+
function ReturnStatement(node) {
|
| 159 |
+
this.word("return");
|
| 160 |
+
printStatementAfterKeyword(this, node.argument);
|
| 161 |
+
}
|
| 162 |
+
function ThrowStatement(node) {
|
| 163 |
+
this.word("throw");
|
| 164 |
+
printStatementAfterKeyword(this, node.argument);
|
| 165 |
+
}
|
| 166 |
+
function LabeledStatement(node) {
|
| 167 |
+
this.print(node.label);
|
| 168 |
+
this.tokenChar(58);
|
| 169 |
+
this.space();
|
| 170 |
+
this.print(node.body);
|
| 171 |
+
}
|
| 172 |
+
function TryStatement(node) {
|
| 173 |
+
this.word("try");
|
| 174 |
+
this.space();
|
| 175 |
+
this.print(node.block);
|
| 176 |
+
this.space();
|
| 177 |
+
if (node.handlers) {
|
| 178 |
+
this.print(node.handlers[0]);
|
| 179 |
+
} else {
|
| 180 |
+
this.print(node.handler);
|
| 181 |
+
}
|
| 182 |
+
if (node.finalizer) {
|
| 183 |
+
this.space();
|
| 184 |
+
this.word("finally");
|
| 185 |
+
this.space();
|
| 186 |
+
this.print(node.finalizer);
|
| 187 |
+
}
|
| 188 |
+
}
|
| 189 |
+
function CatchClause(node) {
|
| 190 |
+
this.word("catch");
|
| 191 |
+
this.space();
|
| 192 |
+
if (node.param) {
|
| 193 |
+
this.tokenChar(40);
|
| 194 |
+
this.print(node.param);
|
| 195 |
+
this.print(node.param.typeAnnotation);
|
| 196 |
+
this.tokenChar(41);
|
| 197 |
+
this.space();
|
| 198 |
+
}
|
| 199 |
+
this.print(node.body);
|
| 200 |
+
}
|
| 201 |
+
function SwitchStatement(node) {
|
| 202 |
+
this.word("switch");
|
| 203 |
+
this.space();
|
| 204 |
+
this.tokenChar(40);
|
| 205 |
+
this.print(node.discriminant);
|
| 206 |
+
this.tokenChar(41);
|
| 207 |
+
this.space();
|
| 208 |
+
this.tokenChar(123);
|
| 209 |
+
this.printSequence(node.cases, true, undefined, function addNewlines(leading, cas) {
|
| 210 |
+
if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
|
| 211 |
+
});
|
| 212 |
+
this.rightBrace(node);
|
| 213 |
+
}
|
| 214 |
+
function SwitchCase(node) {
|
| 215 |
+
if (node.test) {
|
| 216 |
+
this.word("case");
|
| 217 |
+
this.space();
|
| 218 |
+
this.print(node.test);
|
| 219 |
+
this.tokenChar(58);
|
| 220 |
+
} else {
|
| 221 |
+
this.word("default");
|
| 222 |
+
this.tokenChar(58);
|
| 223 |
+
}
|
| 224 |
+
if (node.consequent.length) {
|
| 225 |
+
this.newline();
|
| 226 |
+
this.printSequence(node.consequent, true);
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
function DebuggerStatement() {
|
| 230 |
+
this.word("debugger");
|
| 231 |
+
this.semicolon();
|
| 232 |
+
}
|
| 233 |
+
function VariableDeclaration(node, parent) {
|
| 234 |
+
if (node.declare) {
|
| 235 |
+
this.word("declare");
|
| 236 |
+
this.space();
|
| 237 |
+
}
|
| 238 |
+
const {
|
| 239 |
+
kind
|
| 240 |
+
} = node;
|
| 241 |
+
if (kind === "await using") {
|
| 242 |
+
this.word("await");
|
| 243 |
+
this.space();
|
| 244 |
+
this.word("using", true);
|
| 245 |
+
} else {
|
| 246 |
+
this.word(kind, kind === "using");
|
| 247 |
+
}
|
| 248 |
+
this.space();
|
| 249 |
+
let hasInits = false;
|
| 250 |
+
if (!isFor(parent)) {
|
| 251 |
+
for (const declar of node.declarations) {
|
| 252 |
+
if (declar.init) {
|
| 253 |
+
hasInits = true;
|
| 254 |
+
}
|
| 255 |
+
}
|
| 256 |
+
}
|
| 257 |
+
this.printList(node.declarations, undefined, undefined, node.declarations.length > 1, hasInits ? function (occurrenceCount) {
|
| 258 |
+
this.token(",", false, occurrenceCount);
|
| 259 |
+
this.newline();
|
| 260 |
+
} : undefined);
|
| 261 |
+
if (isFor(parent)) {
|
| 262 |
+
if (isForStatement(parent)) {
|
| 263 |
+
if (parent.init === node) return;
|
| 264 |
+
} else {
|
| 265 |
+
if (parent.left === node) return;
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
this.semicolon();
|
| 269 |
+
}
|
| 270 |
+
function VariableDeclarator(node) {
|
| 271 |
+
this.print(node.id);
|
| 272 |
+
if (node.definite) this.tokenChar(33);
|
| 273 |
+
this.print(node.id.typeAnnotation);
|
| 274 |
+
if (node.init) {
|
| 275 |
+
this.space();
|
| 276 |
+
this.tokenChar(61);
|
| 277 |
+
this.space();
|
| 278 |
+
this.print(node.init);
|
| 279 |
+
}
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
//# sourceMappingURL=statements.js.map
|
ui/node_modules/@babel/generator/lib/generators/statements.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_index","isFor","isForStatement","isIfStatement","isStatement","WithStatement","node","word","space","token","print","object","printBlock","IfStatement","test","needsBlock","alternate","getLastStatement","consequent","newline","indent","printAndIndentOnComments","dedent","endsWith","statement","body","ForStatement","exit","enterForStatementInit","tokenContext","TokenContext","forHead","init","update","WhileStatement","ForXStatement","isForOf","type","await","noIndentInnerCommentsHere","forOfHead","forInHead","left","right","ForInStatement","exports","ForOfStatement","DoWhileStatement","semicolon","printStatementAfterKeyword","printer","printTerminatorless","BreakStatement","label","ContinueStatement","ReturnStatement","argument","ThrowStatement","LabeledStatement","TryStatement","block","handlers","handler","finalizer","CatchClause","param","typeAnnotation","SwitchStatement","discriminant","printSequence","cases","undefined","addNewlines","leading","cas","length","rightBrace","SwitchCase","DebuggerStatement","VariableDeclaration","parent","declare","kind","hasInits","declar","declarations","printList","occurrenceCount","VariableDeclarator","id","definite"],"sources":["../../src/generators/statements.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isFor,\n isForStatement,\n isIfStatement,\n isStatement,\n} 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);\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 {\n const exit = this.enterForStatementInit();\n this.tokenContext |= TokenContext.forHead;\n this.print(node.init);\n exit();\n }\n\n this.token(\";\");\n\n if (node.test) {\n this.space();\n this.print(node.test);\n }\n this.token(\";\", false, 1);\n\n if (node.update) {\n this.space();\n this.print(node.update);\n }\n\n this.token(\")\");\n this.printBlock(node);\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);\n}\n\nfunction ForXStatement(this: Printer, node: t.ForXStatement) {\n this.word(\"for\");\n this.space();\n const isForOf = node.type === \"ForOfStatement\";\n if (isForOf && node.await) {\n this.word(\"await\");\n this.space();\n }\n this.noIndentInnerCommentsHere();\n this.token(\"(\");\n {\n const exit = isForOf ? null : this.enterForStatementInit();\n this.tokenContext |= isForOf\n ? TokenContext.forOfHead\n : TokenContext.forInHead;\n this.print(node.left);\n exit?.();\n }\n this.space();\n this.word(isForOf ? \"of\" : \"in\");\n this.space();\n this.print(node.right);\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport const ForInStatement = ForXStatement;\nexport const ForOfStatement = ForXStatement;\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(printer: Printer, node: t.Node) {\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(\n node.cases,\n true,\n undefined,\n function addNewlines(leading, cas) {\n if (!leading && node.cases[node.cases.length - 1] === cas) return -1;\n },\n );\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\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 if (kind === \"await using\") {\n this.word(\"await\");\n this.space();\n this.word(\"using\", true);\n } else {\n this.word(kind, kind === \"using\");\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 }\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\n ? function (this: Printer, occurrenceCount: number) {\n this.token(\",\", false, occurrenceCount);\n this.newline();\n }\n : undefined,\n );\n\n if (isFor(parent)) {\n // don't give semicolons to these nodes since they'll be inserted in the parent generator\n if (isForStatement(parent)) {\n if (parent.init === node) return;\n } else {\n if (parent.left === node) return;\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":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAWA,IAAAC,MAAA,GAAAD,OAAA;AAAgD;EAV9CE,KAAK;EACLC,cAAc;EACdC,aAAa;EACbC;AAAW,IAAAN,EAAA;AASN,SAASO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
"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 |
+
{
|
| 13 |
+
this.print(node.typeParameters);
|
| 14 |
+
}
|
| 15 |
+
this.print(node.quasi);
|
| 16 |
+
}
|
| 17 |
+
function TemplateElement() {
|
| 18 |
+
throw new Error("TemplateElement printing is handled in TemplateLiteral");
|
| 19 |
+
}
|
| 20 |
+
function _printTemplate(node, substitutions) {
|
| 21 |
+
const quasis = node.quasis;
|
| 22 |
+
let partRaw = "`";
|
| 23 |
+
for (let i = 0; i < quasis.length - 1; i++) {
|
| 24 |
+
partRaw += quasis[i].value.raw;
|
| 25 |
+
this.token(partRaw + "${", true);
|
| 26 |
+
this.print(substitutions[i]);
|
| 27 |
+
partRaw = "}";
|
| 28 |
+
if (this.tokenMap) {
|
| 29 |
+
const token = this.tokenMap.findMatching(node, "}", i);
|
| 30 |
+
if (token) this._catchUpTo(token.loc.start);
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
partRaw += quasis[quasis.length - 1].value.raw;
|
| 34 |
+
this.token(partRaw + "`", true);
|
| 35 |
+
}
|
| 36 |
+
function TemplateLiteral(node) {
|
| 37 |
+
this._printTemplate(node, node.expressions);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
//# sourceMappingURL=template-literals.js.map
|
ui/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","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 this._printTemplate(node, node.expressions);\n}\n"],"mappings":";;;;;;;;;AAGO,SAASA,wBAAwBA,CAEtCC,IAAgC,EAChC;EACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,GAAG,CAAC;EAIb;IAEL,IAAI,CAACD,KAAK,CAACD,IAAI,CAACG,cAAc,CAAC;EACjC;EACA,IAAI,CAACF,KAAK,CAACD,IAAI,CAACI,KAAK,CAAC;AACx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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.RecordExpression = RecordExpression;
|
| 20 |
+
exports.RegExpLiteral = RegExpLiteral;
|
| 21 |
+
exports.SpreadElement = exports.RestElement = RestElement;
|
| 22 |
+
exports.StringLiteral = StringLiteral;
|
| 23 |
+
exports.TopicReference = TopicReference;
|
| 24 |
+
exports.TupleExpression = TupleExpression;
|
| 25 |
+
exports._getRawIdentifier = _getRawIdentifier;
|
| 26 |
+
var _t = require("@babel/types");
|
| 27 |
+
var _jsesc = require("jsesc");
|
| 28 |
+
const {
|
| 29 |
+
isAssignmentPattern,
|
| 30 |
+
isIdentifier
|
| 31 |
+
} = _t;
|
| 32 |
+
let lastRawIdentNode = null;
|
| 33 |
+
let lastRawIdentResult = "";
|
| 34 |
+
function _getRawIdentifier(node) {
|
| 35 |
+
if (node === lastRawIdentNode) return lastRawIdentResult;
|
| 36 |
+
lastRawIdentNode = node;
|
| 37 |
+
const {
|
| 38 |
+
name
|
| 39 |
+
} = node;
|
| 40 |
+
const token = this.tokenMap.find(node, tok => tok.value === name);
|
| 41 |
+
if (token) {
|
| 42 |
+
lastRawIdentResult = this._originalCode.slice(token.start, token.end);
|
| 43 |
+
return lastRawIdentResult;
|
| 44 |
+
}
|
| 45 |
+
return lastRawIdentResult = node.name;
|
| 46 |
+
}
|
| 47 |
+
function Identifier(node) {
|
| 48 |
+
var _node$loc;
|
| 49 |
+
this.sourceIdentifierName(((_node$loc = node.loc) == null ? void 0 : _node$loc.identifierName) || node.name);
|
| 50 |
+
this.word(this.tokenMap ? this._getRawIdentifier(node) : node.name);
|
| 51 |
+
}
|
| 52 |
+
function ArgumentPlaceholder() {
|
| 53 |
+
this.tokenChar(63);
|
| 54 |
+
}
|
| 55 |
+
function RestElement(node) {
|
| 56 |
+
this.token("...");
|
| 57 |
+
this.print(node.argument);
|
| 58 |
+
}
|
| 59 |
+
function ObjectExpression(node) {
|
| 60 |
+
const props = node.properties;
|
| 61 |
+
this.tokenChar(123);
|
| 62 |
+
if (props.length) {
|
| 63 |
+
const exit = this.enterDelimited();
|
| 64 |
+
this.space();
|
| 65 |
+
this.printList(props, this.shouldPrintTrailingComma("}"), true, true);
|
| 66 |
+
this.space();
|
| 67 |
+
exit();
|
| 68 |
+
}
|
| 69 |
+
this.sourceWithOffset("end", node.loc, -1);
|
| 70 |
+
this.tokenChar(125);
|
| 71 |
+
}
|
| 72 |
+
function ObjectMethod(node) {
|
| 73 |
+
this.printJoin(node.decorators);
|
| 74 |
+
this._methodHead(node);
|
| 75 |
+
this.space();
|
| 76 |
+
this.print(node.body);
|
| 77 |
+
}
|
| 78 |
+
function ObjectProperty(node) {
|
| 79 |
+
this.printJoin(node.decorators);
|
| 80 |
+
if (node.computed) {
|
| 81 |
+
this.tokenChar(91);
|
| 82 |
+
this.print(node.key);
|
| 83 |
+
this.tokenChar(93);
|
| 84 |
+
} else {
|
| 85 |
+
if (isAssignmentPattern(node.value) && isIdentifier(node.key) && node.key.name === node.value.left.name) {
|
| 86 |
+
this.print(node.value);
|
| 87 |
+
return;
|
| 88 |
+
}
|
| 89 |
+
this.print(node.key);
|
| 90 |
+
if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) {
|
| 91 |
+
return;
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
this.tokenChar(58);
|
| 95 |
+
this.space();
|
| 96 |
+
this.print(node.value);
|
| 97 |
+
}
|
| 98 |
+
function ArrayExpression(node) {
|
| 99 |
+
const elems = node.elements;
|
| 100 |
+
const len = elems.length;
|
| 101 |
+
this.tokenChar(91);
|
| 102 |
+
const exit = this.enterDelimited();
|
| 103 |
+
for (let i = 0; i < elems.length; i++) {
|
| 104 |
+
const elem = elems[i];
|
| 105 |
+
if (elem) {
|
| 106 |
+
if (i > 0) this.space();
|
| 107 |
+
this.print(elem);
|
| 108 |
+
if (i < len - 1 || this.shouldPrintTrailingComma("]")) {
|
| 109 |
+
this.token(",", false, i);
|
| 110 |
+
}
|
| 111 |
+
} else {
|
| 112 |
+
this.token(",", false, i);
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
exit();
|
| 116 |
+
this.tokenChar(93);
|
| 117 |
+
}
|
| 118 |
+
function RecordExpression(node) {
|
| 119 |
+
const props = node.properties;
|
| 120 |
+
let startToken;
|
| 121 |
+
let endToken;
|
| 122 |
+
{
|
| 123 |
+
if (this.format.recordAndTupleSyntaxType === "bar") {
|
| 124 |
+
startToken = "{|";
|
| 125 |
+
endToken = "|}";
|
| 126 |
+
} else if (this.format.recordAndTupleSyntaxType !== "hash" && this.format.recordAndTupleSyntaxType != null) {
|
| 127 |
+
throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
|
| 128 |
+
} else {
|
| 129 |
+
startToken = "#{";
|
| 130 |
+
endToken = "}";
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
this.token(startToken);
|
| 134 |
+
if (props.length) {
|
| 135 |
+
this.space();
|
| 136 |
+
this.printList(props, this.shouldPrintTrailingComma(endToken), true, true);
|
| 137 |
+
this.space();
|
| 138 |
+
}
|
| 139 |
+
this.token(endToken);
|
| 140 |
+
}
|
| 141 |
+
function TupleExpression(node) {
|
| 142 |
+
const elems = node.elements;
|
| 143 |
+
const len = elems.length;
|
| 144 |
+
let startToken;
|
| 145 |
+
let endToken;
|
| 146 |
+
{
|
| 147 |
+
if (this.format.recordAndTupleSyntaxType === "bar") {
|
| 148 |
+
startToken = "[|";
|
| 149 |
+
endToken = "|]";
|
| 150 |
+
} else if (this.format.recordAndTupleSyntaxType === "hash") {
|
| 151 |
+
startToken = "#[";
|
| 152 |
+
endToken = "]";
|
| 153 |
+
} else {
|
| 154 |
+
throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
this.token(startToken);
|
| 158 |
+
for (let i = 0; i < elems.length; i++) {
|
| 159 |
+
const elem = elems[i];
|
| 160 |
+
if (elem) {
|
| 161 |
+
if (i > 0) this.space();
|
| 162 |
+
this.print(elem);
|
| 163 |
+
if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) {
|
| 164 |
+
this.token(",", false, i);
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
}
|
| 168 |
+
this.token(endToken);
|
| 169 |
+
}
|
| 170 |
+
function RegExpLiteral(node) {
|
| 171 |
+
this.word(`/${node.pattern}/${node.flags}`);
|
| 172 |
+
}
|
| 173 |
+
function BooleanLiteral(node) {
|
| 174 |
+
this.word(node.value ? "true" : "false");
|
| 175 |
+
}
|
| 176 |
+
function NullLiteral() {
|
| 177 |
+
this.word("null");
|
| 178 |
+
}
|
| 179 |
+
function NumericLiteral(node) {
|
| 180 |
+
const raw = this.getPossibleRaw(node);
|
| 181 |
+
const opts = this.format.jsescOption;
|
| 182 |
+
const value = node.value;
|
| 183 |
+
const str = value + "";
|
| 184 |
+
if (opts.numbers) {
|
| 185 |
+
this.number(_jsesc(value, opts), value);
|
| 186 |
+
} else if (raw == null) {
|
| 187 |
+
this.number(str, value);
|
| 188 |
+
} else if (this.format.minified) {
|
| 189 |
+
this.number(raw.length < str.length ? raw : str, value);
|
| 190 |
+
} else {
|
| 191 |
+
this.number(raw, value);
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
function StringLiteral(node) {
|
| 195 |
+
const raw = this.getPossibleRaw(node);
|
| 196 |
+
if (!this.format.minified && raw !== undefined) {
|
| 197 |
+
this.token(raw);
|
| 198 |
+
return;
|
| 199 |
+
}
|
| 200 |
+
const val = _jsesc(node.value, this.format.jsescOption);
|
| 201 |
+
this.token(val);
|
| 202 |
+
}
|
| 203 |
+
function BigIntLiteral(node) {
|
| 204 |
+
const raw = this.getPossibleRaw(node);
|
| 205 |
+
if (!this.format.minified && raw !== undefined) {
|
| 206 |
+
this.word(raw);
|
| 207 |
+
return;
|
| 208 |
+
}
|
| 209 |
+
this.word(node.value + "n");
|
| 210 |
+
}
|
| 211 |
+
const validTopicTokenSet = new Set(["^^", "@@", "^", "%", "#"]);
|
| 212 |
+
function TopicReference() {
|
| 213 |
+
const {
|
| 214 |
+
topicToken
|
| 215 |
+
} = this.format;
|
| 216 |
+
if (validTopicTokenSet.has(topicToken)) {
|
| 217 |
+
this.token(topicToken);
|
| 218 |
+
} else {
|
| 219 |
+
const givenTopicTokenJSON = JSON.stringify(topicToken);
|
| 220 |
+
const validTopics = Array.from(validTopicTokenSet, v => JSON.stringify(v));
|
| 221 |
+
throw new Error(`The "topicToken" generator option must be one of ` + `${validTopics.join(", ")} (${givenTopicTokenJSON} received instead).`);
|
| 222 |
+
}
|
| 223 |
+
}
|
| 224 |
+
function PipelineTopicExpression(node) {
|
| 225 |
+
this.print(node.expression);
|
| 226 |
+
}
|
| 227 |
+
function PipelineBareFunction(node) {
|
| 228 |
+
this.print(node.callee);
|
| 229 |
+
}
|
| 230 |
+
function PipelinePrimaryTopicReference() {
|
| 231 |
+
this.tokenChar(35);
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
//# sourceMappingURL=types.js.map
|
ui/node_modules/@babel/generator/lib/generators/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_jsesc","isAssignmentPattern","isIdentifier","lastRawIdentNode","lastRawIdentResult","_getRawIdentifier","node","name","token","tokenMap","find","tok","value","_originalCode","slice","start","end","Identifier","_node$loc","sourceIdentifierName","loc","identifierName","word","ArgumentPlaceholder","RestElement","print","argument","ObjectExpression","props","properties","length","exit","enterDelimited","space","printList","shouldPrintTrailingComma","sourceWithOffset","ObjectMethod","printJoin","decorators","_methodHead","body","ObjectProperty","computed","key","left","shorthand","ArrayExpression","elems","elements","len","i","elem","RecordExpression","startToken","endToken","format","recordAndTupleSyntaxType","Error","JSON","stringify","TupleExpression","RegExpLiteral","pattern","flags","BooleanLiteral","NullLiteral","NumericLiteral","raw","getPossibleRaw","opts","jsescOption","str","numbers","number","jsesc","minified","StringLiteral","undefined","val","BigIntLiteral","validTopicTokenSet","Set","TopicReference","topicToken","has","givenTopicTokenJSON","validTopics","Array","from","v","join","PipelineTopicExpression","expression","PipelineBareFunction","callee","PipelinePrimaryTopicReference"],"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\nlet lastRawIdentNode: t.Identifier | null = null;\nlet lastRawIdentResult: string = \"\";\nexport function _getRawIdentifier(this: Printer, node: t.Identifier) {\n if (node === lastRawIdentNode) return lastRawIdentResult;\n lastRawIdentNode = node;\n\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 this.sourceIdentifierName(node.loc?.identifierName || node.name);\n\n this.word(this.tokenMap ? this._getRawIdentifier(node) : 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 exit = this.enterDelimited();\n this.space();\n this.printList(props, this.shouldPrintTrailingComma(\"}\"), true, true);\n this.space();\n exit();\n }\n\n this.sourceWithOffset(\"end\", node.loc, -1);\n\n this.token(\"}\");\n}\n\nexport { ObjectExpression as ObjectPattern };\n\nexport function ObjectMethod(this: Printer, node: t.ObjectMethod) {\n this.printJoin(node.decorators);\n this._methodHead(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 exit = 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);\n if (i < len - 1 || this.shouldPrintTrailingComma(\"]\")) {\n this.token(\",\", false, 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.token(\",\", false, i);\n }\n }\n\n exit();\n\n this.token(\"]\");\n}\n\nexport { ArrayExpression as ArrayPattern };\n\nexport function RecordExpression(this: Printer, node: t.RecordExpression) {\n const props = node.properties;\n\n let startToken;\n let endToken;\n if (process.env.BABEL_8_BREAKING) {\n startToken = \"#{\";\n endToken = \"}\";\n } else {\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"{|\";\n endToken = \"|}\";\n } else if (\n this.format.recordAndTupleSyntaxType !== \"hash\" &&\n this.format.recordAndTupleSyntaxType != null\n ) {\n throw new Error(\n `The \"recordAndTupleSyntaxType\" generator option must be \"bar\" or \"hash\" (${JSON.stringify(\n this.format.recordAndTupleSyntaxType,\n )} received).`,\n );\n } else {\n startToken = \"#{\";\n endToken = \"}\";\n }\n }\n\n this.token(startToken);\n\n if (props.length) {\n this.space();\n this.printList(props, this.shouldPrintTrailingComma(endToken), true, true);\n this.space();\n }\n this.token(endToken);\n}\n\nexport function TupleExpression(this: Printer, node: t.TupleExpression) {\n const elems = node.elements;\n const len = elems.length;\n\n let startToken;\n let endToken;\n if (process.env.BABEL_8_BREAKING) {\n startToken = \"#[\";\n endToken = \"]\";\n } else {\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"[|\";\n endToken = \"|]\";\n } else if (this.format.recordAndTupleSyntaxType === \"hash\") {\n startToken = \"#[\";\n endToken = \"]\";\n } else {\n throw new Error(\n `${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`,\n );\n }\n }\n\n this.token(startToken);\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);\n if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) {\n this.token(\",\", false, i);\n }\n }\n }\n\n this.token(endToken);\n}\n\nexport function RegExpLiteral(this: Printer, node: t.RegExpLiteral) {\n this.word(`/${node.pattern}/${node.flags}`);\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([\"^^\", \"@@\", \"^\", \"%\", \"#\"]);\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAA0B;EAFjBE,mBAAmB;EAAEC;AAAY,IAAAJ,EAAA;AAI1C,IAAIK,gBAAqC,GAAG,IAAI;AAChD,IAAIC,kBAA0B,GAAG,EAAE;AAC5B,SAASC,iBAAiBA,CAAgBC,IAAkB,EAAE;EACnE,IAAIA,IAAI,KAAKH,gBAAgB,EAAE,OAAOC,kBAAkB;EACxDD,gBAAgB,GAAGG,IAAI;EAEvB,MAAM;IAAEC;EAAK,CAAC,GAAGD,IAAI;EACrB,MAAME,KAAK,GAAG,IAAI,CAACC,QAAQ,CAACC,IAAI,CAACJ,IAAI,EAAEK,GAAG,IAAIA,GAAG,CAACC,KAAK,KAAKL,IAAI,CAAC;EACjE,IAAIC,KAAK,EAAE;IACTJ,kBAAkB,GAAG,IAAI,CAACS,aAAa,CAACC,KAAK,CAACN,KAAK,CAACO,KAAK,EAAEP,KAAK,CAACQ,GAAG,CAAC;IACrE,OAAOZ,kBAAkB;EAC3B;EACA,OAAQA,kBAAkB,GAAGE,IAAI,CAACC,IAAI;AACxC;AAEO,SAASU,UAAUA,CAAgBX,IAAkB,EAAE;EAAA,IAAAY,SAAA;EAC5D,IAAI,CAACC,oBAAoB,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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.TSSatisfiesExpression = exports.TSAsExpression = TSTypeExpression;
|
| 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.TSStringKeyword = TSStringKeyword;
|
| 53 |
+
exports.TSSymbolKeyword = TSSymbolKeyword;
|
| 54 |
+
exports.TSTemplateLiteralType = TSTemplateLiteralType;
|
| 55 |
+
exports.TSThisType = TSThisType;
|
| 56 |
+
exports.TSTupleType = TSTupleType;
|
| 57 |
+
exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
|
| 58 |
+
exports.TSTypeAnnotation = TSTypeAnnotation;
|
| 59 |
+
exports.TSTypeAssertion = TSTypeAssertion;
|
| 60 |
+
exports.TSTypeLiteral = TSTypeLiteral;
|
| 61 |
+
exports.TSTypeOperator = TSTypeOperator;
|
| 62 |
+
exports.TSTypeParameter = TSTypeParameter;
|
| 63 |
+
exports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
|
| 64 |
+
exports.TSTypePredicate = TSTypePredicate;
|
| 65 |
+
exports.TSTypeQuery = TSTypeQuery;
|
| 66 |
+
exports.TSTypeReference = TSTypeReference;
|
| 67 |
+
exports.TSUndefinedKeyword = TSUndefinedKeyword;
|
| 68 |
+
exports.TSUnionType = TSUnionType;
|
| 69 |
+
exports.TSUnknownKeyword = TSUnknownKeyword;
|
| 70 |
+
exports.TSVoidKeyword = TSVoidKeyword;
|
| 71 |
+
exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers;
|
| 72 |
+
exports.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType;
|
| 73 |
+
exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
|
| 74 |
+
exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase;
|
| 75 |
+
function TSTypeAnnotation(node, parent) {
|
| 76 |
+
this.token((parent.type === "TSFunctionType" || parent.type === "TSConstructorType") && parent.typeAnnotation === node ? "=>" : ":");
|
| 77 |
+
this.space();
|
| 78 |
+
if (node.optional) this.tokenChar(63);
|
| 79 |
+
this.print(node.typeAnnotation);
|
| 80 |
+
}
|
| 81 |
+
function TSTypeParameterInstantiation(node, parent) {
|
| 82 |
+
this.tokenChar(60);
|
| 83 |
+
let printTrailingSeparator = parent.type === "ArrowFunctionExpression" && node.params.length === 1;
|
| 84 |
+
if (this.tokenMap && node.start != null && node.end != null) {
|
| 85 |
+
printTrailingSeparator && (printTrailingSeparator = !!this.tokenMap.find(node, t => this.tokenMap.matchesOriginal(t, ",")));
|
| 86 |
+
printTrailingSeparator || (printTrailingSeparator = this.shouldPrintTrailingComma(">"));
|
| 87 |
+
}
|
| 88 |
+
this.printList(node.params, printTrailingSeparator);
|
| 89 |
+
this.tokenChar(62);
|
| 90 |
+
}
|
| 91 |
+
function TSTypeParameter(node) {
|
| 92 |
+
if (node.const) {
|
| 93 |
+
this.word("const");
|
| 94 |
+
this.space();
|
| 95 |
+
}
|
| 96 |
+
if (node.in) {
|
| 97 |
+
this.word("in");
|
| 98 |
+
this.space();
|
| 99 |
+
}
|
| 100 |
+
if (node.out) {
|
| 101 |
+
this.word("out");
|
| 102 |
+
this.space();
|
| 103 |
+
}
|
| 104 |
+
this.word(node.name);
|
| 105 |
+
if (node.constraint) {
|
| 106 |
+
this.space();
|
| 107 |
+
this.word("extends");
|
| 108 |
+
this.space();
|
| 109 |
+
this.print(node.constraint);
|
| 110 |
+
}
|
| 111 |
+
if (node.default) {
|
| 112 |
+
this.space();
|
| 113 |
+
this.tokenChar(61);
|
| 114 |
+
this.space();
|
| 115 |
+
this.print(node.default);
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
+
function TSParameterProperty(node) {
|
| 119 |
+
if (node.accessibility) {
|
| 120 |
+
this.word(node.accessibility);
|
| 121 |
+
this.space();
|
| 122 |
+
}
|
| 123 |
+
if (node.readonly) {
|
| 124 |
+
this.word("readonly");
|
| 125 |
+
this.space();
|
| 126 |
+
}
|
| 127 |
+
this._param(node.parameter);
|
| 128 |
+
}
|
| 129 |
+
function TSDeclareFunction(node, parent) {
|
| 130 |
+
if (node.declare) {
|
| 131 |
+
this.word("declare");
|
| 132 |
+
this.space();
|
| 133 |
+
}
|
| 134 |
+
this._functionHead(node, parent);
|
| 135 |
+
this.semicolon();
|
| 136 |
+
}
|
| 137 |
+
function TSDeclareMethod(node) {
|
| 138 |
+
this._classMethodHead(node);
|
| 139 |
+
this.semicolon();
|
| 140 |
+
}
|
| 141 |
+
function TSQualifiedName(node) {
|
| 142 |
+
this.print(node.left);
|
| 143 |
+
this.tokenChar(46);
|
| 144 |
+
this.print(node.right);
|
| 145 |
+
}
|
| 146 |
+
function TSCallSignatureDeclaration(node) {
|
| 147 |
+
this.tsPrintSignatureDeclarationBase(node);
|
| 148 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 149 |
+
}
|
| 150 |
+
function maybePrintTrailingCommaOrSemicolon(printer, node) {
|
| 151 |
+
if (!printer.tokenMap || !node.start || !node.end) {
|
| 152 |
+
printer.semicolon();
|
| 153 |
+
return;
|
| 154 |
+
}
|
| 155 |
+
if (printer.tokenMap.endMatches(node, ",")) {
|
| 156 |
+
printer.token(",");
|
| 157 |
+
} else if (printer.tokenMap.endMatches(node, ";")) {
|
| 158 |
+
printer.semicolon();
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
+
function TSConstructSignatureDeclaration(node) {
|
| 162 |
+
this.word("new");
|
| 163 |
+
this.space();
|
| 164 |
+
this.tsPrintSignatureDeclarationBase(node);
|
| 165 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 166 |
+
}
|
| 167 |
+
function TSPropertySignature(node) {
|
| 168 |
+
const {
|
| 169 |
+
readonly
|
| 170 |
+
} = node;
|
| 171 |
+
if (readonly) {
|
| 172 |
+
this.word("readonly");
|
| 173 |
+
this.space();
|
| 174 |
+
}
|
| 175 |
+
this.tsPrintPropertyOrMethodName(node);
|
| 176 |
+
this.print(node.typeAnnotation);
|
| 177 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 178 |
+
}
|
| 179 |
+
function tsPrintPropertyOrMethodName(node) {
|
| 180 |
+
if (node.computed) {
|
| 181 |
+
this.tokenChar(91);
|
| 182 |
+
}
|
| 183 |
+
this.print(node.key);
|
| 184 |
+
if (node.computed) {
|
| 185 |
+
this.tokenChar(93);
|
| 186 |
+
}
|
| 187 |
+
if (node.optional) {
|
| 188 |
+
this.tokenChar(63);
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
function TSMethodSignature(node) {
|
| 192 |
+
const {
|
| 193 |
+
kind
|
| 194 |
+
} = node;
|
| 195 |
+
if (kind === "set" || kind === "get") {
|
| 196 |
+
this.word(kind);
|
| 197 |
+
this.space();
|
| 198 |
+
}
|
| 199 |
+
this.tsPrintPropertyOrMethodName(node);
|
| 200 |
+
this.tsPrintSignatureDeclarationBase(node);
|
| 201 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 202 |
+
}
|
| 203 |
+
function TSIndexSignature(node) {
|
| 204 |
+
const {
|
| 205 |
+
readonly,
|
| 206 |
+
static: isStatic
|
| 207 |
+
} = node;
|
| 208 |
+
if (isStatic) {
|
| 209 |
+
this.word("static");
|
| 210 |
+
this.space();
|
| 211 |
+
}
|
| 212 |
+
if (readonly) {
|
| 213 |
+
this.word("readonly");
|
| 214 |
+
this.space();
|
| 215 |
+
}
|
| 216 |
+
this.tokenChar(91);
|
| 217 |
+
this._parameters(node.parameters, "]");
|
| 218 |
+
this.print(node.typeAnnotation);
|
| 219 |
+
maybePrintTrailingCommaOrSemicolon(this, node);
|
| 220 |
+
}
|
| 221 |
+
function TSAnyKeyword() {
|
| 222 |
+
this.word("any");
|
| 223 |
+
}
|
| 224 |
+
function TSBigIntKeyword() {
|
| 225 |
+
this.word("bigint");
|
| 226 |
+
}
|
| 227 |
+
function TSUnknownKeyword() {
|
| 228 |
+
this.word("unknown");
|
| 229 |
+
}
|
| 230 |
+
function TSNumberKeyword() {
|
| 231 |
+
this.word("number");
|
| 232 |
+
}
|
| 233 |
+
function TSObjectKeyword() {
|
| 234 |
+
this.word("object");
|
| 235 |
+
}
|
| 236 |
+
function TSBooleanKeyword() {
|
| 237 |
+
this.word("boolean");
|
| 238 |
+
}
|
| 239 |
+
function TSStringKeyword() {
|
| 240 |
+
this.word("string");
|
| 241 |
+
}
|
| 242 |
+
function TSSymbolKeyword() {
|
| 243 |
+
this.word("symbol");
|
| 244 |
+
}
|
| 245 |
+
function TSVoidKeyword() {
|
| 246 |
+
this.word("void");
|
| 247 |
+
}
|
| 248 |
+
function TSUndefinedKeyword() {
|
| 249 |
+
this.word("undefined");
|
| 250 |
+
}
|
| 251 |
+
function TSNullKeyword() {
|
| 252 |
+
this.word("null");
|
| 253 |
+
}
|
| 254 |
+
function TSNeverKeyword() {
|
| 255 |
+
this.word("never");
|
| 256 |
+
}
|
| 257 |
+
function TSIntrinsicKeyword() {
|
| 258 |
+
this.word("intrinsic");
|
| 259 |
+
}
|
| 260 |
+
function TSThisType() {
|
| 261 |
+
this.word("this");
|
| 262 |
+
}
|
| 263 |
+
function TSFunctionType(node) {
|
| 264 |
+
this.tsPrintFunctionOrConstructorType(node);
|
| 265 |
+
}
|
| 266 |
+
function TSConstructorType(node) {
|
| 267 |
+
if (node.abstract) {
|
| 268 |
+
this.word("abstract");
|
| 269 |
+
this.space();
|
| 270 |
+
}
|
| 271 |
+
this.word("new");
|
| 272 |
+
this.space();
|
| 273 |
+
this.tsPrintFunctionOrConstructorType(node);
|
| 274 |
+
}
|
| 275 |
+
function tsPrintFunctionOrConstructorType(node) {
|
| 276 |
+
const {
|
| 277 |
+
typeParameters
|
| 278 |
+
} = node;
|
| 279 |
+
const parameters = node.parameters;
|
| 280 |
+
this.print(typeParameters);
|
| 281 |
+
this.tokenChar(40);
|
| 282 |
+
this._parameters(parameters, ")");
|
| 283 |
+
this.space();
|
| 284 |
+
const returnType = node.typeAnnotation;
|
| 285 |
+
this.print(returnType);
|
| 286 |
+
}
|
| 287 |
+
function TSTypeReference(node) {
|
| 288 |
+
const typeArguments = node.typeParameters;
|
| 289 |
+
this.print(node.typeName, !!typeArguments);
|
| 290 |
+
this.print(typeArguments);
|
| 291 |
+
}
|
| 292 |
+
function TSTypePredicate(node) {
|
| 293 |
+
if (node.asserts) {
|
| 294 |
+
this.word("asserts");
|
| 295 |
+
this.space();
|
| 296 |
+
}
|
| 297 |
+
this.print(node.parameterName);
|
| 298 |
+
if (node.typeAnnotation) {
|
| 299 |
+
this.space();
|
| 300 |
+
this.word("is");
|
| 301 |
+
this.space();
|
| 302 |
+
this.print(node.typeAnnotation.typeAnnotation);
|
| 303 |
+
}
|
| 304 |
+
}
|
| 305 |
+
function TSTypeQuery(node) {
|
| 306 |
+
this.word("typeof");
|
| 307 |
+
this.space();
|
| 308 |
+
this.print(node.exprName);
|
| 309 |
+
const typeArguments = node.typeParameters;
|
| 310 |
+
if (typeArguments) {
|
| 311 |
+
this.print(typeArguments);
|
| 312 |
+
}
|
| 313 |
+
}
|
| 314 |
+
function TSTypeLiteral(node) {
|
| 315 |
+
printBraced(this, node, () => this.printJoin(node.members, true, true));
|
| 316 |
+
}
|
| 317 |
+
function TSArrayType(node) {
|
| 318 |
+
this.print(node.elementType, true);
|
| 319 |
+
this.tokenChar(91);
|
| 320 |
+
this.tokenChar(93);
|
| 321 |
+
}
|
| 322 |
+
function TSTupleType(node) {
|
| 323 |
+
this.tokenChar(91);
|
| 324 |
+
this.printList(node.elementTypes, this.shouldPrintTrailingComma("]"));
|
| 325 |
+
this.tokenChar(93);
|
| 326 |
+
}
|
| 327 |
+
function TSOptionalType(node) {
|
| 328 |
+
this.print(node.typeAnnotation);
|
| 329 |
+
this.tokenChar(63);
|
| 330 |
+
}
|
| 331 |
+
function TSRestType(node) {
|
| 332 |
+
this.token("...");
|
| 333 |
+
this.print(node.typeAnnotation);
|
| 334 |
+
}
|
| 335 |
+
function TSNamedTupleMember(node) {
|
| 336 |
+
this.print(node.label);
|
| 337 |
+
if (node.optional) this.tokenChar(63);
|
| 338 |
+
this.tokenChar(58);
|
| 339 |
+
this.space();
|
| 340 |
+
this.print(node.elementType);
|
| 341 |
+
}
|
| 342 |
+
function TSUnionType(node) {
|
| 343 |
+
tsPrintUnionOrIntersectionType(this, node, "|");
|
| 344 |
+
}
|
| 345 |
+
function TSIntersectionType(node) {
|
| 346 |
+
tsPrintUnionOrIntersectionType(this, node, "&");
|
| 347 |
+
}
|
| 348 |
+
function tsPrintUnionOrIntersectionType(printer, node, sep) {
|
| 349 |
+
var _printer$tokenMap;
|
| 350 |
+
let hasLeadingToken = 0;
|
| 351 |
+
if ((_printer$tokenMap = printer.tokenMap) != null && _printer$tokenMap.startMatches(node, sep)) {
|
| 352 |
+
hasLeadingToken = 1;
|
| 353 |
+
printer.token(sep);
|
| 354 |
+
}
|
| 355 |
+
printer.printJoin(node.types, undefined, undefined, function (i) {
|
| 356 |
+
this.space();
|
| 357 |
+
this.token(sep, null, i + hasLeadingToken);
|
| 358 |
+
this.space();
|
| 359 |
+
});
|
| 360 |
+
}
|
| 361 |
+
function TSConditionalType(node) {
|
| 362 |
+
this.print(node.checkType);
|
| 363 |
+
this.space();
|
| 364 |
+
this.word("extends");
|
| 365 |
+
this.space();
|
| 366 |
+
this.print(node.extendsType);
|
| 367 |
+
this.space();
|
| 368 |
+
this.tokenChar(63);
|
| 369 |
+
this.space();
|
| 370 |
+
this.print(node.trueType);
|
| 371 |
+
this.space();
|
| 372 |
+
this.tokenChar(58);
|
| 373 |
+
this.space();
|
| 374 |
+
this.print(node.falseType);
|
| 375 |
+
}
|
| 376 |
+
function TSInferType(node) {
|
| 377 |
+
this.word("infer");
|
| 378 |
+
this.print(node.typeParameter);
|
| 379 |
+
}
|
| 380 |
+
function TSParenthesizedType(node) {
|
| 381 |
+
this.tokenChar(40);
|
| 382 |
+
this.print(node.typeAnnotation);
|
| 383 |
+
this.tokenChar(41);
|
| 384 |
+
}
|
| 385 |
+
function TSTypeOperator(node) {
|
| 386 |
+
this.word(node.operator);
|
| 387 |
+
this.space();
|
| 388 |
+
this.print(node.typeAnnotation);
|
| 389 |
+
}
|
| 390 |
+
function TSIndexedAccessType(node) {
|
| 391 |
+
this.print(node.objectType, true);
|
| 392 |
+
this.tokenChar(91);
|
| 393 |
+
this.print(node.indexType);
|
| 394 |
+
this.tokenChar(93);
|
| 395 |
+
}
|
| 396 |
+
function TSMappedType(node) {
|
| 397 |
+
const {
|
| 398 |
+
nameType,
|
| 399 |
+
optional,
|
| 400 |
+
readonly,
|
| 401 |
+
typeAnnotation
|
| 402 |
+
} = node;
|
| 403 |
+
this.tokenChar(123);
|
| 404 |
+
const exit = this.enterDelimited();
|
| 405 |
+
this.space();
|
| 406 |
+
if (readonly) {
|
| 407 |
+
tokenIfPlusMinus(this, readonly);
|
| 408 |
+
this.word("readonly");
|
| 409 |
+
this.space();
|
| 410 |
+
}
|
| 411 |
+
this.tokenChar(91);
|
| 412 |
+
{
|
| 413 |
+
this.word(node.typeParameter.name);
|
| 414 |
+
}
|
| 415 |
+
this.space();
|
| 416 |
+
this.word("in");
|
| 417 |
+
this.space();
|
| 418 |
+
{
|
| 419 |
+
this.print(node.typeParameter.constraint);
|
| 420 |
+
}
|
| 421 |
+
if (nameType) {
|
| 422 |
+
this.space();
|
| 423 |
+
this.word("as");
|
| 424 |
+
this.space();
|
| 425 |
+
this.print(nameType);
|
| 426 |
+
}
|
| 427 |
+
this.tokenChar(93);
|
| 428 |
+
if (optional) {
|
| 429 |
+
tokenIfPlusMinus(this, optional);
|
| 430 |
+
this.tokenChar(63);
|
| 431 |
+
}
|
| 432 |
+
if (typeAnnotation) {
|
| 433 |
+
this.tokenChar(58);
|
| 434 |
+
this.space();
|
| 435 |
+
this.print(typeAnnotation);
|
| 436 |
+
}
|
| 437 |
+
this.space();
|
| 438 |
+
exit();
|
| 439 |
+
this.tokenChar(125);
|
| 440 |
+
}
|
| 441 |
+
function tokenIfPlusMinus(self, tok) {
|
| 442 |
+
if (tok !== true) {
|
| 443 |
+
self.token(tok);
|
| 444 |
+
}
|
| 445 |
+
}
|
| 446 |
+
function TSTemplateLiteralType(node) {
|
| 447 |
+
this._printTemplate(node, node.types);
|
| 448 |
+
}
|
| 449 |
+
function TSLiteralType(node) {
|
| 450 |
+
this.print(node.literal);
|
| 451 |
+
}
|
| 452 |
+
function TSClassImplements(node) {
|
| 453 |
+
this.print(node.expression);
|
| 454 |
+
this.print(node.typeArguments);
|
| 455 |
+
}
|
| 456 |
+
function TSInterfaceDeclaration(node) {
|
| 457 |
+
const {
|
| 458 |
+
declare,
|
| 459 |
+
id,
|
| 460 |
+
typeParameters,
|
| 461 |
+
extends: extendz,
|
| 462 |
+
body
|
| 463 |
+
} = node;
|
| 464 |
+
if (declare) {
|
| 465 |
+
this.word("declare");
|
| 466 |
+
this.space();
|
| 467 |
+
}
|
| 468 |
+
this.word("interface");
|
| 469 |
+
this.space();
|
| 470 |
+
this.print(id);
|
| 471 |
+
this.print(typeParameters);
|
| 472 |
+
if (extendz != null && extendz.length) {
|
| 473 |
+
this.space();
|
| 474 |
+
this.word("extends");
|
| 475 |
+
this.space();
|
| 476 |
+
this.printList(extendz);
|
| 477 |
+
}
|
| 478 |
+
this.space();
|
| 479 |
+
this.print(body);
|
| 480 |
+
}
|
| 481 |
+
function TSInterfaceBody(node) {
|
| 482 |
+
printBraced(this, node, () => this.printJoin(node.body, true, true));
|
| 483 |
+
}
|
| 484 |
+
function TSTypeAliasDeclaration(node) {
|
| 485 |
+
const {
|
| 486 |
+
declare,
|
| 487 |
+
id,
|
| 488 |
+
typeParameters,
|
| 489 |
+
typeAnnotation
|
| 490 |
+
} = node;
|
| 491 |
+
if (declare) {
|
| 492 |
+
this.word("declare");
|
| 493 |
+
this.space();
|
| 494 |
+
}
|
| 495 |
+
this.word("type");
|
| 496 |
+
this.space();
|
| 497 |
+
this.print(id);
|
| 498 |
+
this.print(typeParameters);
|
| 499 |
+
this.space();
|
| 500 |
+
this.tokenChar(61);
|
| 501 |
+
this.space();
|
| 502 |
+
this.print(typeAnnotation);
|
| 503 |
+
this.semicolon();
|
| 504 |
+
}
|
| 505 |
+
function TSTypeExpression(node) {
|
| 506 |
+
const {
|
| 507 |
+
type,
|
| 508 |
+
expression,
|
| 509 |
+
typeAnnotation
|
| 510 |
+
} = node;
|
| 511 |
+
this.print(expression, true);
|
| 512 |
+
this.space();
|
| 513 |
+
this.word(type === "TSAsExpression" ? "as" : "satisfies");
|
| 514 |
+
this.space();
|
| 515 |
+
this.print(typeAnnotation);
|
| 516 |
+
}
|
| 517 |
+
function TSTypeAssertion(node) {
|
| 518 |
+
const {
|
| 519 |
+
typeAnnotation,
|
| 520 |
+
expression
|
| 521 |
+
} = node;
|
| 522 |
+
this.tokenChar(60);
|
| 523 |
+
this.print(typeAnnotation);
|
| 524 |
+
this.tokenChar(62);
|
| 525 |
+
this.space();
|
| 526 |
+
this.print(expression);
|
| 527 |
+
}
|
| 528 |
+
function TSInstantiationExpression(node) {
|
| 529 |
+
this.print(node.expression);
|
| 530 |
+
{
|
| 531 |
+
this.print(node.typeParameters);
|
| 532 |
+
}
|
| 533 |
+
}
|
| 534 |
+
function TSEnumDeclaration(node) {
|
| 535 |
+
const {
|
| 536 |
+
declare,
|
| 537 |
+
const: isConst,
|
| 538 |
+
id
|
| 539 |
+
} = node;
|
| 540 |
+
if (declare) {
|
| 541 |
+
this.word("declare");
|
| 542 |
+
this.space();
|
| 543 |
+
}
|
| 544 |
+
if (isConst) {
|
| 545 |
+
this.word("const");
|
| 546 |
+
this.space();
|
| 547 |
+
}
|
| 548 |
+
this.word("enum");
|
| 549 |
+
this.space();
|
| 550 |
+
this.print(id);
|
| 551 |
+
this.space();
|
| 552 |
+
{
|
| 553 |
+
TSEnumBody.call(this, node);
|
| 554 |
+
}
|
| 555 |
+
}
|
| 556 |
+
function TSEnumBody(node) {
|
| 557 |
+
printBraced(this, node, () => {
|
| 558 |
+
var _this$shouldPrintTrai;
|
| 559 |
+
return this.printList(node.members, (_this$shouldPrintTrai = this.shouldPrintTrailingComma("}")) != null ? _this$shouldPrintTrai : true, true, true);
|
| 560 |
+
});
|
| 561 |
+
}
|
| 562 |
+
function TSEnumMember(node) {
|
| 563 |
+
const {
|
| 564 |
+
id,
|
| 565 |
+
initializer
|
| 566 |
+
} = node;
|
| 567 |
+
this.print(id);
|
| 568 |
+
if (initializer) {
|
| 569 |
+
this.space();
|
| 570 |
+
this.tokenChar(61);
|
| 571 |
+
this.space();
|
| 572 |
+
this.print(initializer);
|
| 573 |
+
}
|
| 574 |
+
}
|
| 575 |
+
function TSModuleDeclaration(node) {
|
| 576 |
+
const {
|
| 577 |
+
declare,
|
| 578 |
+
id,
|
| 579 |
+
kind
|
| 580 |
+
} = node;
|
| 581 |
+
if (declare) {
|
| 582 |
+
this.word("declare");
|
| 583 |
+
this.space();
|
| 584 |
+
}
|
| 585 |
+
{
|
| 586 |
+
if (!node.global) {
|
| 587 |
+
this.word(kind != null ? kind : id.type === "Identifier" ? "namespace" : "module");
|
| 588 |
+
this.space();
|
| 589 |
+
}
|
| 590 |
+
this.print(id);
|
| 591 |
+
if (!node.body) {
|
| 592 |
+
this.semicolon();
|
| 593 |
+
return;
|
| 594 |
+
}
|
| 595 |
+
let body = node.body;
|
| 596 |
+
while (body.type === "TSModuleDeclaration") {
|
| 597 |
+
this.tokenChar(46);
|
| 598 |
+
this.print(body.id);
|
| 599 |
+
body = body.body;
|
| 600 |
+
}
|
| 601 |
+
this.space();
|
| 602 |
+
this.print(body);
|
| 603 |
+
}
|
| 604 |
+
}
|
| 605 |
+
function TSModuleBlock(node) {
|
| 606 |
+
printBraced(this, node, () => this.printSequence(node.body, true));
|
| 607 |
+
}
|
| 608 |
+
function TSImportType(node) {
|
| 609 |
+
const {
|
| 610 |
+
argument,
|
| 611 |
+
qualifier,
|
| 612 |
+
options
|
| 613 |
+
} = node;
|
| 614 |
+
this.word("import");
|
| 615 |
+
this.tokenChar(40);
|
| 616 |
+
this.print(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 |
+
}
|
| 658 |
+
function TSExportAssignment(node) {
|
| 659 |
+
this.word("export");
|
| 660 |
+
this.space();
|
| 661 |
+
this.tokenChar(61);
|
| 662 |
+
this.space();
|
| 663 |
+
this.print(node.expression);
|
| 664 |
+
this.semicolon();
|
| 665 |
+
}
|
| 666 |
+
function TSNamespaceExportDeclaration(node) {
|
| 667 |
+
this.word("export");
|
| 668 |
+
this.space();
|
| 669 |
+
this.word("as");
|
| 670 |
+
this.space();
|
| 671 |
+
this.word("namespace");
|
| 672 |
+
this.space();
|
| 673 |
+
this.print(node.id);
|
| 674 |
+
this.semicolon();
|
| 675 |
+
}
|
| 676 |
+
function tsPrintSignatureDeclarationBase(node) {
|
| 677 |
+
const {
|
| 678 |
+
typeParameters
|
| 679 |
+
} = node;
|
| 680 |
+
const parameters = node.parameters;
|
| 681 |
+
this.print(typeParameters);
|
| 682 |
+
this.tokenChar(40);
|
| 683 |
+
this._parameters(parameters, ")");
|
| 684 |
+
const returnType = node.typeAnnotation;
|
| 685 |
+
this.print(returnType);
|
| 686 |
+
}
|
| 687 |
+
function tsPrintClassMemberModifiers(node) {
|
| 688 |
+
const isPrivateField = node.type === "ClassPrivateProperty";
|
| 689 |
+
const isPublicField = node.type === "ClassAccessorProperty" || node.type === "ClassProperty";
|
| 690 |
+
printModifiersList(this, node, [isPublicField && node.declare && "declare", !isPrivateField && node.accessibility]);
|
| 691 |
+
if (node.static) {
|
| 692 |
+
this.word("static");
|
| 693 |
+
this.space();
|
| 694 |
+
}
|
| 695 |
+
printModifiersList(this, node, [!isPrivateField && node.abstract && "abstract", !isPrivateField && node.override && "override", (isPublicField || isPrivateField) && node.readonly && "readonly"]);
|
| 696 |
+
}
|
| 697 |
+
function printBraced(printer, node, cb) {
|
| 698 |
+
printer.token("{");
|
| 699 |
+
const exit = printer.enterDelimited();
|
| 700 |
+
cb();
|
| 701 |
+
exit();
|
| 702 |
+
printer.rightBrace(node);
|
| 703 |
+
}
|
| 704 |
+
function printModifiersList(printer, node, modifiers) {
|
| 705 |
+
var _printer$tokenMap2;
|
| 706 |
+
const modifiersSet = new Set();
|
| 707 |
+
for (const modifier of modifiers) {
|
| 708 |
+
if (modifier) modifiersSet.add(modifier);
|
| 709 |
+
}
|
| 710 |
+
(_printer$tokenMap2 = printer.tokenMap) == null || _printer$tokenMap2.find(node, tok => {
|
| 711 |
+
if (modifiersSet.has(tok.value)) {
|
| 712 |
+
printer.token(tok.value);
|
| 713 |
+
printer.space();
|
| 714 |
+
modifiersSet.delete(tok.value);
|
| 715 |
+
return modifiersSet.size === 0;
|
| 716 |
+
}
|
| 717 |
+
});
|
| 718 |
+
for (const modifier of modifiersSet) {
|
| 719 |
+
printer.word(modifier);
|
| 720 |
+
printer.space();
|
| 721 |
+
}
|
| 722 |
+
}
|
| 723 |
+
|
| 724 |
+
//# sourceMappingURL=typescript.js.map
|
ui/node_modules/@babel/generator/lib/generators/typescript.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["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","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","TSArrayType","elementType","TSTupleType","elementTypes","TSOptionalType","TSRestType","TSNamedTupleMember","label","TSUnionType","tsPrintUnionOrIntersectionType","TSIntersectionType","sep","_printer$tokenMap","hasLeadingToken","startMatches","types","undefined","i","TSConditionalType","checkType","extendsType","trueType","falseType","TSInferType","typeParameter","TSParenthesizedType","TSTypeOperator","operator","TSIndexedAccessType","objectType","indexType","TSMappedType","nameType","exit","enterDelimited","tokenIfPlusMinus","self","tok","TSTemplateLiteralType","_printTemplate","TSLiteralType","literal","TSClassImplements","expression","TSInterfaceDeclaration","id","extends","extendz","body","TSInterfaceBody","TSTypeAliasDeclaration","TSTypeExpression","TSTypeAssertion","TSInstantiationExpression","TSEnumDeclaration","isConst","TSEnumBody","call","_this$shouldPrintTrai","TSEnumMember","initializer","TSModuleDeclaration","global","TSModuleBlock","printSequence","TSImportType","argument","qualifier","options","TSImportEqualsDeclaration","moduleReference","isExport","TSExternalModuleReference","TSNonNullExpression","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\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 =\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 // Preseve 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 this._param(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 this._functionHead(node, parent);\n this.semicolon();\n}\n\nexport function TSDeclareMethod(this: Printer, node: t.TSDeclareMethod) {\n this._classMethodHead(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 this.tsPrintSignatureDeclarationBase(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 this.tsPrintSignatureDeclarationBase(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 this.tsPrintPropertyOrMethodName(node);\n this.print(node.typeAnnotation);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nexport function 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 this.tsPrintPropertyOrMethodName(node);\n this.tsPrintSignatureDeclarationBase(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 this._parameters(node.parameters, \"]\");\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 this.tsPrintFunctionOrConstructorType(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 this.tsPrintFunctionOrConstructorType(node);\n}\n\nexport function 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 this._parameters(parameters, \")\");\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, () => this.printJoin(node.members, true, true));\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, null, 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 exit = 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);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n this.print(node.typeParameter.constraint);\n }\n\n if (nameType) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(nameType);\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);\n }\n this.space();\n exit();\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 this._printTemplate(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, () => this.printJoin(node.body, true, true));\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\nfunction TSTypeExpression(\n this: Printer,\n node: t.TSAsExpression | t.TSSatisfiesExpression,\n) {\n const { type, expression, typeAnnotation } = node;\n this.print(expression, true);\n this.space();\n this.word(type === \"TSAsExpression\" ? \"as\" : \"satisfies\");\n this.space();\n this.print(typeAnnotation);\n}\n\nexport {\n TSTypeExpression as TSAsExpression,\n TSTypeExpression as TSSatisfiesExpression,\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 ),\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));\n}\n\nexport function TSImportType(this: Printer, node: t.TSImportType) {\n const { argument, qualifier, options } = node;\n this.word(\"import\");\n this.token(\"(\");\n this.print(argument);\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}\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\nexport function 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 this._parameters(parameters, \")\");\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 exit = printer.enterDelimited();\n cb();\n exit();\n printer.rightBrace(node);\n}\n\nfunction printModifiersList(\n printer: Printer,\n node: t.Node,\n modifiers: (string | false | null)[],\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 });\n\n for (const modifier of modifiersSet) {\n printer.word(modifier);\n printer.space();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAASA,gBAAgBA,CAE9BC,IAAwB,EACxBC,MAAc,EACd;EAGA,IAAI,CAACC,KAAK,CACR,CAACD,MAAM,CAACE,IAAI,KAAK,gBAAgB,IAAIF,MAAM,CAACE,IAAI,KAAK,mBAAmB,KAKlEF,MAAM,CAACG,cAAc,KAAMJ,IAAI,GACjC,IAAI,GACJ,GACN,CAAC;EACD,IAAI,CAACK,KAAK,CAAC,CAAC;EAEZ,IAAIL,IAAI,CAACM,QAAQ,EAAE,IAAI,CAAC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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 |
+
if (opts.experimental_preserveFormat) {
|
| 12 |
+
if (typeof code !== "string") {
|
| 13 |
+
throw new Error("`experimental_preserveFormat` requires the original `code` to be passed to @babel/generator as a string");
|
| 14 |
+
}
|
| 15 |
+
if (!opts.retainLines) {
|
| 16 |
+
throw new Error("`experimental_preserveFormat` requires `retainLines` to be set to `true`");
|
| 17 |
+
}
|
| 18 |
+
if (opts.compact && opts.compact !== "auto") {
|
| 19 |
+
throw new Error("`experimental_preserveFormat` is not compatible with the `compact` option");
|
| 20 |
+
}
|
| 21 |
+
if (opts.minified) {
|
| 22 |
+
throw new Error("`experimental_preserveFormat` is not compatible with the `minified` option");
|
| 23 |
+
}
|
| 24 |
+
if (opts.jsescOption) {
|
| 25 |
+
throw new Error("`experimental_preserveFormat` is not compatible with the `jsescOption` option");
|
| 26 |
+
}
|
| 27 |
+
if (!Array.isArray(ast.tokens)) {
|
| 28 |
+
throw new Error("`experimental_preserveFormat` requires the AST to have attatched the token of the input code. Make sure to enable the `tokens: true` parser option.");
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
const format = {
|
| 32 |
+
auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
|
| 33 |
+
auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
|
| 34 |
+
shouldPrintComment: opts.shouldPrintComment,
|
| 35 |
+
preserveFormat: opts.experimental_preserveFormat,
|
| 36 |
+
retainLines: opts.retainLines,
|
| 37 |
+
retainFunctionParens: opts.retainFunctionParens,
|
| 38 |
+
comments: opts.comments == null || opts.comments,
|
| 39 |
+
compact: opts.compact,
|
| 40 |
+
minified: opts.minified,
|
| 41 |
+
concise: opts.concise,
|
| 42 |
+
indent: {
|
| 43 |
+
adjustMultilineComment: true,
|
| 44 |
+
style: " "
|
| 45 |
+
},
|
| 46 |
+
jsescOption: Object.assign({
|
| 47 |
+
quotes: "double",
|
| 48 |
+
wrap: true,
|
| 49 |
+
minimal: false
|
| 50 |
+
}, opts.jsescOption),
|
| 51 |
+
topicToken: opts.topicToken,
|
| 52 |
+
importAttributesKeyword: opts.importAttributesKeyword
|
| 53 |
+
};
|
| 54 |
+
{
|
| 55 |
+
var _opts$recordAndTupleS;
|
| 56 |
+
format.decoratorsBeforeExport = opts.decoratorsBeforeExport;
|
| 57 |
+
format.jsescOption.json = opts.jsonCompatibleStrings;
|
| 58 |
+
format.recordAndTupleSyntaxType = (_opts$recordAndTupleS = opts.recordAndTupleSyntaxType) != null ? _opts$recordAndTupleS : "hash";
|
| 59 |
+
}
|
| 60 |
+
if (format.minified) {
|
| 61 |
+
format.compact = true;
|
| 62 |
+
format.shouldPrintComment = format.shouldPrintComment || (() => format.comments);
|
| 63 |
+
} else {
|
| 64 |
+
format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.includes("@license") || value.includes("@preserve"));
|
| 65 |
+
}
|
| 66 |
+
if (format.compact === "auto") {
|
| 67 |
+
format.compact = typeof code === "string" && code.length > 500000;
|
| 68 |
+
if (format.compact) {
|
| 69 |
+
console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`);
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
if (format.compact || format.preserveFormat) {
|
| 73 |
+
format.indent.adjustMultilineComment = false;
|
| 74 |
+
}
|
| 75 |
+
const {
|
| 76 |
+
auxiliaryCommentBefore,
|
| 77 |
+
auxiliaryCommentAfter,
|
| 78 |
+
shouldPrintComment
|
| 79 |
+
} = format;
|
| 80 |
+
if (auxiliaryCommentBefore && !shouldPrintComment(auxiliaryCommentBefore)) {
|
| 81 |
+
format.auxiliaryCommentBefore = undefined;
|
| 82 |
+
}
|
| 83 |
+
if (auxiliaryCommentAfter && !shouldPrintComment(auxiliaryCommentAfter)) {
|
| 84 |
+
format.auxiliaryCommentAfter = undefined;
|
| 85 |
+
}
|
| 86 |
+
return format;
|
| 87 |
+
}
|
| 88 |
+
{
|
| 89 |
+
exports.CodeGenerator = class CodeGenerator {
|
| 90 |
+
constructor(ast, opts = {}, code) {
|
| 91 |
+
this._ast = void 0;
|
| 92 |
+
this._format = void 0;
|
| 93 |
+
this._map = void 0;
|
| 94 |
+
this._ast = ast;
|
| 95 |
+
this._format = normalizeOptions(code, opts, ast);
|
| 96 |
+
this._map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
|
| 97 |
+
}
|
| 98 |
+
generate() {
|
| 99 |
+
const printer = new _printer.default(this._format, this._map);
|
| 100 |
+
return printer.generate(this._ast);
|
| 101 |
+
}
|
| 102 |
+
};
|
| 103 |
+
}
|
| 104 |
+
function generate(ast, opts = {}, code) {
|
| 105 |
+
const format = normalizeOptions(code, opts, ast);
|
| 106 |
+
const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
|
| 107 |
+
const printer = new _printer.default(format, map, ast.tokens, typeof code === "string" ? code : null);
|
| 108 |
+
return printer.generate(ast);
|
| 109 |
+
}
|
| 110 |
+
var _default = exports.default = generate;
|
| 111 |
+
|
| 112 |
+
//# sourceMappingURL=index.js.map
|
ui/node_modules/@babel/generator/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_sourceMap","require","_printer","normalizeOptions","code","opts","ast","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","importAttributesKeyword","_opts$recordAndTupleS","decoratorsBeforeExport","json","jsonCompatibleStrings","recordAndTupleSyntaxType","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 | { [filename: string]: string },\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 attatched 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 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 importAttributesKeyword: opts.importAttributesKeyword,\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 }\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 */\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 | undefined;\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 | { [filename: 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,UAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAiBA,SAASE,gBAAgBA,CACvBC,IAA6C,EAC7CC,IAAsB,EACtBC,GAAW,EACH;EACR,IAAID,IAAI,CAACE,2BAA2B,EAAE;IACpC,IAAI,OAAOH,IAAI,KAAK,QAAQ,EAAE;MAC5B,MAAM,IAAII,KAAK,CACb,yGACF,CAAC;IACH;IACA,IAAI,CAACH,IAAI,CAACI,WAAW,EAAE;MACrB,MAAM,IAAID,KAAK,CACb,0EACF,CAAC;IACH;IACA,IAAIH,IAAI,CAACK,OAAO,IAAIL,IAAI,CAACK,OAAO,KAAK,MAAM,EAAE;MAC3C,MAAM,IAAIF,KAAK,CACb,2EACF,CAAC;IACH;IACA,IAAIH,IAAI,CAACM,QAAQ,EAAE;MACjB,MAAM,IAAIH,KAAK,CACb,4EACF,CAAC;IACH;IACA,IAAIH,IAAI,CAACO,WAAW,EAAE;MACpB,MAAM,IAAIJ,KAAK,CACb,+EACF,CAAC;IACH;IACA,IAAI,CAACK,KAAK,CAACC,OAAO,CAAER,GAAG,CAASS,MAAM,CAAC,EAAE;MACvC,MAAM,IAAIP,KAAK,CACb,qJACF,CAAC;IACH;EACF;EAEA,MAAMQ,MAAc,GAAG;IACrBC,sBAAsB,EAAEZ,IAAI,CAACY,sBAAsB;IACnDC,qBAAqB,EAAEb,IAAI,CAACa,qBAAqB;IACjDC,kBAAkB,EAAEd,IAAI,CAACc,kBAAkB;IAC3CC,cAAc,EAAEf,IAAI,CAACE,2BAA2B;IAChDE,WAAW,EAAEJ,IAAI,CAACI,WAAW;IAC7BY,oBAAoB,EAAEhB,IAAI,CAACgB,oBAAoB;IAC/CC,QAAQ,EAAEjB,IAAI,CAACiB,QAAQ,IAAI,IAAI,IAAIjB,I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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.needsParens = needsParens;
|
| 9 |
+
exports.needsWhitespace = needsWhitespace;
|
| 10 |
+
exports.needsWhitespaceAfter = needsWhitespaceAfter;
|
| 11 |
+
exports.needsWhitespaceBefore = needsWhitespaceBefore;
|
| 12 |
+
var whitespace = require("./whitespace.js");
|
| 13 |
+
var parens = require("./parentheses.js");
|
| 14 |
+
var _t = require("@babel/types");
|
| 15 |
+
const {
|
| 16 |
+
FLIPPED_ALIAS_KEYS,
|
| 17 |
+
VISITOR_KEYS,
|
| 18 |
+
isCallExpression,
|
| 19 |
+
isDecorator,
|
| 20 |
+
isExpressionStatement,
|
| 21 |
+
isMemberExpression,
|
| 22 |
+
isNewExpression,
|
| 23 |
+
isParenthesizedExpression
|
| 24 |
+
} = _t;
|
| 25 |
+
const TokenContext = exports.TokenContext = {
|
| 26 |
+
expressionStatement: 1,
|
| 27 |
+
arrowBody: 2,
|
| 28 |
+
exportDefault: 4,
|
| 29 |
+
forHead: 8,
|
| 30 |
+
forInHead: 16,
|
| 31 |
+
forOfHead: 32,
|
| 32 |
+
arrowFlowReturnType: 64
|
| 33 |
+
};
|
| 34 |
+
function expandAliases(obj) {
|
| 35 |
+
const map = new Map();
|
| 36 |
+
function add(type, func) {
|
| 37 |
+
const fn = map.get(type);
|
| 38 |
+
map.set(type, fn ? function (node, parent, stack, inForInit, getRawIdentifier) {
|
| 39 |
+
var _fn;
|
| 40 |
+
return (_fn = fn(node, parent, stack, inForInit, getRawIdentifier)) != null ? _fn : func(node, parent, stack, inForInit, getRawIdentifier);
|
| 41 |
+
} : func);
|
| 42 |
+
}
|
| 43 |
+
for (const type of Object.keys(obj)) {
|
| 44 |
+
const aliases = FLIPPED_ALIAS_KEYS[type];
|
| 45 |
+
if (aliases) {
|
| 46 |
+
for (const alias of aliases) {
|
| 47 |
+
add(alias, obj[type]);
|
| 48 |
+
}
|
| 49 |
+
} else {
|
| 50 |
+
add(type, obj[type]);
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
return map;
|
| 54 |
+
}
|
| 55 |
+
const expandedParens = expandAliases(parens);
|
| 56 |
+
const expandedWhitespaceNodes = expandAliases(whitespace.nodes);
|
| 57 |
+
function isOrHasCallExpression(node) {
|
| 58 |
+
if (isCallExpression(node)) {
|
| 59 |
+
return true;
|
| 60 |
+
}
|
| 61 |
+
return isMemberExpression(node) && isOrHasCallExpression(node.object);
|
| 62 |
+
}
|
| 63 |
+
function needsWhitespace(node, parent, type) {
|
| 64 |
+
var _expandedWhitespaceNo;
|
| 65 |
+
if (!node) return false;
|
| 66 |
+
if (isExpressionStatement(node)) {
|
| 67 |
+
node = node.expression;
|
| 68 |
+
}
|
| 69 |
+
const flag = (_expandedWhitespaceNo = expandedWhitespaceNodes.get(node.type)) == null ? void 0 : _expandedWhitespaceNo(node, parent);
|
| 70 |
+
if (typeof flag === "number") {
|
| 71 |
+
return (flag & type) !== 0;
|
| 72 |
+
}
|
| 73 |
+
return false;
|
| 74 |
+
}
|
| 75 |
+
function needsWhitespaceBefore(node, parent) {
|
| 76 |
+
return needsWhitespace(node, parent, 1);
|
| 77 |
+
}
|
| 78 |
+
function needsWhitespaceAfter(node, parent) {
|
| 79 |
+
return needsWhitespace(node, parent, 2);
|
| 80 |
+
}
|
| 81 |
+
function needsParens(node, parent, tokenContext, inForInit, getRawIdentifier) {
|
| 82 |
+
var _expandedParens$get;
|
| 83 |
+
if (!parent) return false;
|
| 84 |
+
if (isNewExpression(parent) && parent.callee === node) {
|
| 85 |
+
if (isOrHasCallExpression(node)) return true;
|
| 86 |
+
}
|
| 87 |
+
if (isDecorator(parent)) {
|
| 88 |
+
return !isDecoratorMemberExpression(node) && !(isCallExpression(node) && isDecoratorMemberExpression(node.callee)) && !isParenthesizedExpression(node);
|
| 89 |
+
}
|
| 90 |
+
return (_expandedParens$get = expandedParens.get(node.type)) == null ? void 0 : _expandedParens$get(node, parent, tokenContext, inForInit, getRawIdentifier);
|
| 91 |
+
}
|
| 92 |
+
function isDecoratorMemberExpression(node) {
|
| 93 |
+
switch (node.type) {
|
| 94 |
+
case "Identifier":
|
| 95 |
+
return true;
|
| 96 |
+
case "MemberExpression":
|
| 97 |
+
return !node.computed && node.property.type === "Identifier" && isDecoratorMemberExpression(node.object);
|
| 98 |
+
default:
|
| 99 |
+
return false;
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
function isLastChild(parent, child) {
|
| 103 |
+
const visitorKeys = VISITOR_KEYS[parent.type];
|
| 104 |
+
for (let i = visitorKeys.length - 1; i >= 0; i--) {
|
| 105 |
+
const val = parent[visitorKeys[i]];
|
| 106 |
+
if (val === child) {
|
| 107 |
+
return true;
|
| 108 |
+
} else if (Array.isArray(val)) {
|
| 109 |
+
let j = val.length - 1;
|
| 110 |
+
while (j >= 0 && val[j] === null) j--;
|
| 111 |
+
return j >= 0 && val[j] === child;
|
| 112 |
+
} else if (val) {
|
| 113 |
+
return false;
|
| 114 |
+
}
|
| 115 |
+
}
|
| 116 |
+
return false;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
//# sourceMappingURL=index.js.map
|
ui/node_modules/@babel/generator/lib/node/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["whitespace","require","parens","_t","FLIPPED_ALIAS_KEYS","VISITOR_KEYS","isCallExpression","isDecorator","isExpressionStatement","isMemberExpression","isNewExpression","isParenthesizedExpression","TokenContext","exports","expressionStatement","arrowBody","exportDefault","forHead","forInHead","forOfHead","arrowFlowReturnType","expandAliases","obj","map","Map","add","type","func","fn","get","set","node","parent","stack","inForInit","getRawIdentifier","_fn","Object","keys","aliases","alias","expandedParens","expandedWhitespaceNodes","nodes","isOrHasCallExpression","object","needsWhitespace","_expandedWhitespaceNo","expression","flag","needsWhitespaceBefore","needsWhitespaceAfter","needsParens","tokenContext","_expandedParens$get","callee","isDecoratorMemberExpression","computed","property","isLastChild","child","visitorKeys","i","length","val","Array","isArray","j"],"sources":["../../src/node/index.ts"],"sourcesContent":["import * as whitespace from \"./whitespace.ts\";\nimport * as parens from \"./parentheses.ts\";\nimport {\n FLIPPED_ALIAS_KEYS,\n VISITOR_KEYS,\n isCallExpression,\n isDecorator,\n isExpressionStatement,\n isMemberExpression,\n isNewExpression,\n isParenthesizedExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nimport type { WhitespaceFlag } from \"./whitespace.ts\";\n\nexport const enum TokenContext {\n expressionStatement = 1 << 0,\n arrowBody = 1 << 1,\n exportDefault = 1 << 2,\n forHead = 1 << 3,\n forInHead = 1 << 4,\n forOfHead = 1 << 5,\n arrowFlowReturnType = 1 << 6,\n}\n\ntype 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 tokenContext?: number,\n inForStatementInit?: boolean,\n getRawIdentifier?: (node: t.Identifier) => string,\n) => R;\n\nexport type NodeHandlers<R> = {\n [K in string]?: NodeHandler<R>;\n};\n\nfunction expandAliases<R>(obj: NodeHandlers<R>) {\n const map = new Map<string, NodeHandler<R>>();\n\n function add(type: string, func: NodeHandler<R>) {\n const fn = map.get(type);\n map.set(\n type,\n fn\n ? function (node, parent, stack, inForInit, getRawIdentifier) {\n return (\n fn(node, parent, stack, inForInit, getRawIdentifier) ??\n func(node, parent, stack, inForInit, getRawIdentifier)\n );\n }\n : func,\n );\n }\n\n for (const type of Object.keys(obj)) {\n const aliases = FLIPPED_ALIAS_KEYS[type];\n if (aliases) {\n for (const alias of aliases) {\n add(alias, obj[type]);\n }\n } else {\n add(type, obj[type]);\n }\n }\n\n return map;\n}\n\n// Rather than using `t.is` on each object property, we pre-expand any type aliases\n// into concrete types so that the 'find' call below can be as fast as possible.\nconst expandedParens = expandAliases(parens);\nconst expandedWhitespaceNodes = expandAliases(whitespace.nodes);\n\nfunction isOrHasCallExpression(node: t.Node): boolean {\n if (isCallExpression(node)) {\n return true;\n }\n\n return isMemberExpression(node) && isOrHasCallExpression(node.object);\n}\n\nexport function needsWhitespace(\n node: t.Node,\n parent: t.Node,\n type: WhitespaceFlag,\n): boolean {\n if (!node) return false;\n\n if (isExpressionStatement(node)) {\n node = node.expression;\n }\n\n const flag = expandedWhitespaceNodes.get(node.type)?.(node, parent);\n\n if (typeof flag === \"number\") {\n return (flag & type) !== 0;\n }\n\n return false;\n}\n\nexport function needsWhitespaceBefore(node: t.Node, parent: t.Node) {\n return needsWhitespace(node, parent, 1);\n}\n\nexport function needsWhitespaceAfter(node: t.Node, parent: t.Node) {\n return needsWhitespace(node, parent, 2);\n}\n\nexport function needsParens(\n node: t.Node,\n parent: t.Node,\n tokenContext?: number,\n inForInit?: boolean,\n getRawIdentifier?: (node: t.Identifier) => string,\n) {\n if (!parent) return false;\n\n if (isNewExpression(parent) && parent.callee === node) {\n if (isOrHasCallExpression(node)) return true;\n }\n\n if (isDecorator(parent)) {\n return (\n !isDecoratorMemberExpression(node) &&\n !(isCallExpression(node) && isDecoratorMemberExpression(node.callee)) &&\n !isParenthesizedExpression(node)\n );\n }\n\n return expandedParens.get(node.type)?.(\n node,\n parent,\n tokenContext,\n inForInit,\n getRawIdentifier,\n );\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,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,EAAA,GAAAF,OAAA;AASsB;EARpBG,kBAAkB;EAClBC,YAAY;EACZC,gBAAgB;EAChBC,WAAW;EACXC,qBAAqB;EACrBC,kBAAkB;EAClBC,eAAe;EACfC;AAAyB,IAAAR,EAAA;AAAA,MAMTS,YAAY,GAAAC,OAAA,CAAAD,YAAA;EAAAE,mBAAA;EAAAC,SAAA;EAAAC,aAAA;EAAAC,OAAA;EAAAC,SAAA;EAAAC,SAAA;EAAAC,mBAAA;AAAA;AA0B9B,SAASC,aAAaA,CAAIC,GAAoB,EAAE;EAC9C,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAAyB,CAAC;EAE7C,SAASC,GAAGA,CAACC,IAAY,EAAEC,IAAoB,EAAE;IAC/C,MAAMC,EAAE,GAAGL,GAAG,CAACM,GAAG,CAACH,IAAI,CAAC;IACxBH,GAAG,CAACO,GAAG,CACLJ,IAAI,EACJE,EAAE,GACE,UAAUG,IAAI,EAAEC,MAAM,EAAEC,KAAK,EAAEC,SAAS,EAAEC,gBAAgB,EAAE;MAAA,IAAAC,GAAA;MAC1D,QAAAA,GAAA,GACER,EAAE,CAACG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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.AssignmentExpression = AssignmentExpression;
|
| 7 |
+
exports.Binary = Binary;
|
| 8 |
+
exports.BinaryExpression = BinaryExpression;
|
| 9 |
+
exports.ClassExpression = ClassExpression;
|
| 10 |
+
exports.ArrowFunctionExpression = exports.ConditionalExpression = ConditionalExpression;
|
| 11 |
+
exports.DoExpression = DoExpression;
|
| 12 |
+
exports.FunctionExpression = FunctionExpression;
|
| 13 |
+
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
| 14 |
+
exports.Identifier = Identifier;
|
| 15 |
+
exports.LogicalExpression = LogicalExpression;
|
| 16 |
+
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
| 17 |
+
exports.ObjectExpression = ObjectExpression;
|
| 18 |
+
exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
|
| 19 |
+
exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression;
|
| 20 |
+
exports.SequenceExpression = SequenceExpression;
|
| 21 |
+
exports.TSSatisfiesExpression = exports.TSAsExpression = TSAsExpression;
|
| 22 |
+
exports.TSConditionalType = TSConditionalType;
|
| 23 |
+
exports.TSConstructorType = exports.TSFunctionType = TSFunctionType;
|
| 24 |
+
exports.TSInferType = TSInferType;
|
| 25 |
+
exports.TSInstantiationExpression = TSInstantiationExpression;
|
| 26 |
+
exports.TSIntersectionType = TSIntersectionType;
|
| 27 |
+
exports.UnaryLike = exports.TSTypeAssertion = UnaryLike;
|
| 28 |
+
exports.TSTypeOperator = TSTypeOperator;
|
| 29 |
+
exports.TSUnionType = TSUnionType;
|
| 30 |
+
exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
| 31 |
+
exports.UpdateExpression = UpdateExpression;
|
| 32 |
+
exports.AwaitExpression = exports.YieldExpression = YieldExpression;
|
| 33 |
+
var _t = require("@babel/types");
|
| 34 |
+
var _index = require("./index.js");
|
| 35 |
+
const {
|
| 36 |
+
isArrayTypeAnnotation,
|
| 37 |
+
isBinaryExpression,
|
| 38 |
+
isCallExpression,
|
| 39 |
+
isForOfStatement,
|
| 40 |
+
isIndexedAccessType,
|
| 41 |
+
isMemberExpression,
|
| 42 |
+
isObjectPattern,
|
| 43 |
+
isOptionalMemberExpression,
|
| 44 |
+
isYieldExpression,
|
| 45 |
+
isStatement
|
| 46 |
+
} = _t;
|
| 47 |
+
const PRECEDENCE = new Map([["||", 0], ["??", 0], ["|>", 0], ["&&", 1], ["|", 2], ["^", 3], ["&", 4], ["==", 5], ["===", 5], ["!=", 5], ["!==", 5], ["<", 6], [">", 6], ["<=", 6], [">=", 6], ["in", 6], ["instanceof", 6], [">>", 7], ["<<", 7], [">>>", 7], ["+", 8], ["-", 8], ["*", 9], ["/", 9], ["%", 9], ["**", 10]]);
|
| 48 |
+
function getBinaryPrecedence(node, nodeType) {
|
| 49 |
+
if (nodeType === "BinaryExpression" || nodeType === "LogicalExpression") {
|
| 50 |
+
return PRECEDENCE.get(node.operator);
|
| 51 |
+
}
|
| 52 |
+
if (nodeType === "TSAsExpression" || nodeType === "TSSatisfiesExpression") {
|
| 53 |
+
return PRECEDENCE.get("in");
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
function isTSTypeExpression(nodeType) {
|
| 57 |
+
return nodeType === "TSAsExpression" || nodeType === "TSSatisfiesExpression" || nodeType === "TSTypeAssertion";
|
| 58 |
+
}
|
| 59 |
+
const isClassExtendsClause = (node, parent) => {
|
| 60 |
+
const parentType = parent.type;
|
| 61 |
+
return (parentType === "ClassDeclaration" || parentType === "ClassExpression") && parent.superClass === node;
|
| 62 |
+
};
|
| 63 |
+
const hasPostfixPart = (node, parent) => {
|
| 64 |
+
const parentType = parent.type;
|
| 65 |
+
return (parentType === "MemberExpression" || parentType === "OptionalMemberExpression") && parent.object === node || (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression") && parent.callee === node || parentType === "TaggedTemplateExpression" && parent.tag === node || parentType === "TSNonNullExpression";
|
| 66 |
+
};
|
| 67 |
+
function NullableTypeAnnotation(node, parent) {
|
| 68 |
+
return isArrayTypeAnnotation(parent);
|
| 69 |
+
}
|
| 70 |
+
function FunctionTypeAnnotation(node, parent, tokenContext) {
|
| 71 |
+
const parentType = parent.type;
|
| 72 |
+
return (parentType === "UnionTypeAnnotation" || parentType === "IntersectionTypeAnnotation" || parentType === "ArrayTypeAnnotation" || Boolean(tokenContext & _index.TokenContext.arrowFlowReturnType)
|
| 73 |
+
);
|
| 74 |
+
}
|
| 75 |
+
function UpdateExpression(node, parent) {
|
| 76 |
+
return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);
|
| 77 |
+
}
|
| 78 |
+
function needsParenBeforeExpressionBrace(tokenContext) {
|
| 79 |
+
return Boolean(tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.arrowBody));
|
| 80 |
+
}
|
| 81 |
+
function ObjectExpression(node, parent, tokenContext) {
|
| 82 |
+
return needsParenBeforeExpressionBrace(tokenContext);
|
| 83 |
+
}
|
| 84 |
+
function DoExpression(node, parent, tokenContext) {
|
| 85 |
+
return !node.async && Boolean(tokenContext & _index.TokenContext.expressionStatement);
|
| 86 |
+
}
|
| 87 |
+
function Binary(node, parent) {
|
| 88 |
+
const parentType = parent.type;
|
| 89 |
+
if (node.type === "BinaryExpression" && node.operator === "**" && parentType === "BinaryExpression" && parent.operator === "**") {
|
| 90 |
+
return parent.left === node;
|
| 91 |
+
}
|
| 92 |
+
if (isClassExtendsClause(node, parent)) {
|
| 93 |
+
return true;
|
| 94 |
+
}
|
| 95 |
+
if (hasPostfixPart(node, parent) || parentType === "UnaryExpression" || parentType === "SpreadElement" || parentType === "AwaitExpression") {
|
| 96 |
+
return true;
|
| 97 |
+
}
|
| 98 |
+
const parentPos = getBinaryPrecedence(parent, parentType);
|
| 99 |
+
if (parentPos != null) {
|
| 100 |
+
const nodePos = getBinaryPrecedence(node, node.type);
|
| 101 |
+
if (parentPos === nodePos && parentType === "BinaryExpression" && parent.right === node || parentPos > nodePos) {
|
| 102 |
+
return true;
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
return undefined;
|
| 106 |
+
}
|
| 107 |
+
function UnionTypeAnnotation(node, parent) {
|
| 108 |
+
const parentType = parent.type;
|
| 109 |
+
return parentType === "ArrayTypeAnnotation" || parentType === "NullableTypeAnnotation" || parentType === "IntersectionTypeAnnotation" || parentType === "UnionTypeAnnotation";
|
| 110 |
+
}
|
| 111 |
+
function OptionalIndexedAccessType(node, parent) {
|
| 112 |
+
return isIndexedAccessType(parent) && parent.objectType === node;
|
| 113 |
+
}
|
| 114 |
+
function TSAsExpression(node, parent) {
|
| 115 |
+
if ((parent.type === "AssignmentExpression" || parent.type === "AssignmentPattern") && parent.left === node) {
|
| 116 |
+
return true;
|
| 117 |
+
}
|
| 118 |
+
if (parent.type === "BinaryExpression" && (parent.operator === "|" || parent.operator === "&") && node === parent.left) {
|
| 119 |
+
return true;
|
| 120 |
+
}
|
| 121 |
+
return Binary(node, parent);
|
| 122 |
+
}
|
| 123 |
+
function TSConditionalType(node, parent) {
|
| 124 |
+
const parentType = parent.type;
|
| 125 |
+
if (parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType" || parentType === "TSTypeOperator" || parentType === "TSTypeParameter") {
|
| 126 |
+
return true;
|
| 127 |
+
}
|
| 128 |
+
if ((parentType === "TSIntersectionType" || parentType === "TSUnionType") && parent.types[0] === node) {
|
| 129 |
+
return true;
|
| 130 |
+
}
|
| 131 |
+
if (parentType === "TSConditionalType" && (parent.checkType === node || parent.extendsType === node)) {
|
| 132 |
+
return true;
|
| 133 |
+
}
|
| 134 |
+
return false;
|
| 135 |
+
}
|
| 136 |
+
function TSUnionType(node, parent) {
|
| 137 |
+
const parentType = parent.type;
|
| 138 |
+
return parentType === "TSIntersectionType" || parentType === "TSTypeOperator" || parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType";
|
| 139 |
+
}
|
| 140 |
+
function TSIntersectionType(node, parent) {
|
| 141 |
+
const parentType = parent.type;
|
| 142 |
+
return parentType === "TSTypeOperator" || parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType";
|
| 143 |
+
}
|
| 144 |
+
function TSInferType(node, parent) {
|
| 145 |
+
const parentType = parent.type;
|
| 146 |
+
if (parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType") {
|
| 147 |
+
return true;
|
| 148 |
+
}
|
| 149 |
+
if (node.typeParameter.constraint) {
|
| 150 |
+
if ((parentType === "TSIntersectionType" || parentType === "TSUnionType") && parent.types[0] === node) {
|
| 151 |
+
return true;
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
+
return false;
|
| 155 |
+
}
|
| 156 |
+
function TSTypeOperator(node, parent) {
|
| 157 |
+
const parentType = parent.type;
|
| 158 |
+
return parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType";
|
| 159 |
+
}
|
| 160 |
+
function TSInstantiationExpression(node, parent) {
|
| 161 |
+
const parentType = parent.type;
|
| 162 |
+
return (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression" || parentType === "TSInstantiationExpression") && !!parent.typeParameters;
|
| 163 |
+
}
|
| 164 |
+
function TSFunctionType(node, parent) {
|
| 165 |
+
const parentType = parent.type;
|
| 166 |
+
return parentType === "TSIntersectionType" || parentType === "TSUnionType" || parentType === "TSTypeOperator" || parentType === "TSOptionalType" || parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSConditionalType" && (parent.checkType === node || parent.extendsType === node);
|
| 167 |
+
}
|
| 168 |
+
function BinaryExpression(node, parent, tokenContext, inForStatementInit) {
|
| 169 |
+
return node.operator === "in" && inForStatementInit;
|
| 170 |
+
}
|
| 171 |
+
function SequenceExpression(node, parent) {
|
| 172 |
+
const parentType = parent.type;
|
| 173 |
+
if (parentType === "SequenceExpression" || parentType === "ParenthesizedExpression" || parentType === "MemberExpression" && parent.property === node || parentType === "OptionalMemberExpression" && parent.property === node || parentType === "TemplateLiteral") {
|
| 174 |
+
return false;
|
| 175 |
+
}
|
| 176 |
+
if (parentType === "ClassDeclaration") {
|
| 177 |
+
return true;
|
| 178 |
+
}
|
| 179 |
+
if (parentType === "ForOfStatement") {
|
| 180 |
+
return parent.right === node;
|
| 181 |
+
}
|
| 182 |
+
if (parentType === "ExportDefaultDeclaration") {
|
| 183 |
+
return true;
|
| 184 |
+
}
|
| 185 |
+
return !isStatement(parent);
|
| 186 |
+
}
|
| 187 |
+
function YieldExpression(node, parent) {
|
| 188 |
+
const parentType = parent.type;
|
| 189 |
+
return parentType === "BinaryExpression" || parentType === "LogicalExpression" || parentType === "UnaryExpression" || parentType === "SpreadElement" || hasPostfixPart(node, parent) || parentType === "AwaitExpression" && isYieldExpression(node) || parentType === "ConditionalExpression" && node === parent.test || isClassExtendsClause(node, parent) || isTSTypeExpression(parentType);
|
| 190 |
+
}
|
| 191 |
+
function ClassExpression(node, parent, tokenContext) {
|
| 192 |
+
return Boolean(tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault));
|
| 193 |
+
}
|
| 194 |
+
function UnaryLike(node, parent) {
|
| 195 |
+
return hasPostfixPart(node, parent) || isBinaryExpression(parent) && parent.operator === "**" && parent.left === node || isClassExtendsClause(node, parent);
|
| 196 |
+
}
|
| 197 |
+
function FunctionExpression(node, parent, tokenContext) {
|
| 198 |
+
return Boolean(tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault));
|
| 199 |
+
}
|
| 200 |
+
function ConditionalExpression(node, parent) {
|
| 201 |
+
const parentType = parent.type;
|
| 202 |
+
if (parentType === "UnaryExpression" || parentType === "SpreadElement" || parentType === "BinaryExpression" || parentType === "LogicalExpression" || parentType === "ConditionalExpression" && parent.test === node || parentType === "AwaitExpression" || isTSTypeExpression(parentType)) {
|
| 203 |
+
return true;
|
| 204 |
+
}
|
| 205 |
+
return UnaryLike(node, parent);
|
| 206 |
+
}
|
| 207 |
+
function OptionalMemberExpression(node, parent) {
|
| 208 |
+
return isCallExpression(parent) && parent.callee === node || isMemberExpression(parent) && parent.object === node;
|
| 209 |
+
}
|
| 210 |
+
function AssignmentExpression(node, parent, tokenContext) {
|
| 211 |
+
if (needsParenBeforeExpressionBrace(tokenContext) && isObjectPattern(node.left)) {
|
| 212 |
+
return true;
|
| 213 |
+
} else {
|
| 214 |
+
return ConditionalExpression(node, parent);
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
function LogicalExpression(node, parent) {
|
| 218 |
+
const parentType = parent.type;
|
| 219 |
+
if (isTSTypeExpression(parentType)) return true;
|
| 220 |
+
if (parentType !== "LogicalExpression") return false;
|
| 221 |
+
switch (node.operator) {
|
| 222 |
+
case "||":
|
| 223 |
+
return parent.operator === "??" || parent.operator === "&&";
|
| 224 |
+
case "&&":
|
| 225 |
+
return parent.operator === "??";
|
| 226 |
+
case "??":
|
| 227 |
+
return parent.operator !== "??";
|
| 228 |
+
}
|
| 229 |
+
}
|
| 230 |
+
function Identifier(node, parent, tokenContext, _inForInit, getRawIdentifier) {
|
| 231 |
+
var _node$extra;
|
| 232 |
+
const parentType = parent.type;
|
| 233 |
+
if ((_node$extra = node.extra) != null && _node$extra.parenthesized && parentType === "AssignmentExpression" && parent.left === node) {
|
| 234 |
+
const rightType = parent.right.type;
|
| 235 |
+
if ((rightType === "FunctionExpression" || rightType === "ClassExpression") && parent.right.id == null) {
|
| 236 |
+
return true;
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
+
if (getRawIdentifier && getRawIdentifier(node) !== node.name) {
|
| 240 |
+
return false;
|
| 241 |
+
}
|
| 242 |
+
if (node.name === "let") {
|
| 243 |
+
const isFollowedByBracket = isMemberExpression(parent, {
|
| 244 |
+
object: node,
|
| 245 |
+
computed: true
|
| 246 |
+
}) || isOptionalMemberExpression(parent, {
|
| 247 |
+
object: node,
|
| 248 |
+
computed: true,
|
| 249 |
+
optional: false
|
| 250 |
+
});
|
| 251 |
+
if (isFollowedByBracket && tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.forHead | _index.TokenContext.forInHead)) {
|
| 252 |
+
return true;
|
| 253 |
+
}
|
| 254 |
+
return Boolean(tokenContext & _index.TokenContext.forOfHead);
|
| 255 |
+
}
|
| 256 |
+
return node.name === "async" && isForOfStatement(parent, {
|
| 257 |
+
left: node,
|
| 258 |
+
await: false
|
| 259 |
+
});
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
//# sourceMappingURL=parentheses.js.map
|
ui/node_modules/@babel/generator/lib/node/parentheses.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","_index","isArrayTypeAnnotation","isBinaryExpression","isCallExpression","isForOfStatement","isIndexedAccessType","isMemberExpression","isObjectPattern","isOptionalMemberExpression","isYieldExpression","isStatement","PRECEDENCE","Map","getBinaryPrecedence","node","nodeType","get","operator","isTSTypeExpression","isClassExtendsClause","parent","parentType","type","superClass","hasPostfixPart","object","callee","tag","NullableTypeAnnotation","FunctionTypeAnnotation","tokenContext","Boolean","TokenContext","arrowFlowReturnType","UpdateExpression","needsParenBeforeExpressionBrace","expressionStatement","arrowBody","ObjectExpression","DoExpression","async","Binary","left","parentPos","nodePos","right","undefined","UnionTypeAnnotation","OptionalIndexedAccessType","objectType","TSAsExpression","TSConditionalType","types","checkType","extendsType","TSUnionType","TSIntersectionType","TSInferType","typeParameter","constraint","TSTypeOperator","TSInstantiationExpression","typeParameters","TSFunctionType","BinaryExpression","inForStatementInit","SequenceExpression","property","YieldExpression","test","ClassExpression","exportDefault","UnaryLike","FunctionExpression","ConditionalExpression","OptionalMemberExpression","AssignmentExpression","LogicalExpression","Identifier","_inForInit","getRawIdentifier","_node$extra","extra","parenthesized","rightType","id","name","isFollowedByBracket","computed","optional","forHead","forInHead","forOfHead","await"],"sources":["../../src/node/parentheses.ts"],"sourcesContent":["import {\n isArrayTypeAnnotation,\n isBinaryExpression,\n isCallExpression,\n isForOfStatement,\n isIndexedAccessType,\n isMemberExpression,\n isObjectPattern,\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 [\"??\", 0],\n [\"|>\", 0],\n [\"&&\", 1],\n [\"|\", 2],\n [\"^\", 3],\n [\"&\", 4],\n [\"==\", 5],\n [\"===\", 5],\n [\"!=\", 5],\n [\"!==\", 5],\n [\"<\", 6],\n [\">\", 6],\n [\"<=\", 6],\n [\">=\", 6],\n [\"in\", 6],\n [\"instanceof\", 6],\n [\">>\", 7],\n [\"<<\", 7],\n [\">>>\", 7],\n [\"+\", 8],\n [\"-\", 8],\n [\"*\", 9],\n [\"/\", 9],\n [\"%\", 9],\n [\"**\", 10],\n]);\n\nfunction getBinaryPrecedence(\n node: t.Binary | t.TSAsExpression | t.TSSatisfiesExpression,\n nodeType: string,\n): number;\nfunction getBinaryPrecedence(\n node: t.Node,\n nodeType: string,\n): number | undefined;\nfunction getBinaryPrecedence(node: t.Node, nodeType: string) {\n if (nodeType === \"BinaryExpression\" || nodeType === \"LogicalExpression\") {\n return PRECEDENCE.get((node as t.Binary).operator);\n }\n if (nodeType === \"TSAsExpression\" || nodeType === \"TSSatisfiesExpression\") {\n return PRECEDENCE.get(\"in\");\n }\n}\n\nfunction isTSTypeExpression(nodeType: string) {\n return (\n nodeType === \"TSAsExpression\" ||\n nodeType === \"TSSatisfiesExpression\" ||\n nodeType === \"TSTypeAssertion\"\n );\n}\n\nconst isClassExtendsClause = (\n node: t.Node,\n parent: t.Node,\n): parent is t.Class => {\n const parentType = parent.type;\n return (\n (parentType === \"ClassDeclaration\" || parentType === \"ClassExpression\") &&\n parent.superClass === node\n );\n};\n\nconst hasPostfixPart = (node: t.Node, parent: t.Node) => {\n const parentType = parent.type;\n return (\n ((parentType === \"MemberExpression\" ||\n parentType === \"OptionalMemberExpression\") &&\n parent.object === node) ||\n ((parentType === \"CallExpression\" ||\n parentType === \"OptionalCallExpression\" ||\n parentType === \"NewExpression\") &&\n parent.callee === node) ||\n (parentType === \"TaggedTemplateExpression\" && parent.tag === node) ||\n parentType === \"TSNonNullExpression\"\n );\n};\n\nexport function NullableTypeAnnotation(\n node: t.NullableTypeAnnotation,\n parent: t.Node,\n): boolean {\n return isArrayTypeAnnotation(parent);\n}\n\nexport function FunctionTypeAnnotation(\n node: t.FunctionTypeAnnotation,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n const parentType = parent.type;\n return (\n // (() => A) | (() => B)\n parentType === \"UnionTypeAnnotation\" ||\n // (() => A) & (() => B)\n parentType === \"IntersectionTypeAnnotation\" ||\n // (() => A)[]\n parentType === \"ArrayTypeAnnotation\" ||\n Boolean(tokenContext & TokenContext.arrowFlowReturnType)\n );\n}\n\nexport function UpdateExpression(\n node: t.UpdateExpression,\n parent: t.Node,\n): boolean {\n return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);\n}\n\nfunction needsParenBeforeExpressionBrace(tokenContext: number) {\n return Boolean(\n tokenContext & (TokenContext.expressionStatement | TokenContext.arrowBody),\n );\n}\n\nexport function ObjectExpression(\n node: t.ObjectExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n return needsParenBeforeExpressionBrace(tokenContext);\n}\n\nexport function DoExpression(\n node: t.DoExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n // `async do` can start an expression statement\n return (\n !node.async && Boolean(tokenContext & TokenContext.expressionStatement)\n );\n}\n\nexport function Binary(\n node: t.Binary | t.TSAsExpression | t.TSSatisfiesExpression,\n parent: t.Node,\n): boolean | undefined {\n const parentType = parent.type;\n if (\n node.type === \"BinaryExpression\" &&\n node.operator === \"**\" &&\n parentType === \"BinaryExpression\" &&\n parent.operator === \"**\"\n ) {\n return parent.left === node;\n }\n\n if (isClassExtendsClause(node, parent)) {\n return true;\n }\n\n if (\n hasPostfixPart(node, parent) ||\n parentType === \"UnaryExpression\" ||\n parentType === \"SpreadElement\" ||\n parentType === \"AwaitExpression\"\n ) {\n return true;\n }\n\n const parentPos = getBinaryPrecedence(parent, parentType);\n if (parentPos != null) {\n const nodePos = getBinaryPrecedence(node, node.type);\n if (\n // Logical expressions with the same precedence don't need parens.\n (parentPos === nodePos &&\n parentType === \"BinaryExpression\" &&\n parent.right === node) ||\n parentPos > nodePos\n ) {\n return true;\n }\n }\n\n return undefined;\n}\n\nexport function UnionTypeAnnotation(\n node: t.UnionTypeAnnotation,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"ArrayTypeAnnotation\" ||\n parentType === \"NullableTypeAnnotation\" ||\n parentType === \"IntersectionTypeAnnotation\" ||\n parentType === \"UnionTypeAnnotation\"\n );\n}\n\nexport { UnionTypeAnnotation as IntersectionTypeAnnotation };\n\nexport function OptionalIndexedAccessType(\n node: t.OptionalIndexedAccessType,\n parent: t.Node,\n): boolean {\n return isIndexedAccessType(parent) && parent.objectType === node;\n}\n\nexport function TSAsExpression(\n node: t.TSAsExpression | t.TSSatisfiesExpression,\n parent: t.Node,\n): boolean {\n if (\n (parent.type === \"AssignmentExpression\" ||\n parent.type === \"AssignmentPattern\") &&\n parent.left === node\n ) {\n return true;\n }\n if (\n parent.type === \"BinaryExpression\" &&\n (parent.operator === \"|\" || parent.operator === \"&\") &&\n node === parent.left\n ) {\n return true;\n }\n return Binary(node, parent);\n}\n\nexport { TSAsExpression as TSSatisfiesExpression };\n\nexport { UnaryLike as TSTypeAssertion };\n\nexport function TSConditionalType(\n node: t.TSConditionalType,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n if (\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\" ||\n parentType === \"TSTypeOperator\" ||\n // for `infer K extends (L extends M ? M : ...)`\n parentType === \"TSTypeParameter\"\n ) {\n return true;\n }\n if (\n (parentType === \"TSIntersectionType\" || parentType === \"TSUnionType\") &&\n parent.types[0] === node\n ) {\n return true;\n }\n if (\n parentType === \"TSConditionalType\" &&\n (parent.checkType === node || parent.extendsType === node)\n ) {\n return true;\n }\n return false;\n}\n\nexport function TSUnionType(node: t.TSUnionType, parent: t.Node): boolean {\n const parentType = parent.type;\n return (\n parentType === \"TSIntersectionType\" ||\n parentType === \"TSTypeOperator\" ||\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\"\n );\n}\n\nexport function TSIntersectionType(\n node: t.TSUnionType,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"TSTypeOperator\" ||\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\"\n );\n}\n\nexport function TSInferType(node: t.TSInferType, parent: t.Node): boolean {\n const parentType = parent.type;\n if (\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\"\n ) {\n return true;\n }\n if (node.typeParameter.constraint) {\n if (\n (parentType === \"TSIntersectionType\" || parentType === \"TSUnionType\") &&\n parent.types[0] === node\n ) {\n return true;\n }\n }\n return false;\n}\n\nexport function TSTypeOperator(\n node: t.TSTypeOperator,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\"\n );\n}\n\nexport function TSInstantiationExpression(\n node: t.TSInstantiationExpression,\n parent: t.Node,\n) {\n const parentType = parent.type;\n return (\n (parentType === \"CallExpression\" ||\n parentType === \"OptionalCallExpression\" ||\n parentType === \"NewExpression\" ||\n parentType === \"TSInstantiationExpression\") &&\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)\n );\n}\n\nexport function TSFunctionType(\n node: t.TSFunctionType,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"TSIntersectionType\" ||\n parentType === \"TSUnionType\" ||\n parentType === \"TSTypeOperator\" ||\n parentType === \"TSOptionalType\" ||\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n (parentType === \"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: t.Node,\n tokenContext: unknown,\n inForStatementInit: boolean,\n): boolean {\n // for ((1 in []);;);\n // for (var x = (1 in []) in 2);\n return node.operator === \"in\" && inForStatementInit;\n}\n\nexport function SequenceExpression(\n node: t.SequenceExpression,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n if (\n parentType === \"SequenceExpression\" ||\n parentType === \"ParenthesizedExpression\" ||\n (parentType === \"MemberExpression\" && parent.property === node) ||\n (parentType === \"OptionalMemberExpression\" && parent.property === node) ||\n parentType === \"TemplateLiteral\"\n ) {\n return false;\n }\n if (parentType === \"ClassDeclaration\") {\n return true;\n }\n if (parentType === \"ForOfStatement\") {\n return parent.right === node;\n }\n if (parentType === \"ExportDefaultDeclaration\") {\n return true;\n }\n\n return !isStatement(parent);\n}\n\nexport function YieldExpression(\n node: t.YieldExpression,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"BinaryExpression\" ||\n parentType === \"LogicalExpression\" ||\n parentType === \"UnaryExpression\" ||\n parentType === \"SpreadElement\" ||\n hasPostfixPart(node, parent) ||\n (parentType === \"AwaitExpression\" && isYieldExpression(node)) ||\n (parentType === \"ConditionalExpression\" && node === parent.test) ||\n isClassExtendsClause(node, parent) ||\n isTSTypeExpression(parentType)\n );\n}\n\nexport { YieldExpression as AwaitExpression };\n\nexport function ClassExpression(\n node: t.ClassExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n return Boolean(\n tokenContext &\n (TokenContext.expressionStatement | TokenContext.exportDefault),\n );\n}\n\nexport function UnaryLike(\n node:\n | t.UnaryLike\n | t.TSTypeAssertion\n | t.ArrowFunctionExpression\n | t.ConditionalExpression\n | t.AssignmentExpression,\n parent: t.Node,\n): boolean {\n return (\n hasPostfixPart(node, parent) ||\n (isBinaryExpression(parent) &&\n parent.operator === \"**\" &&\n parent.left === node) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport function FunctionExpression(\n node: t.FunctionExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n return Boolean(\n tokenContext &\n (TokenContext.expressionStatement | TokenContext.exportDefault),\n );\n}\n\nexport function ConditionalExpression(\n node:\n | t.ConditionalExpression\n | t.ArrowFunctionExpression\n | t.AssignmentExpression,\n parent?: t.Node,\n): boolean {\n const parentType = parent.type;\n if (\n parentType === \"UnaryExpression\" ||\n parentType === \"SpreadElement\" ||\n parentType === \"BinaryExpression\" ||\n parentType === \"LogicalExpression\" ||\n (parentType === \"ConditionalExpression\" && parent.test === node) ||\n parentType === \"AwaitExpression\" ||\n isTSTypeExpression(parentType)\n ) {\n return true;\n }\n\n return UnaryLike(node, parent);\n}\n\nexport { ConditionalExpression as ArrowFunctionExpression };\n\nexport function OptionalMemberExpression(\n node: t.OptionalMemberExpression,\n parent: t.Node,\n): boolean {\n return (\n (isCallExpression(parent) && parent.callee === node) ||\n (isMemberExpression(parent) && parent.object === node)\n );\n}\n\nexport { OptionalMemberExpression as OptionalCallExpression };\n\nexport function AssignmentExpression(\n node: t.AssignmentExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n if (\n needsParenBeforeExpressionBrace(tokenContext) &&\n isObjectPattern(node.left)\n ) {\n return true;\n } else {\n return ConditionalExpression(node, parent);\n }\n}\n\nexport function LogicalExpression(\n node: t.LogicalExpression,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n if (isTSTypeExpression(parentType)) return true;\n if (parentType !== \"LogicalExpression\") return false;\n switch (node.operator) {\n case \"||\":\n return parent.operator === \"??\" || parent.operator === \"&&\";\n case \"&&\":\n return parent.operator === \"??\";\n case \"??\":\n return parent.operator !== \"??\";\n }\n}\n\nexport function Identifier(\n node: t.Identifier,\n parent: t.Node,\n tokenContext: number,\n _inForInit: boolean,\n getRawIdentifier: (node: t.Identifier) => string,\n): boolean {\n const parentType = parent.type;\n // 13.15.2 AssignmentExpression RS: Evaluation\n // (fn) = function () {};\n if (\n node.extra?.parenthesized &&\n parentType === \"AssignmentExpression\" &&\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 if (getRawIdentifier && getRawIdentifier(node) !== node.name) {\n return false;\n }\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.forHead |\n TokenContext.forInHead)\n ) {\n return true;\n }\n return Boolean(tokenContext & TokenContext.forOfHead);\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 node.name === \"async\" &&\n isForOfStatement(parent, { left: node, await: false })\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAcA,IAAAC,MAAA,GAAAD,OAAA;AAA0C;EAbxCE,qBAAqB;EACrBC,kBAAkB;EAClBC,gBAAgB;EAChBC,gBAAgB;EAChBC,mBAAmB;EACnBC,kBAAkB;EAClBC,eAAe;EACfC,0BAA0B;EAC1BC,iBAAiB;EACjBC;AAAW,IAAAZ,EAAA;AAMb,MAAMa,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,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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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.nodes = void 0;
|
| 7 |
+
var _t = require("@babel/types");
|
| 8 |
+
const {
|
| 9 |
+
FLIPPED_ALIAS_KEYS,
|
| 10 |
+
isArrayExpression,
|
| 11 |
+
isAssignmentExpression,
|
| 12 |
+
isBinary,
|
| 13 |
+
isBlockStatement,
|
| 14 |
+
isCallExpression,
|
| 15 |
+
isFunction,
|
| 16 |
+
isIdentifier,
|
| 17 |
+
isLiteral,
|
| 18 |
+
isMemberExpression,
|
| 19 |
+
isObjectExpression,
|
| 20 |
+
isOptionalCallExpression,
|
| 21 |
+
isOptionalMemberExpression,
|
| 22 |
+
isStringLiteral
|
| 23 |
+
} = _t;
|
| 24 |
+
function crawlInternal(node, state) {
|
| 25 |
+
if (!node) return state;
|
| 26 |
+
if (isMemberExpression(node) || isOptionalMemberExpression(node)) {
|
| 27 |
+
crawlInternal(node.object, state);
|
| 28 |
+
if (node.computed) crawlInternal(node.property, state);
|
| 29 |
+
} else if (isBinary(node) || isAssignmentExpression(node)) {
|
| 30 |
+
crawlInternal(node.left, state);
|
| 31 |
+
crawlInternal(node.right, state);
|
| 32 |
+
} else if (isCallExpression(node) || isOptionalCallExpression(node)) {
|
| 33 |
+
state.hasCall = true;
|
| 34 |
+
crawlInternal(node.callee, state);
|
| 35 |
+
} else if (isFunction(node)) {
|
| 36 |
+
state.hasFunction = true;
|
| 37 |
+
} else if (isIdentifier(node)) {
|
| 38 |
+
state.hasHelper = state.hasHelper || node.callee && isHelper(node.callee);
|
| 39 |
+
}
|
| 40 |
+
return state;
|
| 41 |
+
}
|
| 42 |
+
function crawl(node) {
|
| 43 |
+
return crawlInternal(node, {
|
| 44 |
+
hasCall: false,
|
| 45 |
+
hasFunction: false,
|
| 46 |
+
hasHelper: false
|
| 47 |
+
});
|
| 48 |
+
}
|
| 49 |
+
function isHelper(node) {
|
| 50 |
+
if (!node) return false;
|
| 51 |
+
if (isMemberExpression(node)) {
|
| 52 |
+
return isHelper(node.object) || isHelper(node.property);
|
| 53 |
+
} else if (isIdentifier(node)) {
|
| 54 |
+
return node.name === "require" || node.name.charCodeAt(0) === 95;
|
| 55 |
+
} else if (isCallExpression(node)) {
|
| 56 |
+
return isHelper(node.callee);
|
| 57 |
+
} else if (isBinary(node) || isAssignmentExpression(node)) {
|
| 58 |
+
return isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
|
| 59 |
+
} else {
|
| 60 |
+
return false;
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
function isType(node) {
|
| 64 |
+
return isLiteral(node) || isObjectExpression(node) || isArrayExpression(node) || isIdentifier(node) || isMemberExpression(node);
|
| 65 |
+
}
|
| 66 |
+
const nodes = exports.nodes = {
|
| 67 |
+
AssignmentExpression(node) {
|
| 68 |
+
const state = crawl(node.right);
|
| 69 |
+
if (state.hasCall && state.hasHelper || state.hasFunction) {
|
| 70 |
+
return state.hasFunction ? 1 | 2 : 2;
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
SwitchCase(node, parent) {
|
| 74 |
+
return (!!node.consequent.length || parent.cases[0] === node ? 1 : 0) | (!node.consequent.length && parent.cases[parent.cases.length - 1] === node ? 2 : 0);
|
| 75 |
+
},
|
| 76 |
+
LogicalExpression(node) {
|
| 77 |
+
if (isFunction(node.left) || isFunction(node.right)) {
|
| 78 |
+
return 2;
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
Literal(node) {
|
| 82 |
+
if (isStringLiteral(node) && node.value === "use strict") {
|
| 83 |
+
return 2;
|
| 84 |
+
}
|
| 85 |
+
},
|
| 86 |
+
CallExpression(node) {
|
| 87 |
+
if (isFunction(node.callee) || isHelper(node)) {
|
| 88 |
+
return 1 | 2;
|
| 89 |
+
}
|
| 90 |
+
},
|
| 91 |
+
OptionalCallExpression(node) {
|
| 92 |
+
if (isFunction(node.callee)) {
|
| 93 |
+
return 1 | 2;
|
| 94 |
+
}
|
| 95 |
+
},
|
| 96 |
+
VariableDeclaration(node) {
|
| 97 |
+
for (let i = 0; i < node.declarations.length; i++) {
|
| 98 |
+
const declar = node.declarations[i];
|
| 99 |
+
let enabled = isHelper(declar.id) && !isType(declar.init);
|
| 100 |
+
if (!enabled && declar.init) {
|
| 101 |
+
const state = crawl(declar.init);
|
| 102 |
+
enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
|
| 103 |
+
}
|
| 104 |
+
if (enabled) {
|
| 105 |
+
return 1 | 2;
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
},
|
| 109 |
+
IfStatement(node) {
|
| 110 |
+
if (isBlockStatement(node.consequent)) {
|
| 111 |
+
return 1 | 2;
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
};
|
| 115 |
+
nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) {
|
| 116 |
+
if (parent.properties[0] === node) {
|
| 117 |
+
return 1;
|
| 118 |
+
}
|
| 119 |
+
};
|
| 120 |
+
nodes.ObjectTypeCallProperty = function (node, parent) {
|
| 121 |
+
var _parent$properties;
|
| 122 |
+
if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) != null && _parent$properties.length)) {
|
| 123 |
+
return 1;
|
| 124 |
+
}
|
| 125 |
+
};
|
| 126 |
+
nodes.ObjectTypeIndexer = function (node, parent) {
|
| 127 |
+
var _parent$properties2, _parent$callPropertie;
|
| 128 |
+
if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) != null && _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) != null && _parent$callPropertie.length)) {
|
| 129 |
+
return 1;
|
| 130 |
+
}
|
| 131 |
+
};
|
| 132 |
+
nodes.ObjectTypeInternalSlot = function (node, parent) {
|
| 133 |
+
var _parent$properties3, _parent$callPropertie2, _parent$indexers;
|
| 134 |
+
if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) != null && _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) != null && _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) != null && _parent$indexers.length)) {
|
| 135 |
+
return 1;
|
| 136 |
+
}
|
| 137 |
+
};
|
| 138 |
+
[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) {
|
| 139 |
+
[type].concat(FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
|
| 140 |
+
const ret = amounts ? 1 | 2 : 0;
|
| 141 |
+
nodes[type] = () => ret;
|
| 142 |
+
});
|
| 143 |
+
});
|
| 144 |
+
|
| 145 |
+
//# sourceMappingURL=whitespace.js.map
|
ui/node_modules/@babel/generator/lib/node/whitespace.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","FLIPPED_ALIAS_KEYS","isArrayExpression","isAssignmentExpression","isBinary","isBlockStatement","isCallExpression","isFunction","isIdentifier","isLiteral","isMemberExpression","isObjectExpression","isOptionalCallExpression","isOptionalMemberExpression","isStringLiteral","crawlInternal","node","state","object","computed","property","left","right","hasCall","callee","hasFunction","hasHelper","isHelper","crawl","name","charCodeAt","isType","nodes","exports","AssignmentExpression","SwitchCase","parent","consequent","length","cases","LogicalExpression","Literal","value","CallExpression","OptionalCallExpression","VariableDeclaration","i","declarations","declar","enabled","id","init","IfStatement","ObjectProperty","ObjectTypeProperty","ObjectMethod","properties","ObjectTypeCallProperty","_parent$properties","callProperties","ObjectTypeIndexer","_parent$properties2","_parent$callPropertie","indexers","ObjectTypeInternalSlot","_parent$properties3","_parent$callPropertie2","_parent$indexers","internalSlots","forEach","type","amounts","concat","ret"],"sources":["../../src/node/whitespace.ts"],"sourcesContent":["import {\n FLIPPED_ALIAS_KEYS,\n isArrayExpression,\n isAssignmentExpression,\n isBinary,\n isBlockStatement,\n isCallExpression,\n isFunction,\n isIdentifier,\n isLiteral,\n isMemberExpression,\n isObjectExpression,\n isOptionalCallExpression,\n isOptionalMemberExpression,\n isStringLiteral,\n} from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\nimport type { NodeHandlers } from \"./index.ts\";\n\nimport type * as t from \"@babel/types\";\n\nconst enum WhitespaceFlag {\n before = 1 << 0,\n after = 1 << 1,\n}\n\nexport type { WhitespaceFlag };\n\nfunction crawlInternal(\n node: t.Node,\n state: { hasCall: boolean; hasFunction: boolean; hasHelper: boolean },\n) {\n if (!node) return state;\n\n if (isMemberExpression(node) || isOptionalMemberExpression(node)) {\n crawlInternal(node.object, state);\n if (node.computed) crawlInternal(node.property, state);\n } else if (isBinary(node) || isAssignmentExpression(node)) {\n crawlInternal(node.left, state);\n crawlInternal(node.right, state);\n } else if (isCallExpression(node) || isOptionalCallExpression(node)) {\n state.hasCall = true;\n crawlInternal(node.callee, state);\n } else if (isFunction(node)) {\n state.hasFunction = true;\n } else if (isIdentifier(node)) {\n state.hasHelper =\n // @ts-expect-error todo(flow->ts): node.callee is not really expected here…\n state.hasHelper || (node.callee && isHelper(node.callee));\n }\n\n return state;\n}\n\n/**\n * Crawl a node to test if it contains a CallExpression, a Function, or a Helper.\n *\n * @example\n * crawl(node)\n * // { hasCall: false, hasFunction: true, hasHelper: false }\n */\n\nfunction crawl(node: t.Node) {\n return crawlInternal(node, {\n hasCall: false,\n hasFunction: false,\n hasHelper: false,\n });\n}\n\n/**\n * Test if a node is or has a helper.\n */\n\nfunction isHelper(node: t.Node): boolean {\n if (!node) return false;\n\n if (isMemberExpression(node)) {\n return isHelper(node.object) || isHelper(node.property);\n } else if (isIdentifier(node)) {\n return (\n node.name === \"require\" ||\n node.name.charCodeAt(0) === charCodes.underscore\n );\n } else if (isCallExpression(node)) {\n return isHelper(node.callee);\n } else if (isBinary(node) || isAssignmentExpression(node)) {\n return (\n (isIdentifier(node.left) && isHelper(node.left)) || isHelper(node.right)\n );\n } else {\n return false;\n }\n}\n\nfunction isType(node: t.Node) {\n return (\n isLiteral(node) ||\n isObjectExpression(node) ||\n isArrayExpression(node) ||\n isIdentifier(node) ||\n isMemberExpression(node)\n );\n}\n\n/**\n * Tests for node types that need whitespace.\n */\n\nexport const nodes: NodeHandlers<WhitespaceFlag> = {\n /**\n * Test if AssignmentExpression needs whitespace.\n */\n\n AssignmentExpression(node: t.AssignmentExpression): WhitespaceFlag {\n const state = crawl(node.right);\n if ((state.hasCall && state.hasHelper) || state.hasFunction) {\n return state.hasFunction\n ? WhitespaceFlag.before | WhitespaceFlag.after\n : WhitespaceFlag.after;\n }\n },\n\n /**\n * Test if SwitchCase needs whitespace.\n */\n\n SwitchCase(node: t.SwitchCase, parent: t.SwitchStatement): WhitespaceFlag {\n return (\n (!!node.consequent.length || parent.cases[0] === node\n ? WhitespaceFlag.before\n : 0) |\n (!node.consequent.length && parent.cases[parent.cases.length - 1] === node\n ? WhitespaceFlag.after\n : 0)\n );\n },\n\n /**\n * Test if LogicalExpression needs whitespace.\n */\n\n LogicalExpression(node: t.LogicalExpression): WhitespaceFlag {\n if (isFunction(node.left) || isFunction(node.right)) {\n return WhitespaceFlag.after;\n }\n },\n\n /**\n * Test if Literal needs whitespace.\n */\n\n Literal(node: t.Literal): WhitespaceFlag {\n if (isStringLiteral(node) && node.value === \"use strict\") {\n return WhitespaceFlag.after;\n }\n },\n\n /**\n * Test if CallExpressionish needs whitespace.\n */\n\n CallExpression(node: t.CallExpression): WhitespaceFlag {\n if (isFunction(node.callee) || isHelper(node)) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n },\n\n OptionalCallExpression(node: t.OptionalCallExpression): WhitespaceFlag {\n if (isFunction(node.callee)) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n },\n\n /**\n * Test if VariableDeclaration needs whitespace.\n */\n\n VariableDeclaration(node: t.VariableDeclaration): WhitespaceFlag {\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n\n let enabled = isHelper(declar.id) && !isType(declar.init);\n if (!enabled && declar.init) {\n const state = crawl(declar.init);\n enabled = (isHelper(declar.init) && state.hasCall) || state.hasFunction;\n }\n\n if (enabled) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n }\n },\n\n /**\n * Test if IfStatement needs whitespace.\n */\n\n IfStatement(node: t.IfStatement): WhitespaceFlag {\n if (isBlockStatement(node.consequent)) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n },\n};\n\n/**\n * Test if Property needs whitespace.\n */\n\nnodes.ObjectProperty =\n nodes.ObjectTypeProperty =\n nodes.ObjectMethod =\n function (\n node: t.ObjectProperty | t.ObjectTypeProperty | t.ObjectMethod,\n parent: t.ObjectExpression,\n ): WhitespaceFlag {\n if (parent.properties[0] === node) {\n return WhitespaceFlag.before;\n }\n };\n\nnodes.ObjectTypeCallProperty = function (\n node: t.ObjectTypeCallProperty,\n parent: t.ObjectTypeAnnotation,\n): WhitespaceFlag {\n if (parent.callProperties[0] === node && !parent.properties?.length) {\n return WhitespaceFlag.before;\n }\n};\n\nnodes.ObjectTypeIndexer = function (\n node: t.ObjectTypeIndexer,\n parent: t.ObjectTypeAnnotation,\n): WhitespaceFlag {\n if (\n parent.indexers[0] === node &&\n !parent.properties?.length &&\n !parent.callProperties?.length\n ) {\n return WhitespaceFlag.before;\n }\n};\n\nnodes.ObjectTypeInternalSlot = function (\n node: t.ObjectTypeInternalSlot,\n parent: t.ObjectTypeAnnotation,\n): WhitespaceFlag {\n if (\n parent.internalSlots[0] === node &&\n !parent.properties?.length &&\n !parent.callProperties?.length &&\n !parent.indexers?.length\n ) {\n return WhitespaceFlag.before;\n }\n};\n\n/**\n * Add whitespace tests for nodes and their aliases.\n */\n\n(\n [\n [\"Function\", true],\n [\"Class\", true],\n [\"Loop\", true],\n [\"LabeledStatement\", true],\n [\"SwitchStatement\", true],\n [\"TryStatement\", true],\n ] as const\n).forEach(function ([type, amounts]) {\n [type as string]\n .concat(FLIPPED_ALIAS_KEYS[type] || [])\n .forEach(function (type) {\n const ret = amounts ? WhitespaceFlag.before | WhitespaceFlag.after : 0;\n nodes[type] = () => ret;\n });\n});\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAesB;EAdpBC,kBAAkB;EAClBC,iBAAiB;EACjBC,sBAAsB;EACtBC,QAAQ;EACRC,gBAAgB;EAChBC,gBAAgB;EAChBC,UAAU;EACVC,YAAY;EACZC,SAAS;EACTC,kBAAkB;EAClBC,kBAAkB;EAClBC,wBAAwB;EACxBC,0BAA0B;EAC1BC;AAAe,IAAAf,EAAA;AAkBjB,SAASgB,aAAaA,CACpBC,IAAY,EACZC,KAAqE,EACrE;EACA,IAAI,CAACD,IAAI,EAAE,OAAOC,KAAK;EAEvB,IAAIP,kBAAkB,CAACM,IAAI,CAAC,IAAIH,0BAA0B,CAACG,IAAI,CAAC,EAAE;IAChED,aAAa,CAACC,IAAI,CAACE,MAAM,EAAED,KAAK,CAAC;IACjC,IAAID,IAAI,CAACG,QAAQ,EAAEJ,aAAa,CAACC,IAAI,CAACI,QAAQ,EAAEH,KAAK,CAAC;EACxD,CAAC,MAAM,IAAIb,QAAQ,CAACY,IAAI,CAAC,IAAIb,sBAAsB,CAACa,IAAI,CAAC,EAAE;IACzDD,aAAa,CAACC,IAAI,CAACK,IAAI,EAAEJ,KAAK,CAAC;IAC/BF,aAAa,CAACC,IAAI,CAACM,KAAK,EAAEL,K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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 n = require("./node/index.js");
|
| 9 |
+
var _t = require("@babel/types");
|
| 10 |
+
var _tokenMap = require("./token-map.js");
|
| 11 |
+
var generatorFunctions = require("./generators/index.js");
|
| 12 |
+
var _deprecated = require("./generators/deprecated.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 |
+
const {
|
| 29 |
+
needsParens
|
| 30 |
+
} = n;
|
| 31 |
+
class Printer {
|
| 32 |
+
constructor(format, map, tokens, originalCode) {
|
| 33 |
+
this.inForStatementInit = false;
|
| 34 |
+
this.tokenContext = 0;
|
| 35 |
+
this._tokens = null;
|
| 36 |
+
this._originalCode = null;
|
| 37 |
+
this._currentNode = null;
|
| 38 |
+
this._indent = 0;
|
| 39 |
+
this._indentRepeat = 0;
|
| 40 |
+
this._insideAux = false;
|
| 41 |
+
this._noLineTerminator = false;
|
| 42 |
+
this._noLineTerminatorAfterNode = null;
|
| 43 |
+
this._printAuxAfterOnNextUserNode = false;
|
| 44 |
+
this._printedComments = new Set();
|
| 45 |
+
this._endsWithInteger = false;
|
| 46 |
+
this._endsWithWord = false;
|
| 47 |
+
this._endsWithDiv = false;
|
| 48 |
+
this._lastCommentLine = 0;
|
| 49 |
+
this._endsWithInnerRaw = false;
|
| 50 |
+
this._indentInnerComments = true;
|
| 51 |
+
this.tokenMap = null;
|
| 52 |
+
this._boundGetRawIdentifier = this._getRawIdentifier.bind(this);
|
| 53 |
+
this._printSemicolonBeforeNextNode = -1;
|
| 54 |
+
this._printSemicolonBeforeNextToken = -1;
|
| 55 |
+
this.format = format;
|
| 56 |
+
this._tokens = tokens;
|
| 57 |
+
this._originalCode = originalCode;
|
| 58 |
+
this._indentRepeat = format.indent.style.length;
|
| 59 |
+
this._inputMap = map == null ? void 0 : map._inputMap;
|
| 60 |
+
this._buf = new _buffer.default(map, format.indent.style[0]);
|
| 61 |
+
}
|
| 62 |
+
enterForStatementInit() {
|
| 63 |
+
if (this.inForStatementInit) return () => {};
|
| 64 |
+
this.inForStatementInit = true;
|
| 65 |
+
return () => {
|
| 66 |
+
this.inForStatementInit = false;
|
| 67 |
+
};
|
| 68 |
+
}
|
| 69 |
+
enterDelimited() {
|
| 70 |
+
const oldInForStatementInit = this.inForStatementInit;
|
| 71 |
+
const oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
|
| 72 |
+
if (oldInForStatementInit === false && oldNoLineTerminatorAfterNode === null) {
|
| 73 |
+
return () => {};
|
| 74 |
+
}
|
| 75 |
+
this.inForStatementInit = false;
|
| 76 |
+
this._noLineTerminatorAfterNode = null;
|
| 77 |
+
return () => {
|
| 78 |
+
this.inForStatementInit = oldInForStatementInit;
|
| 79 |
+
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
| 80 |
+
};
|
| 81 |
+
}
|
| 82 |
+
generate(ast) {
|
| 83 |
+
if (this.format.preserveFormat) {
|
| 84 |
+
this.tokenMap = new _tokenMap.TokenMap(ast, this._tokens, this._originalCode);
|
| 85 |
+
}
|
| 86 |
+
this.print(ast);
|
| 87 |
+
this._maybeAddAuxComment();
|
| 88 |
+
return this._buf.get();
|
| 89 |
+
}
|
| 90 |
+
indent() {
|
| 91 |
+
const {
|
| 92 |
+
format
|
| 93 |
+
} = this;
|
| 94 |
+
if (format.preserveFormat || format.compact || format.concise) {
|
| 95 |
+
return;
|
| 96 |
+
}
|
| 97 |
+
this._indent++;
|
| 98 |
+
}
|
| 99 |
+
dedent() {
|
| 100 |
+
const {
|
| 101 |
+
format
|
| 102 |
+
} = this;
|
| 103 |
+
if (format.preserveFormat || format.compact || format.concise) {
|
| 104 |
+
return;
|
| 105 |
+
}
|
| 106 |
+
this._indent--;
|
| 107 |
+
}
|
| 108 |
+
semicolon(force = false) {
|
| 109 |
+
this._maybeAddAuxComment();
|
| 110 |
+
if (force) {
|
| 111 |
+
this._appendChar(59);
|
| 112 |
+
this._noLineTerminator = false;
|
| 113 |
+
return;
|
| 114 |
+
}
|
| 115 |
+
if (this.tokenMap) {
|
| 116 |
+
const node = this._currentNode;
|
| 117 |
+
if (node.start != null && node.end != null) {
|
| 118 |
+
if (!this.tokenMap.endMatches(node, ";")) {
|
| 119 |
+
this._printSemicolonBeforeNextNode = this._buf.getCurrentLine();
|
| 120 |
+
return;
|
| 121 |
+
}
|
| 122 |
+
const indexes = this.tokenMap.getIndexes(this._currentNode);
|
| 123 |
+
this._catchUpTo(this._tokens[indexes[indexes.length - 1]].loc.start);
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
this._queue(59);
|
| 127 |
+
this._noLineTerminator = false;
|
| 128 |
+
}
|
| 129 |
+
rightBrace(node) {
|
| 130 |
+
if (this.format.minified) {
|
| 131 |
+
this._buf.removeLastSemicolon();
|
| 132 |
+
}
|
| 133 |
+
this.sourceWithOffset("end", node.loc, -1);
|
| 134 |
+
this.tokenChar(125);
|
| 135 |
+
}
|
| 136 |
+
rightParens(node) {
|
| 137 |
+
this.sourceWithOffset("end", node.loc, -1);
|
| 138 |
+
this.tokenChar(41);
|
| 139 |
+
}
|
| 140 |
+
space(force = false) {
|
| 141 |
+
const {
|
| 142 |
+
format
|
| 143 |
+
} = this;
|
| 144 |
+
if (format.compact || format.preserveFormat) return;
|
| 145 |
+
if (force) {
|
| 146 |
+
this._space();
|
| 147 |
+
} else if (this._buf.hasContent()) {
|
| 148 |
+
const lastCp = this.getLastChar();
|
| 149 |
+
if (lastCp !== 32 && lastCp !== 10) {
|
| 150 |
+
this._space();
|
| 151 |
+
}
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
+
word(str, noLineTerminatorAfter = false) {
|
| 155 |
+
this.tokenContext = 0;
|
| 156 |
+
this._maybePrintInnerComments(str);
|
| 157 |
+
this._maybeAddAuxComment();
|
| 158 |
+
if (this.tokenMap) this._catchUpToCurrentToken(str);
|
| 159 |
+
if (this._endsWithWord || this._endsWithDiv && str.charCodeAt(0) === 47) {
|
| 160 |
+
this._space();
|
| 161 |
+
}
|
| 162 |
+
this._append(str, false);
|
| 163 |
+
this._endsWithWord = true;
|
| 164 |
+
this._noLineTerminator = noLineTerminatorAfter;
|
| 165 |
+
}
|
| 166 |
+
number(str, number) {
|
| 167 |
+
function isNonDecimalLiteral(str) {
|
| 168 |
+
if (str.length > 2 && str.charCodeAt(0) === 48) {
|
| 169 |
+
const secondChar = str.charCodeAt(1);
|
| 170 |
+
return secondChar === 98 || secondChar === 111 || secondChar === 120;
|
| 171 |
+
}
|
| 172 |
+
return false;
|
| 173 |
+
}
|
| 174 |
+
this.word(str);
|
| 175 |
+
this._endsWithInteger = Number.isInteger(number) && !isNonDecimalLiteral(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46;
|
| 176 |
+
}
|
| 177 |
+
token(str, maybeNewline = false, occurrenceCount = 0) {
|
| 178 |
+
this.tokenContext = 0;
|
| 179 |
+
this._maybePrintInnerComments(str, occurrenceCount);
|
| 180 |
+
this._maybeAddAuxComment();
|
| 181 |
+
if (this.tokenMap) this._catchUpToCurrentToken(str, occurrenceCount);
|
| 182 |
+
const lastChar = this.getLastChar();
|
| 183 |
+
const strFirst = str.charCodeAt(0);
|
| 184 |
+
if (lastChar === 33 && (str === "--" || strFirst === 61) || strFirst === 43 && lastChar === 43 || strFirst === 45 && lastChar === 45 || strFirst === 46 && this._endsWithInteger) {
|
| 185 |
+
this._space();
|
| 186 |
+
}
|
| 187 |
+
this._append(str, maybeNewline);
|
| 188 |
+
this._noLineTerminator = false;
|
| 189 |
+
}
|
| 190 |
+
tokenChar(char) {
|
| 191 |
+
this.tokenContext = 0;
|
| 192 |
+
const str = String.fromCharCode(char);
|
| 193 |
+
this._maybePrintInnerComments(str);
|
| 194 |
+
this._maybeAddAuxComment();
|
| 195 |
+
if (this.tokenMap) this._catchUpToCurrentToken(str);
|
| 196 |
+
const lastChar = this.getLastChar();
|
| 197 |
+
if (char === 43 && lastChar === 43 || char === 45 && lastChar === 45 || char === 46 && this._endsWithInteger) {
|
| 198 |
+
this._space();
|
| 199 |
+
}
|
| 200 |
+
this._appendChar(char);
|
| 201 |
+
this._noLineTerminator = false;
|
| 202 |
+
}
|
| 203 |
+
newline(i = 1, force) {
|
| 204 |
+
if (i <= 0) return;
|
| 205 |
+
if (!force) {
|
| 206 |
+
if (this.format.retainLines || this.format.compact) return;
|
| 207 |
+
if (this.format.concise) {
|
| 208 |
+
this.space();
|
| 209 |
+
return;
|
| 210 |
+
}
|
| 211 |
+
}
|
| 212 |
+
if (i > 2) i = 2;
|
| 213 |
+
i -= this._buf.getNewlineCount();
|
| 214 |
+
for (let j = 0; j < i; j++) {
|
| 215 |
+
this._newline();
|
| 216 |
+
}
|
| 217 |
+
return;
|
| 218 |
+
}
|
| 219 |
+
endsWith(char) {
|
| 220 |
+
return this.getLastChar() === char;
|
| 221 |
+
}
|
| 222 |
+
getLastChar() {
|
| 223 |
+
return this._buf.getLastChar();
|
| 224 |
+
}
|
| 225 |
+
endsWithCharAndNewline() {
|
| 226 |
+
return this._buf.endsWithCharAndNewline();
|
| 227 |
+
}
|
| 228 |
+
removeTrailingNewline() {
|
| 229 |
+
this._buf.removeTrailingNewline();
|
| 230 |
+
}
|
| 231 |
+
exactSource(loc, cb) {
|
| 232 |
+
if (!loc) {
|
| 233 |
+
cb();
|
| 234 |
+
return;
|
| 235 |
+
}
|
| 236 |
+
this._catchUp("start", loc);
|
| 237 |
+
this._buf.exactSource(loc, cb);
|
| 238 |
+
}
|
| 239 |
+
source(prop, loc) {
|
| 240 |
+
if (!loc) return;
|
| 241 |
+
this._catchUp(prop, loc);
|
| 242 |
+
this._buf.source(prop, loc);
|
| 243 |
+
}
|
| 244 |
+
sourceWithOffset(prop, loc, columnOffset) {
|
| 245 |
+
if (!loc || this.format.preserveFormat) return;
|
| 246 |
+
this._catchUp(prop, loc);
|
| 247 |
+
this._buf.sourceWithOffset(prop, loc, columnOffset);
|
| 248 |
+
}
|
| 249 |
+
sourceIdentifierName(identifierName, pos) {
|
| 250 |
+
if (!this._buf._canMarkIdName) return;
|
| 251 |
+
const sourcePosition = this._buf._sourcePosition;
|
| 252 |
+
sourcePosition.identifierNamePos = pos;
|
| 253 |
+
sourcePosition.identifierName = identifierName;
|
| 254 |
+
}
|
| 255 |
+
_space() {
|
| 256 |
+
this._queue(32);
|
| 257 |
+
}
|
| 258 |
+
_newline() {
|
| 259 |
+
this._queue(10);
|
| 260 |
+
}
|
| 261 |
+
_catchUpToCurrentToken(str, occurrenceCount = 0) {
|
| 262 |
+
const token = this.tokenMap.findMatching(this._currentNode, str, occurrenceCount);
|
| 263 |
+
if (token) this._catchUpTo(token.loc.start);
|
| 264 |
+
if (this._printSemicolonBeforeNextToken !== -1 && this._printSemicolonBeforeNextToken === this._buf.getCurrentLine()) {
|
| 265 |
+
this._buf.appendChar(59);
|
| 266 |
+
this._endsWithWord = false;
|
| 267 |
+
this._endsWithInteger = false;
|
| 268 |
+
this._endsWithDiv = false;
|
| 269 |
+
}
|
| 270 |
+
this._printSemicolonBeforeNextToken = -1;
|
| 271 |
+
this._printSemicolonBeforeNextNode = -1;
|
| 272 |
+
}
|
| 273 |
+
_append(str, maybeNewline) {
|
| 274 |
+
this._maybeIndent(str.charCodeAt(0));
|
| 275 |
+
this._buf.append(str, maybeNewline);
|
| 276 |
+
this._endsWithWord = false;
|
| 277 |
+
this._endsWithInteger = false;
|
| 278 |
+
this._endsWithDiv = false;
|
| 279 |
+
}
|
| 280 |
+
_appendChar(char) {
|
| 281 |
+
this._maybeIndent(char);
|
| 282 |
+
this._buf.appendChar(char);
|
| 283 |
+
this._endsWithWord = false;
|
| 284 |
+
this._endsWithInteger = false;
|
| 285 |
+
this._endsWithDiv = false;
|
| 286 |
+
}
|
| 287 |
+
_queue(char) {
|
| 288 |
+
this._maybeIndent(char);
|
| 289 |
+
this._buf.queue(char);
|
| 290 |
+
this._endsWithWord = false;
|
| 291 |
+
this._endsWithInteger = false;
|
| 292 |
+
}
|
| 293 |
+
_maybeIndent(firstChar) {
|
| 294 |
+
if (this._indent && firstChar !== 10 && this.endsWith(10)) {
|
| 295 |
+
this._buf.queueIndentation(this._getIndent());
|
| 296 |
+
}
|
| 297 |
+
}
|
| 298 |
+
_shouldIndent(firstChar) {
|
| 299 |
+
if (this._indent && firstChar !== 10 && this.endsWith(10)) {
|
| 300 |
+
return true;
|
| 301 |
+
}
|
| 302 |
+
}
|
| 303 |
+
catchUp(line) {
|
| 304 |
+
if (!this.format.retainLines) return;
|
| 305 |
+
const count = line - this._buf.getCurrentLine();
|
| 306 |
+
for (let i = 0; i < count; i++) {
|
| 307 |
+
this._newline();
|
| 308 |
+
}
|
| 309 |
+
}
|
| 310 |
+
_catchUp(prop, loc) {
|
| 311 |
+
const {
|
| 312 |
+
format
|
| 313 |
+
} = this;
|
| 314 |
+
if (!format.preserveFormat) {
|
| 315 |
+
if (format.retainLines && loc != null && loc[prop]) {
|
| 316 |
+
this.catchUp(loc[prop].line);
|
| 317 |
+
}
|
| 318 |
+
return;
|
| 319 |
+
}
|
| 320 |
+
const pos = loc == null ? void 0 : loc[prop];
|
| 321 |
+
if (pos != null) this._catchUpTo(pos);
|
| 322 |
+
}
|
| 323 |
+
_catchUpTo({
|
| 324 |
+
line,
|
| 325 |
+
column,
|
| 326 |
+
index
|
| 327 |
+
}) {
|
| 328 |
+
const count = line - this._buf.getCurrentLine();
|
| 329 |
+
if (count > 0 && this._noLineTerminator) {
|
| 330 |
+
return;
|
| 331 |
+
}
|
| 332 |
+
for (let i = 0; i < count; i++) {
|
| 333 |
+
this._newline();
|
| 334 |
+
}
|
| 335 |
+
const spacesCount = count > 0 ? column : column - this._buf.getCurrentColumn();
|
| 336 |
+
if (spacesCount > 0) {
|
| 337 |
+
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);
|
| 338 |
+
this._append(spaces, false);
|
| 339 |
+
}
|
| 340 |
+
}
|
| 341 |
+
_getIndent() {
|
| 342 |
+
return this._indentRepeat * this._indent;
|
| 343 |
+
}
|
| 344 |
+
printTerminatorless(node) {
|
| 345 |
+
this._noLineTerminator = true;
|
| 346 |
+
this.print(node);
|
| 347 |
+
}
|
| 348 |
+
print(node, noLineTerminatorAfter, trailingCommentsLineOffset) {
|
| 349 |
+
var _node$extra, _node$leadingComments, _node$leadingComments2;
|
| 350 |
+
if (!node) return;
|
| 351 |
+
this._endsWithInnerRaw = false;
|
| 352 |
+
const nodeType = node.type;
|
| 353 |
+
const format = this.format;
|
| 354 |
+
const oldConcise = format.concise;
|
| 355 |
+
if (node._compact) {
|
| 356 |
+
format.concise = true;
|
| 357 |
+
}
|
| 358 |
+
const printMethod = this[nodeType];
|
| 359 |
+
if (printMethod === undefined) {
|
| 360 |
+
throw new ReferenceError(`unknown node of type ${JSON.stringify(nodeType)} with constructor ${JSON.stringify(node.constructor.name)}`);
|
| 361 |
+
}
|
| 362 |
+
const parent = this._currentNode;
|
| 363 |
+
this._currentNode = node;
|
| 364 |
+
if (this.tokenMap) {
|
| 365 |
+
this._printSemicolonBeforeNextToken = this._printSemicolonBeforeNextNode;
|
| 366 |
+
}
|
| 367 |
+
const oldInAux = this._insideAux;
|
| 368 |
+
this._insideAux = node.loc == null;
|
| 369 |
+
this._maybeAddAuxComment(this._insideAux && !oldInAux);
|
| 370 |
+
const parenthesized = (_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized;
|
| 371 |
+
let shouldPrintParens = parenthesized && format.preserveFormat || parenthesized && format.retainFunctionParens && nodeType === "FunctionExpression" || needsParens(node, parent, this.tokenContext, this.inForStatementInit, format.preserveFormat ? this._boundGetRawIdentifier : undefined);
|
| 372 |
+
if (!shouldPrintParens && parenthesized && (_node$leadingComments = node.leadingComments) != null && _node$leadingComments.length && node.leadingComments[0].type === "CommentBlock") {
|
| 373 |
+
const parentType = parent == null ? void 0 : parent.type;
|
| 374 |
+
switch (parentType) {
|
| 375 |
+
case "ExpressionStatement":
|
| 376 |
+
case "VariableDeclarator":
|
| 377 |
+
case "AssignmentExpression":
|
| 378 |
+
case "ReturnStatement":
|
| 379 |
+
break;
|
| 380 |
+
case "CallExpression":
|
| 381 |
+
case "OptionalCallExpression":
|
| 382 |
+
case "NewExpression":
|
| 383 |
+
if (parent.callee !== node) break;
|
| 384 |
+
default:
|
| 385 |
+
shouldPrintParens = true;
|
| 386 |
+
}
|
| 387 |
+
}
|
| 388 |
+
let indentParenthesized = false;
|
| 389 |
+
if (!shouldPrintParens && this._noLineTerminator && ((_node$leadingComments2 = node.leadingComments) != null && _node$leadingComments2.some(commentIsNewline) || this.format.retainLines && node.loc && node.loc.start.line > this._buf.getCurrentLine())) {
|
| 390 |
+
shouldPrintParens = true;
|
| 391 |
+
indentParenthesized = true;
|
| 392 |
+
}
|
| 393 |
+
let oldNoLineTerminatorAfterNode;
|
| 394 |
+
let oldInForStatementInitWasTrue;
|
| 395 |
+
if (!shouldPrintParens) {
|
| 396 |
+
noLineTerminatorAfter || (noLineTerminatorAfter = parent && this._noLineTerminatorAfterNode === parent && n.isLastChild(parent, node));
|
| 397 |
+
if (noLineTerminatorAfter) {
|
| 398 |
+
var _node$trailingComment;
|
| 399 |
+
if ((_node$trailingComment = node.trailingComments) != null && _node$trailingComment.some(commentIsNewline)) {
|
| 400 |
+
if (isExpression(node)) shouldPrintParens = true;
|
| 401 |
+
} else {
|
| 402 |
+
oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
|
| 403 |
+
this._noLineTerminatorAfterNode = node;
|
| 404 |
+
}
|
| 405 |
+
}
|
| 406 |
+
}
|
| 407 |
+
if (shouldPrintParens) {
|
| 408 |
+
this.tokenChar(40);
|
| 409 |
+
if (indentParenthesized) this.indent();
|
| 410 |
+
this._endsWithInnerRaw = false;
|
| 411 |
+
if (this.inForStatementInit) {
|
| 412 |
+
oldInForStatementInitWasTrue = true;
|
| 413 |
+
this.inForStatementInit = false;
|
| 414 |
+
}
|
| 415 |
+
oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;
|
| 416 |
+
this._noLineTerminatorAfterNode = null;
|
| 417 |
+
}
|
| 418 |
+
this._lastCommentLine = 0;
|
| 419 |
+
this._printLeadingComments(node, parent);
|
| 420 |
+
const loc = nodeType === "Program" || nodeType === "File" ? null : node.loc;
|
| 421 |
+
this.exactSource(loc, printMethod.bind(this, node, parent));
|
| 422 |
+
if (shouldPrintParens) {
|
| 423 |
+
this._printTrailingComments(node, parent);
|
| 424 |
+
if (indentParenthesized) {
|
| 425 |
+
this.dedent();
|
| 426 |
+
this.newline();
|
| 427 |
+
}
|
| 428 |
+
this.tokenChar(41);
|
| 429 |
+
this._noLineTerminator = noLineTerminatorAfter;
|
| 430 |
+
if (oldInForStatementInitWasTrue) this.inForStatementInit = true;
|
| 431 |
+
} else if (noLineTerminatorAfter && !this._noLineTerminator) {
|
| 432 |
+
this._noLineTerminator = true;
|
| 433 |
+
this._printTrailingComments(node, parent);
|
| 434 |
+
} else {
|
| 435 |
+
this._printTrailingComments(node, parent, trailingCommentsLineOffset);
|
| 436 |
+
}
|
| 437 |
+
this._currentNode = parent;
|
| 438 |
+
format.concise = oldConcise;
|
| 439 |
+
this._insideAux = oldInAux;
|
| 440 |
+
if (oldNoLineTerminatorAfterNode !== undefined) {
|
| 441 |
+
this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;
|
| 442 |
+
}
|
| 443 |
+
this._endsWithInnerRaw = false;
|
| 444 |
+
}
|
| 445 |
+
_maybeAddAuxComment(enteredPositionlessNode) {
|
| 446 |
+
if (enteredPositionlessNode) this._printAuxBeforeComment();
|
| 447 |
+
if (!this._insideAux) this._printAuxAfterComment();
|
| 448 |
+
}
|
| 449 |
+
_printAuxBeforeComment() {
|
| 450 |
+
if (this._printAuxAfterOnNextUserNode) return;
|
| 451 |
+
this._printAuxAfterOnNextUserNode = true;
|
| 452 |
+
const comment = this.format.auxiliaryCommentBefore;
|
| 453 |
+
if (comment) {
|
| 454 |
+
this._printComment({
|
| 455 |
+
type: "CommentBlock",
|
| 456 |
+
value: comment
|
| 457 |
+
}, 0);
|
| 458 |
+
}
|
| 459 |
+
}
|
| 460 |
+
_printAuxAfterComment() {
|
| 461 |
+
if (!this._printAuxAfterOnNextUserNode) return;
|
| 462 |
+
this._printAuxAfterOnNextUserNode = false;
|
| 463 |
+
const comment = this.format.auxiliaryCommentAfter;
|
| 464 |
+
if (comment) {
|
| 465 |
+
this._printComment({
|
| 466 |
+
type: "CommentBlock",
|
| 467 |
+
value: comment
|
| 468 |
+
}, 0);
|
| 469 |
+
}
|
| 470 |
+
}
|
| 471 |
+
getPossibleRaw(node) {
|
| 472 |
+
const extra = node.extra;
|
| 473 |
+
if ((extra == null ? void 0 : extra.raw) != null && extra.rawValue != null && node.value === extra.rawValue) {
|
| 474 |
+
return extra.raw;
|
| 475 |
+
}
|
| 476 |
+
}
|
| 477 |
+
printJoin(nodes, statement, indent, separator, printTrailingSeparator, addNewlines, iterator, trailingCommentsLineOffset) {
|
| 478 |
+
if (!(nodes != null && nodes.length)) return;
|
| 479 |
+
if (indent == null && this.format.retainLines) {
|
| 480 |
+
var _nodes$0$loc;
|
| 481 |
+
const startLine = (_nodes$0$loc = nodes[0].loc) == null ? void 0 : _nodes$0$loc.start.line;
|
| 482 |
+
if (startLine != null && startLine !== this._buf.getCurrentLine()) {
|
| 483 |
+
indent = true;
|
| 484 |
+
}
|
| 485 |
+
}
|
| 486 |
+
if (indent) this.indent();
|
| 487 |
+
const newlineOpts = {
|
| 488 |
+
addNewlines: addNewlines,
|
| 489 |
+
nextNodeStartLine: 0
|
| 490 |
+
};
|
| 491 |
+
const boundSeparator = separator == null ? void 0 : separator.bind(this);
|
| 492 |
+
const len = nodes.length;
|
| 493 |
+
for (let i = 0; i < len; i++) {
|
| 494 |
+
const node = nodes[i];
|
| 495 |
+
if (!node) continue;
|
| 496 |
+
if (statement) this._printNewline(i === 0, newlineOpts);
|
| 497 |
+
this.print(node, undefined, trailingCommentsLineOffset || 0);
|
| 498 |
+
iterator == null || iterator(node, i);
|
| 499 |
+
if (boundSeparator != null) {
|
| 500 |
+
if (i < len - 1) boundSeparator(i, false);else if (printTrailingSeparator) boundSeparator(i, true);
|
| 501 |
+
}
|
| 502 |
+
if (statement) {
|
| 503 |
+
var _node$trailingComment2;
|
| 504 |
+
if (!((_node$trailingComment2 = node.trailingComments) != null && _node$trailingComment2.length)) {
|
| 505 |
+
this._lastCommentLine = 0;
|
| 506 |
+
}
|
| 507 |
+
if (i + 1 === len) {
|
| 508 |
+
this.newline(1);
|
| 509 |
+
} else {
|
| 510 |
+
var _nextNode$loc;
|
| 511 |
+
const nextNode = nodes[i + 1];
|
| 512 |
+
newlineOpts.nextNodeStartLine = ((_nextNode$loc = nextNode.loc) == null ? void 0 : _nextNode$loc.start.line) || 0;
|
| 513 |
+
this._printNewline(true, newlineOpts);
|
| 514 |
+
}
|
| 515 |
+
}
|
| 516 |
+
}
|
| 517 |
+
if (indent) this.dedent();
|
| 518 |
+
}
|
| 519 |
+
printAndIndentOnComments(node) {
|
| 520 |
+
const indent = node.leadingComments && node.leadingComments.length > 0;
|
| 521 |
+
if (indent) this.indent();
|
| 522 |
+
this.print(node);
|
| 523 |
+
if (indent) this.dedent();
|
| 524 |
+
}
|
| 525 |
+
printBlock(parent) {
|
| 526 |
+
const node = parent.body;
|
| 527 |
+
if (node.type !== "EmptyStatement") {
|
| 528 |
+
this.space();
|
| 529 |
+
}
|
| 530 |
+
this.print(node);
|
| 531 |
+
}
|
| 532 |
+
_printTrailingComments(node, parent, lineOffset) {
|
| 533 |
+
const {
|
| 534 |
+
innerComments,
|
| 535 |
+
trailingComments
|
| 536 |
+
} = node;
|
| 537 |
+
if (innerComments != null && innerComments.length) {
|
| 538 |
+
this._printComments(2, innerComments, node, parent, lineOffset);
|
| 539 |
+
}
|
| 540 |
+
if (trailingComments != null && trailingComments.length) {
|
| 541 |
+
this._printComments(2, trailingComments, node, parent, lineOffset);
|
| 542 |
+
}
|
| 543 |
+
}
|
| 544 |
+
_printLeadingComments(node, parent) {
|
| 545 |
+
const comments = node.leadingComments;
|
| 546 |
+
if (!(comments != null && comments.length)) return;
|
| 547 |
+
this._printComments(0, comments, node, parent);
|
| 548 |
+
}
|
| 549 |
+
_maybePrintInnerComments(nextTokenStr, nextTokenOccurrenceCount) {
|
| 550 |
+
if (this._endsWithInnerRaw) {
|
| 551 |
+
var _this$tokenMap;
|
| 552 |
+
this.printInnerComments((_this$tokenMap = this.tokenMap) == null ? void 0 : _this$tokenMap.findMatching(this._currentNode, nextTokenStr, nextTokenOccurrenceCount));
|
| 553 |
+
}
|
| 554 |
+
this._endsWithInnerRaw = true;
|
| 555 |
+
this._indentInnerComments = true;
|
| 556 |
+
}
|
| 557 |
+
printInnerComments(nextToken) {
|
| 558 |
+
const node = this._currentNode;
|
| 559 |
+
const comments = node.innerComments;
|
| 560 |
+
if (!(comments != null && comments.length)) return;
|
| 561 |
+
const hasSpace = this.endsWith(32);
|
| 562 |
+
const indent = this._indentInnerComments;
|
| 563 |
+
const printedCommentsCount = this._printedComments.size;
|
| 564 |
+
if (indent) this.indent();
|
| 565 |
+
this._printComments(1, comments, node, undefined, undefined, nextToken);
|
| 566 |
+
if (hasSpace && printedCommentsCount !== this._printedComments.size) {
|
| 567 |
+
this.space();
|
| 568 |
+
}
|
| 569 |
+
if (indent) this.dedent();
|
| 570 |
+
}
|
| 571 |
+
noIndentInnerCommentsHere() {
|
| 572 |
+
this._indentInnerComments = false;
|
| 573 |
+
}
|
| 574 |
+
printSequence(nodes, indent, trailingCommentsLineOffset, addNewlines) {
|
| 575 |
+
this.printJoin(nodes, true, indent != null ? indent : false, undefined, undefined, addNewlines, undefined, trailingCommentsLineOffset);
|
| 576 |
+
}
|
| 577 |
+
printList(items, printTrailingSeparator, statement, indent, separator, iterator) {
|
| 578 |
+
this.printJoin(items, statement, indent, separator != null ? separator : commaSeparator, printTrailingSeparator, undefined, iterator);
|
| 579 |
+
}
|
| 580 |
+
shouldPrintTrailingComma(listEnd) {
|
| 581 |
+
if (!this.tokenMap) return null;
|
| 582 |
+
const listEndIndex = this.tokenMap.findLastIndex(this._currentNode, token => this.tokenMap.matchesOriginal(token, listEnd));
|
| 583 |
+
if (listEndIndex <= 0) return null;
|
| 584 |
+
return this.tokenMap.matchesOriginal(this._tokens[listEndIndex - 1], ",");
|
| 585 |
+
}
|
| 586 |
+
_printNewline(newLine, opts) {
|
| 587 |
+
const format = this.format;
|
| 588 |
+
if (format.retainLines || format.compact) return;
|
| 589 |
+
if (format.concise) {
|
| 590 |
+
this.space();
|
| 591 |
+
return;
|
| 592 |
+
}
|
| 593 |
+
if (!newLine) {
|
| 594 |
+
return;
|
| 595 |
+
}
|
| 596 |
+
const startLine = opts.nextNodeStartLine;
|
| 597 |
+
const lastCommentLine = this._lastCommentLine;
|
| 598 |
+
if (startLine > 0 && lastCommentLine > 0) {
|
| 599 |
+
const offset = startLine - lastCommentLine;
|
| 600 |
+
if (offset >= 0) {
|
| 601 |
+
this.newline(offset || 1);
|
| 602 |
+
return;
|
| 603 |
+
}
|
| 604 |
+
}
|
| 605 |
+
if (this._buf.hasContent()) {
|
| 606 |
+
this.newline(1);
|
| 607 |
+
}
|
| 608 |
+
}
|
| 609 |
+
_shouldPrintComment(comment, nextToken) {
|
| 610 |
+
if (comment.ignore) return 0;
|
| 611 |
+
if (this._printedComments.has(comment)) return 0;
|
| 612 |
+
if (this._noLineTerminator && HAS_NEWLINE_OR_BlOCK_COMMENT_END.test(comment.value)) {
|
| 613 |
+
return 2;
|
| 614 |
+
}
|
| 615 |
+
if (nextToken && this.tokenMap) {
|
| 616 |
+
const commentTok = this.tokenMap.find(this._currentNode, token => token.value === comment.value);
|
| 617 |
+
if (commentTok && commentTok.start > nextToken.start) {
|
| 618 |
+
return 2;
|
| 619 |
+
}
|
| 620 |
+
}
|
| 621 |
+
this._printedComments.add(comment);
|
| 622 |
+
if (!this.format.shouldPrintComment(comment.value)) {
|
| 623 |
+
return 0;
|
| 624 |
+
}
|
| 625 |
+
return 1;
|
| 626 |
+
}
|
| 627 |
+
_printComment(comment, skipNewLines) {
|
| 628 |
+
const noLineTerminator = this._noLineTerminator;
|
| 629 |
+
const isBlockComment = comment.type === "CommentBlock";
|
| 630 |
+
const printNewLines = isBlockComment && skipNewLines !== 1 && !this._noLineTerminator;
|
| 631 |
+
if (printNewLines && this._buf.hasContent() && skipNewLines !== 2) {
|
| 632 |
+
this.newline(1);
|
| 633 |
+
}
|
| 634 |
+
const lastCharCode = this.getLastChar();
|
| 635 |
+
if (lastCharCode !== 91 && lastCharCode !== 123 && lastCharCode !== 40) {
|
| 636 |
+
this.space();
|
| 637 |
+
}
|
| 638 |
+
let val;
|
| 639 |
+
if (isBlockComment) {
|
| 640 |
+
val = `/*${comment.value}*/`;
|
| 641 |
+
if (this.format.indent.adjustMultilineComment) {
|
| 642 |
+
var _comment$loc;
|
| 643 |
+
const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;
|
| 644 |
+
if (offset) {
|
| 645 |
+
const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
|
| 646 |
+
val = val.replace(newlineRegex, "\n");
|
| 647 |
+
}
|
| 648 |
+
if (this.format.concise) {
|
| 649 |
+
val = val.replace(/\n(?!$)/g, `\n`);
|
| 650 |
+
} else {
|
| 651 |
+
let indentSize = this.format.retainLines ? 0 : this._buf.getCurrentColumn();
|
| 652 |
+
if (this._shouldIndent(47) || this.format.retainLines) {
|
| 653 |
+
indentSize += this._getIndent();
|
| 654 |
+
}
|
| 655 |
+
val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`);
|
| 656 |
+
}
|
| 657 |
+
}
|
| 658 |
+
} else if (!noLineTerminator) {
|
| 659 |
+
val = `//${comment.value}`;
|
| 660 |
+
} else {
|
| 661 |
+
val = `/*${comment.value}*/`;
|
| 662 |
+
}
|
| 663 |
+
if (this._endsWithDiv) this._space();
|
| 664 |
+
if (this.tokenMap) {
|
| 665 |
+
const {
|
| 666 |
+
_printSemicolonBeforeNextToken,
|
| 667 |
+
_printSemicolonBeforeNextNode
|
| 668 |
+
} = this;
|
| 669 |
+
this._printSemicolonBeforeNextToken = -1;
|
| 670 |
+
this._printSemicolonBeforeNextNode = -1;
|
| 671 |
+
this.source("start", comment.loc);
|
| 672 |
+
this._append(val, isBlockComment);
|
| 673 |
+
this._printSemicolonBeforeNextNode = _printSemicolonBeforeNextNode;
|
| 674 |
+
this._printSemicolonBeforeNextToken = _printSemicolonBeforeNextToken;
|
| 675 |
+
} else {
|
| 676 |
+
this.source("start", comment.loc);
|
| 677 |
+
this._append(val, isBlockComment);
|
| 678 |
+
}
|
| 679 |
+
if (!isBlockComment && !noLineTerminator) {
|
| 680 |
+
this.newline(1, true);
|
| 681 |
+
}
|
| 682 |
+
if (printNewLines && skipNewLines !== 3) {
|
| 683 |
+
this.newline(1);
|
| 684 |
+
}
|
| 685 |
+
}
|
| 686 |
+
_printComments(type, comments, node, parent, lineOffset = 0, nextToken) {
|
| 687 |
+
const nodeLoc = node.loc;
|
| 688 |
+
const len = comments.length;
|
| 689 |
+
let hasLoc = !!nodeLoc;
|
| 690 |
+
const nodeStartLine = hasLoc ? nodeLoc.start.line : 0;
|
| 691 |
+
const nodeEndLine = hasLoc ? nodeLoc.end.line : 0;
|
| 692 |
+
let lastLine = 0;
|
| 693 |
+
let leadingCommentNewline = 0;
|
| 694 |
+
const maybeNewline = this._noLineTerminator ? function () {} : this.newline.bind(this);
|
| 695 |
+
for (let i = 0; i < len; i++) {
|
| 696 |
+
const comment = comments[i];
|
| 697 |
+
const shouldPrint = this._shouldPrintComment(comment, nextToken);
|
| 698 |
+
if (shouldPrint === 2) {
|
| 699 |
+
hasLoc = false;
|
| 700 |
+
break;
|
| 701 |
+
}
|
| 702 |
+
if (hasLoc && comment.loc && shouldPrint === 1) {
|
| 703 |
+
const commentStartLine = comment.loc.start.line;
|
| 704 |
+
const commentEndLine = comment.loc.end.line;
|
| 705 |
+
if (type === 0) {
|
| 706 |
+
let offset = 0;
|
| 707 |
+
if (i === 0) {
|
| 708 |
+
if (this._buf.hasContent() && (comment.type === "CommentLine" || commentStartLine !== commentEndLine)) {
|
| 709 |
+
offset = leadingCommentNewline = 1;
|
| 710 |
+
}
|
| 711 |
+
} else {
|
| 712 |
+
offset = commentStartLine - lastLine;
|
| 713 |
+
}
|
| 714 |
+
lastLine = commentEndLine;
|
| 715 |
+
maybeNewline(offset);
|
| 716 |
+
this._printComment(comment, 1);
|
| 717 |
+
if (i + 1 === len) {
|
| 718 |
+
maybeNewline(Math.max(nodeStartLine - lastLine, leadingCommentNewline));
|
| 719 |
+
lastLine = nodeStartLine;
|
| 720 |
+
}
|
| 721 |
+
} else if (type === 1) {
|
| 722 |
+
const offset = commentStartLine - (i === 0 ? nodeStartLine : lastLine);
|
| 723 |
+
lastLine = commentEndLine;
|
| 724 |
+
maybeNewline(offset);
|
| 725 |
+
this._printComment(comment, 1);
|
| 726 |
+
if (i + 1 === len) {
|
| 727 |
+
maybeNewline(Math.min(1, nodeEndLine - lastLine));
|
| 728 |
+
lastLine = nodeEndLine;
|
| 729 |
+
}
|
| 730 |
+
} else {
|
| 731 |
+
const offset = commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine);
|
| 732 |
+
lastLine = commentEndLine;
|
| 733 |
+
maybeNewline(offset);
|
| 734 |
+
this._printComment(comment, 1);
|
| 735 |
+
}
|
| 736 |
+
} else {
|
| 737 |
+
hasLoc = false;
|
| 738 |
+
if (shouldPrint !== 1) {
|
| 739 |
+
continue;
|
| 740 |
+
}
|
| 741 |
+
if (len === 1) {
|
| 742 |
+
const singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value);
|
| 743 |
+
const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent) && !isTSEnumMember(node);
|
| 744 |
+
if (type === 0) {
|
| 745 |
+
this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction(parent, {
|
| 746 |
+
body: node
|
| 747 |
+
}) ? 1 : 0);
|
| 748 |
+
} else if (shouldSkipNewline && type === 2) {
|
| 749 |
+
this._printComment(comment, 1);
|
| 750 |
+
} else {
|
| 751 |
+
this._printComment(comment, 0);
|
| 752 |
+
}
|
| 753 |
+
} else if (type === 1 && !(node.type === "ObjectExpression" && node.properties.length > 1) && node.type !== "ClassBody" && node.type !== "TSInterfaceBody") {
|
| 754 |
+
this._printComment(comment, i === 0 ? 2 : i === len - 1 ? 3 : 0);
|
| 755 |
+
} else {
|
| 756 |
+
this._printComment(comment, 0);
|
| 757 |
+
}
|
| 758 |
+
}
|
| 759 |
+
}
|
| 760 |
+
if (type === 2 && hasLoc && lastLine) {
|
| 761 |
+
this._lastCommentLine = lastLine;
|
| 762 |
+
}
|
| 763 |
+
}
|
| 764 |
+
}
|
| 765 |
+
Object.assign(Printer.prototype, generatorFunctions);
|
| 766 |
+
{
|
| 767 |
+
(0, _deprecated.addDeprecatedGenerators)(Printer);
|
| 768 |
+
}
|
| 769 |
+
var _default = exports.default = Printer;
|
| 770 |
+
function commaSeparator(occurrenceCount, last) {
|
| 771 |
+
this.token(",", false, occurrenceCount);
|
| 772 |
+
if (!last) this.space();
|
| 773 |
+
}
|
| 774 |
+
|
| 775 |
+
//# sourceMappingURL=printer.js.map
|
ui/node_modules/@babel/generator/lib/printer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_buffer","require","n","_t","_tokenMap","generatorFunctions","_deprecated","isExpression","isFunction","isStatement","isClassBody","isTSInterfaceBody","isTSEnumMember","SCIENTIFIC_NOTATION","ZERO_DECIMAL_INTEGER","HAS_NEWLINE","HAS_NEWLINE_OR_BlOCK_COMMENT_END","commentIsNewline","c","type","test","value","needsParens","Printer","constructor","format","map","tokens","originalCode","inForStatementInit","tokenContext","_tokens","_originalCode","_currentNode","_indent","_indentRepeat","_insideAux","_noLineTerminator","_noLineTerminatorAfterNode","_printAuxAfterOnNextUserNode","_printedComments","Set","_endsWithInteger","_endsWithWord","_endsWithDiv","_lastCommentLine","_endsWithInnerRaw","_indentInnerComments","tokenMap","_boundGetRawIdentifier","_getRawIdentifier","bind","_printSemicolonBeforeNextNode","_printSemicolonBeforeNextToken","indent","style","length","_inputMap","_buf","Buffer","enterForStatementInit","enterDelimited","oldInForStatementInit","oldNoLineTerminatorAfterNode","generate","ast","preserveFormat","TokenMap","print","_maybeAddAuxComment","get","compact","concise","dedent","semicolon","force","_appendChar","node","start","end","endMatches","getCurrentLine","indexes","getIndexes","_catchUpTo","loc","_queue","rightBrace","minified","removeLastSemicolon","sourceWithOffset","token","rightParens","space","_space","hasContent","lastCp","getLastChar","word","str","noLineTerminatorAfter","_maybePrintInnerComments","_catchUpToCurrentToken","charCodeAt","_append","number","isNonDecimalLiteral","secondChar","Number","isInteger","maybeNewline","occurrenceCount","lastChar","strFirst","tokenChar","char","String","fromCharCode","newline","i","retainLines","getNewlineCount","j","_newline","endsWith","endsWithCharAndNewline","removeTrailingNewline","exactSource","cb","_catchUp","source","prop","columnOffset","sourceIdentifierName","identifierName","pos","_canMarkIdName","sourcePosition","_sourcePosition","identifierNamePos","findMatching","appendChar","_maybeIndent","append","queue","firstChar","queueIndentation","_getIndent","_shouldIndent","catchUp","line","count","column","index","spacesCount","getCurrentColumn","spaces","slice","replace","repeat","printTerminatorless","trailingCommentsLineOffset","_node$extra","_node$leadingComments","_node$leadingComments2","nodeType","oldConcise","_compact","printMethod","undefined","ReferenceError","JSON","stringify","name","parent","oldInAux","parenthesized","extra","shouldPrintParens","retainFunctionParens","leadingComments","parentType","callee","indentParenthesized","some","oldInForStatementInitWasTrue","isLastChild","_node$trailingComment","trailingComments","_printLeadingComments","_printTrailingComments","enteredPositionlessNode","_printAuxBeforeComment","_printAuxAfterComment","comment","auxiliaryCommentBefore","_printComment","auxiliaryCommentAfter","getPossibleRaw","raw","rawValue","printJoin","nodes","statement","separator","printTrailingSeparator","addNewlines","iterator","_nodes$0$loc","startLine","newlineOpts","nextNodeStartLine","boundSeparator","len","_printNewline","_node$trailingComment2","_nextNode$loc","nextNode","printAndIndentOnComments","printBlock","body","lineOffset","innerComments","_printComments","comments","nextTokenStr","nextTokenOccurrenceCount","_this$tokenMap","printInnerComments","nextToken","hasSpace","printedCommentsCount","size","noIndentInnerCommentsHere","printSequence","printList","items","commaSeparator","shouldPrintTrailingComma","listEnd","listEndIndex","findLastIndex","matchesOriginal","newLine","opts","lastCommentLine","offset","_shouldPrintComment","ignore","has","commentTok","find","add","shouldPrintComment","skipNewLines","noLineTerminator","isBlockComment","printNewLines","lastCharCode","val","adjustMultilineComment","_comment$loc","newlineRegex","RegExp","indentSize","nodeLoc","hasLoc","nodeStartLine","nodeEndLine","lastLine","leadingCommentNewline","shouldPrint","commentStartLine","commentEndLine","Math","max","min","singleLine","shouldSkipNewline","properties","Object","assign","prototype","addDeprecatedGenerators","_default","exports","default","last"],"sources":["../src/printer.ts"],"sourcesContent":["import Buffer, { type Pos } from \"./buffer.ts\";\nimport type { Loc } from \"./buffer.ts\";\nimport * as n from \"./node/index.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\";\nimport type { GeneratorOptions } from \"./index.ts\";\nimport * as generatorFunctions from \"./generators/index.ts\";\nimport {\n addDeprecatedGenerators,\n type DeprecatedBabel7ASTTypes,\n} from \"./generators/deprecated.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\nconst { needsParens } = n;\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\nexport type Format = {\n shouldPrintComment: (comment: string) => boolean;\n preserveFormat: boolean;\n retainLines: boolean;\n retainFunctionParens: boolean;\n comments: boolean;\n auxiliaryCommentBefore: string;\n auxiliaryCommentAfter: string;\n compact: boolean | \"auto\";\n minified: boolean;\n concise: boolean;\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 */\n importAttributesKeyword?: \"with\" | \"assert\" | \"with-legacy\";\n};\n\ninterface AddNewlinesOptions {\n addNewlines(leading: boolean, node: t.Node): number;\n nextNodeStartLine: number;\n}\n\ninterface PrintSequenceOptions extends Partial<AddNewlinesOptions> {\n statement?: boolean;\n indent?: boolean;\n trailingCommentsLineOffset?: number;\n}\n\ninterface PrintListOptions {\n separator?: (this: Printer, occurrenceCount: number, last: boolean) => void;\n iterator?: (node: t.Node, index: number) => 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,\n tokens?: Token[],\n originalCode?: string,\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;\n\n this._buf = new Buffer(map, format.indent.style[0]);\n }\n declare _inputMap: TraceMap;\n\n declare format: Format;\n\n inForStatementInit: boolean = false;\n enterForStatementInit() {\n if (this.inForStatementInit) return () => {};\n this.inForStatementInit = true;\n return () => {\n this.inForStatementInit = false;\n };\n }\n\n enterDelimited() {\n const oldInForStatementInit = this.inForStatementInit;\n const oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;\n if (\n oldInForStatementInit === false &&\n oldNoLineTerminatorAfterNode === null\n ) {\n return () => {};\n }\n this.inForStatementInit = false;\n this._noLineTerminatorAfterNode = null;\n return () => {\n this.inForStatementInit = oldInForStatementInit;\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n };\n }\n\n tokenContext: number = 0;\n\n _tokens: Token[] = null;\n _originalCode: string | null = null;\n\n declare _buf: Buffer;\n _currentNode: t.Node = 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 _endsWithInteger = false;\n _endsWithWord = false;\n _endsWithDiv = false;\n _lastCommentLine = 0;\n _endsWithInnerRaw: boolean = false;\n _indentInnerComments: boolean = true;\n tokenMap: TokenMap = null;\n\n _boundGetRawIdentifier = this._getRawIdentifier.bind(this);\n\n generate(ast: t.Node) {\n if (this.format.preserveFormat) {\n this.tokenMap = new TokenMap(ast, this._tokens, this._originalCode);\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(): void {\n const { format } = this;\n if (format.preserveFormat || format.compact || format.concise) {\n return;\n }\n\n this._indent++;\n }\n\n /**\n * Decrement indent size.\n */\n\n dedent(): void {\n const { format } = this;\n if (format.preserveFormat || format.compact || format.concise) {\n return;\n }\n\n this._indent--;\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 this._maybeAddAuxComment();\n if (force) {\n this._appendChar(charCodes.semicolon);\n this._noLineTerminator = false;\n return;\n }\n if (this.tokenMap) {\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 this._queue(charCodes.semicolon);\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 const { format } = this;\n if (format.compact || format.preserveFormat) return;\n\n if (force) {\n this._space();\n } else if (this._buf.hasContent()) {\n const lastCp = this.getLastChar();\n if (lastCp !== charCodes.space && lastCp !== charCodes.lineFeed) {\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 = 0;\n\n this._maybePrintInnerComments(str);\n\n this._maybeAddAuxComment();\n\n if (this.tokenMap) this._catchUpToCurrentToken(str);\n\n // prevent concatenating words and creating // comment out of division and regex\n if (\n this._endsWithWord ||\n (this._endsWithDiv && str.charCodeAt(0) === charCodes.slash)\n ) {\n this._space();\n }\n this._append(str, false);\n\n this._endsWithWord = true;\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\n // immediately after them.\n this._endsWithInteger =\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\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(str: string, maybeNewline = false, occurrenceCount = 0): void {\n this.tokenContext = 0;\n\n this._maybePrintInnerComments(str, occurrenceCount);\n\n this._maybeAddAuxComment();\n\n if (this.tokenMap) this._catchUpToCurrentToken(str, occurrenceCount);\n\n const lastChar = this.getLastChar();\n const strFirst = str.charCodeAt(0);\n if (\n (lastChar === charCodes.exclamationMark &&\n // space is mandatory to avoid outputting <!--\n // http://javascript.spec.whatwg.org/#comment-syntax\n (str === \"--\" ||\n // Needs spaces to avoid changing a! == 0 to a!== 0\n strFirst === charCodes.equalsTo)) ||\n // Need spaces for operators of the same kind to avoid: `a+++b`\n (strFirst === charCodes.plusSign && lastChar === charCodes.plusSign) ||\n (strFirst === charCodes.dash && lastChar === charCodes.dash) ||\n // Needs spaces to avoid changing '34' to '34.', which would still be a valid number.\n (strFirst === charCodes.dot && this._endsWithInteger)\n ) {\n this._space();\n }\n this._append(str, maybeNewline);\n this._noLineTerminator = false;\n }\n\n tokenChar(char: number): void {\n this.tokenContext = 0;\n\n const str = String.fromCharCode(char);\n this._maybePrintInnerComments(str);\n\n this._maybeAddAuxComment();\n\n if (this.tokenMap) this._catchUpToCurrentToken(str);\n\n const lastChar = this.getLastChar();\n if (\n // Need spaces for operators of the same kind to avoid: `a+++b`\n (char === charCodes.plusSign && lastChar === charCodes.plusSign) ||\n (char === charCodes.dash && lastChar === charCodes.dash) ||\n // Needs spaces to avoid changing '34' to '34.', which would still be a valid number.\n (char === charCodes.dot && this._endsWithInteger)\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, force?: boolean): void {\n if (i <= 0) return;\n\n if (!force) {\n if (this.format.retainLines || this.format.compact) return;\n\n if (this.format.concise) {\n this.space();\n return;\n }\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 return;\n }\n\n endsWith(char: number): boolean {\n return this.getLastChar() === char;\n }\n\n getLastChar(): number {\n return this._buf.getLastChar();\n }\n\n endsWithCharAndNewline(): number {\n return this._buf.endsWithCharAndNewline();\n }\n\n removeTrailingNewline(): void {\n this._buf.removeTrailingNewline();\n }\n\n exactSource(loc: Loc | 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 | 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 this._queue(charCodes.lineFeed);\n }\n\n _catchUpToCurrentToken(str: string, occurrenceCount: number = 0): 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._buf.appendChar(charCodes.semicolon);\n this._endsWithWord = false;\n this._endsWithInteger = false;\n this._endsWithDiv = false;\n }\n this._printSemicolonBeforeNextToken = -1;\n this._printSemicolonBeforeNextNode = -1;\n }\n\n _append(str: string, maybeNewline: boolean): void {\n this._maybeIndent(str.charCodeAt(0));\n\n this._buf.append(str, maybeNewline);\n\n // callers are expected to then set these to `true` when needed\n this._endsWithWord = false;\n this._endsWithInteger = false;\n this._endsWithDiv = false;\n }\n\n _appendChar(char: number): void {\n this._maybeIndent(char);\n\n this._buf.appendChar(char);\n\n // callers are expected to then set these to `true` when needed\n this._endsWithWord = false;\n this._endsWithInteger = false;\n this._endsWithDiv = false;\n }\n\n _queue(char: number) {\n this._maybeIndent(char);\n\n this._buf.queue(char);\n\n this._endsWithWord = false;\n this._endsWithInteger = false;\n }\n\n _maybeIndent(firstChar: number): void {\n // we've got a newline before us so prepend on the indentation\n if (\n this._indent &&\n firstChar !== charCodes.lineFeed &&\n this.endsWith(charCodes.lineFeed)\n ) {\n this._buf.queueIndentation(this._getIndent());\n }\n }\n\n _shouldIndent(firstChar: number) {\n // we've got a newline before us so prepend on the indentation\n if (\n this._indent &&\n firstChar !== charCodes.lineFeed &&\n this.endsWith(charCodes.lineFeed)\n ) {\n return true;\n }\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 { format } = this;\n if (!format.preserveFormat) {\n if (format.retainLines && 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._append(spaces, false);\n }\n }\n\n /**\n * Get the current indent.\n */\n\n _getIndent(): number {\n return this._indentRepeat * this._indent;\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,\n noLineTerminatorAfter?: boolean,\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._endsWithInnerRaw = false;\n\n const nodeType = node.type;\n const format = this.format;\n\n const oldConcise = format.concise;\n if (\n // @ts-expect-error document _compact AST properties\n node._compact\n ) {\n format.concise = true;\n }\n\n const printMethod =\n this[\n nodeType as Exclude<\n t.Node[\"type\"],\n | DeprecatedBabel7ASTTypes\n // renamed\n | t.DeprecatedAliases[\"type\"]\n >\n ];\n if (printMethod === undefined) {\n throw new ReferenceError(\n `unknown node of type ${JSON.stringify(\n nodeType,\n )} with constructor ${JSON.stringify(node.constructor.name)}`,\n );\n }\n\n const parent = this._currentNode;\n this._currentNode = node;\n\n if (this.tokenMap) {\n this._printSemicolonBeforeNextToken = this._printSemicolonBeforeNextNode;\n }\n\n const oldInAux = this._insideAux;\n this._insideAux = node.loc == null;\n this._maybeAddAuxComment(this._insideAux && !oldInAux);\n\n const parenthesized = node.extra?.parenthesized as boolean | undefined;\n let shouldPrintParens =\n (parenthesized && format.preserveFormat) ||\n (parenthesized &&\n format.retainFunctionParens &&\n nodeType === \"FunctionExpression\") ||\n needsParens(\n node,\n parent,\n this.tokenContext,\n this.inForStatementInit,\n format.preserveFormat ? this._boundGetRawIdentifier : undefined,\n );\n\n if (\n !shouldPrintParens &&\n parenthesized &&\n node.leadingComments?.length &&\n node.leadingComments[0].type === \"CommentBlock\"\n ) {\n const parentType = parent?.type;\n switch (parentType) {\n case \"ExpressionStatement\":\n case \"VariableDeclarator\":\n case \"AssignmentExpression\":\n case \"ReturnStatement\":\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n case \"NewExpression\":\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 (this.format.retainLines &&\n node.loc &&\n node.loc.start.line > this._buf.getCurrentLine()))\n ) {\n shouldPrintParens = true;\n indentParenthesized = true;\n }\n\n let oldNoLineTerminatorAfterNode;\n let oldInForStatementInitWasTrue;\n if (!shouldPrintParens) {\n noLineTerminatorAfter ||=\n parent &&\n this._noLineTerminatorAfterNode === parent &&\n 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._endsWithInnerRaw = false;\n if (this.inForStatementInit) {\n oldInForStatementInitWasTrue = true;\n this.inForStatementInit = false;\n }\n oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;\n this._noLineTerminatorAfterNode = null;\n }\n\n this._lastCommentLine = 0;\n\n this._printLeadingComments(node, parent);\n\n const loc = nodeType === \"Program\" || nodeType === \"File\" ? null : node.loc;\n\n this.exactSource(\n loc,\n // @ts-expect-error Expected 1 arguments, but got 3.\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 if (oldInForStatementInitWasTrue) this.inForStatementInit = true;\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\n // end\n this._currentNode = parent;\n format.concise = oldConcise;\n this._insideAux = oldInAux;\n\n if (oldNoLineTerminatorAfterNode !== undefined) {\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n }\n\n this._endsWithInnerRaw = false;\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: Array<t.Node> | undefined | null,\n statement?: boolean,\n indent?: boolean,\n separator?: PrintJoinOptions[\"separator\"],\n printTrailingSeparator?: boolean,\n addNewlines?: PrintJoinOptions[\"addNewlines\"],\n iterator?: PrintJoinOptions[\"iterator\"],\n trailingCommentsLineOffset?: number,\n ) {\n if (!nodes?.length) return;\n\n if (indent == null && this.format.retainLines) {\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();\n\n const newlineOpts: AddNewlinesOptions = {\n addNewlines: addNewlines,\n nextNodeStartLine: 0,\n };\n\n const boundSeparator = separator?.bind(this);\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 if (statement) this._printNewline(i === 0, newlineOpts);\n\n this.print(node, undefined, trailingCommentsLineOffset || 0);\n\n iterator?.(node, i);\n\n if (boundSeparator != null) {\n if (i < len - 1) boundSeparator(i, false);\n else if (printTrailingSeparator) boundSeparator(i, true);\n }\n\n if (statement) {\n if (!node.trailingComments?.length) {\n this._lastCommentLine = 0;\n }\n\n if (i + 1 === len) {\n this.newline(1);\n } else {\n const nextNode = nodes[i + 1];\n newlineOpts.nextNodeStartLine = nextNode.loc?.start.line || 0;\n\n this._printNewline(true, newlineOpts);\n }\n }\n }\n\n if (indent) this.dedent();\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(parent: Extract<t.Node, { body: t.Statement }>) {\n const node = parent.body;\n\n if (node.type !== \"EmptyStatement\") {\n this.space();\n }\n\n this.print(node);\n }\n\n _printTrailingComments(node: t.Node, parent?: t.Node, lineOffset?: number) {\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 }\n }\n\n _printLeadingComments(node: t.Node, parent: t.Node) {\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,\n nextTokenOccurrenceCount?: number,\n ) {\n if (this._endsWithInnerRaw) {\n this.printInnerComments(\n this.tokenMap?.findMatching(\n this._currentNode,\n nextTokenStr,\n nextTokenOccurrenceCount,\n ),\n );\n }\n this._endsWithInnerRaw = true;\n this._indentInnerComments = true;\n }\n\n printInnerComments(nextToken?: Token) {\n const node = this._currentNode;\n const comments = node.innerComments;\n if (!comments?.length) return;\n\n const hasSpace = this.endsWith(charCodes.space);\n const indent = this._indentInnerComments;\n const printedCommentsCount = this._printedComments.size;\n if (indent) this.indent();\n this._printComments(\n COMMENT_TYPE.INNER,\n comments,\n node,\n undefined,\n undefined,\n nextToken,\n );\n if (hasSpace && printedCommentsCount !== this._printedComments.size) {\n this.space();\n }\n if (indent) this.dedent();\n }\n\n noIndentInnerCommentsHere() {\n this._indentInnerComments = false;\n }\n\n printSequence(\n nodes: t.Node[],\n indent?: boolean,\n trailingCommentsLineOffset?: number,\n addNewlines?: PrintSequenceOptions[\"addNewlines\"],\n ) {\n this.printJoin(\n nodes,\n true,\n indent ?? false,\n undefined,\n undefined,\n addNewlines,\n undefined,\n trailingCommentsLineOffset,\n );\n }\n\n printList(\n items: t.Node[],\n printTrailingSeparator?: boolean,\n statement?: boolean,\n indent?: boolean,\n separator?: PrintListOptions[\"separator\"],\n iterator?: PrintListOptions[\"iterator\"],\n ) {\n this.printJoin(\n items,\n statement,\n indent,\n separator ?? commaSeparator,\n printTrailingSeparator,\n undefined,\n iterator,\n );\n }\n\n shouldPrintTrailingComma(listEnd: string): boolean | null {\n if (!this.tokenMap) return null;\n\n const listEndIndex = this.tokenMap.findLastIndex(this._currentNode, token =>\n this.tokenMap.matchesOriginal(token, listEnd),\n );\n if (listEndIndex <= 0) return null;\n return this.tokenMap.matchesOriginal(this._tokens[listEndIndex - 1], \",\");\n }\n\n _printNewline(newLine: boolean, opts: AddNewlinesOptions) {\n const format = this.format;\n\n // Fast path since 'this.newline' does nothing when not tracking lines.\n if (format.retainLines || format.compact) return;\n\n // Fast path for concise since 'this.newline' just inserts a space when\n // concise formatting is in use.\n if (format.concise) {\n this.space();\n return;\n }\n\n if (!newLine) {\n return;\n }\n\n const startLine = opts.nextNodeStartLine;\n const lastCommentLine = this._lastCommentLine;\n if (startLine > 0 && lastCommentLine > 0) {\n const offset = startLine - lastCommentLine;\n if (offset >= 0) {\n this.newline(offset || 1);\n return;\n }\n }\n\n // don't add newlines at the beginning of the file\n if (this._buf.hasContent()) {\n // Here is the logic of the original line wrapping according to the node layout, we are not using it now.\n // We currently add at most one newline to each node in the list, ignoring `opts.addNewlines`.\n\n // let lines = 0;\n // if (!leading) lines++; // always include at least a single line after\n // if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0;\n\n // const needs = leading ? needsWhitespaceBefore : needsWhitespaceAfter;\n // if (needs(node, parent)) lines++;\n\n // this.newline(Math.min(2, lines));\n\n this.newline(1);\n }\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,\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 !this._noLineTerminator;\n\n if (\n printNewLines &&\n this._buf.hasContent() &&\n skipNewLines !== COMMENT_SKIP_NEWLINE.LEADING\n ) {\n this.newline(1);\n }\n\n const lastCharCode = this.getLastChar();\n if (\n lastCharCode !== charCodes.leftSquareBracket &&\n lastCharCode !== charCodes.leftCurlyBrace &&\n lastCharCode !== charCodes.leftParenthesis\n ) {\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.format.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(charCodes.slash) || this.format.retainLines) {\n indentSize += this._getIndent();\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 // Avoid converting a / operator into a line comment by appending /* to it\n if (this._endsWithDiv) this._space();\n\n if (this.tokenMap) {\n const { _printSemicolonBeforeNextToken, _printSemicolonBeforeNextNode } =\n this;\n this._printSemicolonBeforeNextToken = -1;\n this._printSemicolonBeforeNextNode = -1;\n this.source(\"start\", comment.loc);\n this._append(val, isBlockComment);\n this._printSemicolonBeforeNextNode = _printSemicolonBeforeNextNode;\n this._printSemicolonBeforeNextToken = _printSemicolonBeforeNextToken;\n } else {\n this.source(\"start\", comment.loc);\n this._append(val, isBlockComment);\n }\n\n if (!isBlockComment && !noLineTerminator) {\n this.newline(1, true);\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: readonly t.Comment[],\n node: t.Node,\n parent?: t.Node,\n lineOffset: number = 0,\n nextToken?: Token,\n ) {\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 maybeNewline = this._noLineTerminator\n ? function () {}\n : this.newline.bind(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 hasLoc = false;\n break;\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 maybeNewline(offset);\n this._printComment(comment, COMMENT_SKIP_NEWLINE.ALL);\n\n if (i + 1 === len) {\n maybeNewline(\n Math.max(nodeStartLine - lastLine, leadingCommentNewline),\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 maybeNewline(offset);\n this._printComment(comment, COMMENT_SKIP_NEWLINE.ALL);\n\n if (i + 1 === len) {\n maybeNewline(Math.min(1, nodeEndLine - lastLine)); // TODO: Improve here when inner comments processing is stronger\n lastLine = nodeEndLine;\n }\n } else {\n const offset =\n commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine);\n lastLine = commentEndLine;\n\n maybeNewline(offset);\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, { 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 }\n}\n\n// Expose the node type functions and helpers on the prototype for easy usage.\nObject.assign(Printer.prototype, generatorFunctions);\n\nif (!process.env.BABEL_8_BREAKING) {\n addDeprecatedGenerators(Printer);\n}\n\ntype GeneratorFunctions = typeof generatorFunctions;\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\ninterface Printer extends GeneratorFunctions {}\nexport default Printer;\n\nfunction commaSeparator(this: Printer, occurrenceCount: number, last: boolean) {\n this.token(\",\", false, occurrenceCount);\n if (!last) this.space();\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AAEA,IAAAE,EAAA,GAAAF,OAAA;AAUA,IAAAG,SAAA,GAAAH,OAAA;AAEA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAGoC;EAflCM,YAAY;EACZC,UAAU;EACVC,WAAW;EACXC,WAAW;EACXC,iBAAiB;EACjBC;AAAc,IAAAT,EAAA;AAmBhB,MAAMU,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;AAEA,MAAM;EAAEC;AAAY,CAAC,GAAGpB,CAAC;AAmFzB,MAAMqB,OAAO,CAAC;EACZC,WAAWA,CACTC,MAAc,EACdC,GAAc,EACdC,MAAgB,EAChBC,YAAqB,EACrB;IAAA,KAgBFC,kBAAkB,GAAY,KAAK;IAAA,KA0BnCC,YAAY,GAAW,CAAC;IAAA,KAExBC,OAAO,GAAY,IAAI;IAAA,KACvBC,aAAa,GAAkB,IAAI;IAAA,KAGnCC,YAAY,GAAW,IAAI;IAAA,KAC3BC,OAAO,GAAW,CAAC;IAAA,KACnBC,aAAa,GAAW,CAAC;IAAA,KACzBC,UAAU,GAAY,KAAK;IAAA,KAC3BC,iBAAiB,GAAY,KAAK;IAAA,KAClCC,0BAA0B,GAAkB,IAAI;IAAA,KAChDC,4BAA4B,GAAY,KAAK;IAAA,KAC7CC,gBAAgB,GAAG,I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,CAAC;AAClC;AAAC,IAAAqQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKcvQ,OAAO;AAEtB,SAASsN,cAAcA,CAAgB9H,eAAuB,EAAEgL,IAAa,EAAE;EAC7E,IAAI,CAACpM,KAAK,CAAC,GAAG,EAAE,KAAK,EAAEoB,eAAe,CAAC;EACvC,IAAI,CAACgL,IAAI,EAAE,IAAI,CAAClM,KAAK,CAAC,CAAC;AACzB","ignoreList":[]}
|
ui/node_modules/@babel/generator/lib/source-map.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 = void 0;
|
| 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
|
| 60 |
+
});
|
| 61 |
+
if (!originalMapping.name && identifierNamePos) {
|
| 62 |
+
const originalIdentifierMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, identifierNamePos);
|
| 63 |
+
if (originalIdentifierMapping.name) {
|
| 64 |
+
identifierName = originalIdentifierMapping.name;
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
} else {
|
| 68 |
+
originalMapping = {
|
| 69 |
+
source: (filename == null ? void 0 : filename.replace(/\\/g, "/")) || this._sourceFileName,
|
| 70 |
+
line: line,
|
| 71 |
+
column: column
|
| 72 |
+
};
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
(0, _genMapping.maybeAddMapping)(this._map, {
|
| 76 |
+
name: identifierName,
|
| 77 |
+
generated,
|
| 78 |
+
source: (_originalMapping = originalMapping) == null ? void 0 : _originalMapping.source,
|
| 79 |
+
original: originalMapping
|
| 80 |
+
});
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
exports.default = SourceMap;
|
| 84 |
+
|
| 85 |
+
//# sourceMappingURL=source-map.js.map
|
ui/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 {\n type SourceMapInput,\n originalPositionFor,\n TraceMap,\n} 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;\n\n constructor(\n opts: {\n sourceFileName?: string;\n sourceRoot?: string;\n inputSourceMap?: SourceMapInput;\n },\n code: string | { [sourceFileName: string]: string },\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 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: {\n source: string | null;\n name?: string | null;\n line: number | null;\n column: number | null;\n };\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,\n });\n\n // If the we found a name, nothing else needs to be done\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 if (!originalMapping.name && identifierNamePos) {\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 source: filename?.replace(/\\\\/g, \"/\") || this._sourceFileName,\n line: line,\n column: column,\n };\n }\n }\n\n maybeAddMapping(this._map, {\n name: identifierName,\n generated,\n source: originalMapping?.source,\n original: originalMapping,\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAeA,IAAAC,aAAA,GAAAD,OAAA;AAUe,MAAME,SAAS,CAAC;EAe7BC,WAAWA,CACTC,IAIC,EACDC,IAAmD,EACnD;IAAA,IAAAC,oBAAA;I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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.TokenMap = void 0;
|
| 7 |
+
var _t = require("@babel/types");
|
| 8 |
+
const {
|
| 9 |
+
traverseFast,
|
| 10 |
+
VISITOR_KEYS
|
| 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 = null;
|
| 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 |
+
let i = 0;
|
| 59 |
+
const count = occurrenceCount;
|
| 60 |
+
if (count > 1) {
|
| 61 |
+
const cache = this._nodesOccurrencesCountCache.get(node);
|
| 62 |
+
if (cache && cache.test === test && cache.count < count) {
|
| 63 |
+
i = cache.i + 1;
|
| 64 |
+
occurrenceCount -= cache.count + 1;
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
for (; i < indexes.length; i++) {
|
| 68 |
+
const tok = this._tokens[indexes[i]];
|
| 69 |
+
if (this.matchesOriginal(tok, test)) {
|
| 70 |
+
if (occurrenceCount === 0) {
|
| 71 |
+
if (count > 0) {
|
| 72 |
+
this._nodesOccurrencesCountCache.set(node, {
|
| 73 |
+
test,
|
| 74 |
+
count,
|
| 75 |
+
i
|
| 76 |
+
});
|
| 77 |
+
}
|
| 78 |
+
return tok;
|
| 79 |
+
}
|
| 80 |
+
occurrenceCount--;
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
return null;
|
| 85 |
+
}
|
| 86 |
+
matchesOriginal(token, test) {
|
| 87 |
+
if (token.end - token.start !== test.length) return false;
|
| 88 |
+
if (token.value != null) return token.value === test;
|
| 89 |
+
return this._source.startsWith(test, token.start);
|
| 90 |
+
}
|
| 91 |
+
startMatches(node, test) {
|
| 92 |
+
const indexes = this._nodesToTokenIndexes.get(node);
|
| 93 |
+
if (!indexes) return false;
|
| 94 |
+
const tok = this._tokens[indexes[0]];
|
| 95 |
+
if (tok.start !== node.start) return false;
|
| 96 |
+
return this.matchesOriginal(tok, test);
|
| 97 |
+
}
|
| 98 |
+
endMatches(node, test) {
|
| 99 |
+
const indexes = this._nodesToTokenIndexes.get(node);
|
| 100 |
+
if (!indexes) return false;
|
| 101 |
+
const tok = this._tokens[indexes[indexes.length - 1]];
|
| 102 |
+
if (tok.end !== node.end) return false;
|
| 103 |
+
return this.matchesOriginal(tok, test);
|
| 104 |
+
}
|
| 105 |
+
_getTokensIndexesOfNode(node) {
|
| 106 |
+
if (node.start == null || node.end == null) return [];
|
| 107 |
+
const {
|
| 108 |
+
first,
|
| 109 |
+
last
|
| 110 |
+
} = this._findTokensOfNode(node, 0, this._tokens.length - 1);
|
| 111 |
+
let low = first;
|
| 112 |
+
const children = childrenIterator(node);
|
| 113 |
+
if ((node.type === "ExportNamedDeclaration" || node.type === "ExportDefaultDeclaration") && node.declaration && node.declaration.type === "ClassDeclaration") {
|
| 114 |
+
children.next();
|
| 115 |
+
}
|
| 116 |
+
const indexes = [];
|
| 117 |
+
for (const child of children) {
|
| 118 |
+
if (child == null) continue;
|
| 119 |
+
if (child.start == null || child.end == null) continue;
|
| 120 |
+
const childTok = this._findTokensOfNode(child, low, last);
|
| 121 |
+
const high = childTok.first;
|
| 122 |
+
for (let k = low; k < high; k++) indexes.push(k);
|
| 123 |
+
low = childTok.last + 1;
|
| 124 |
+
}
|
| 125 |
+
for (let k = low; k <= last; k++) indexes.push(k);
|
| 126 |
+
return indexes;
|
| 127 |
+
}
|
| 128 |
+
_findTokensOfNode(node, low, high) {
|
| 129 |
+
const cached = this._tokensCache.get(node);
|
| 130 |
+
if (cached) return cached;
|
| 131 |
+
const first = this._findFirstTokenOfNode(node.start, low, high);
|
| 132 |
+
const last = this._findLastTokenOfNode(node.end, first, high);
|
| 133 |
+
this._tokensCache.set(node, {
|
| 134 |
+
first,
|
| 135 |
+
last
|
| 136 |
+
});
|
| 137 |
+
return {
|
| 138 |
+
first,
|
| 139 |
+
last
|
| 140 |
+
};
|
| 141 |
+
}
|
| 142 |
+
_findFirstTokenOfNode(start, low, high) {
|
| 143 |
+
while (low <= high) {
|
| 144 |
+
const mid = high + low >> 1;
|
| 145 |
+
if (start < this._tokens[mid].start) {
|
| 146 |
+
high = mid - 1;
|
| 147 |
+
} else if (start > this._tokens[mid].start) {
|
| 148 |
+
low = mid + 1;
|
| 149 |
+
} else {
|
| 150 |
+
return mid;
|
| 151 |
+
}
|
| 152 |
+
}
|
| 153 |
+
return low;
|
| 154 |
+
}
|
| 155 |
+
_findLastTokenOfNode(end, low, high) {
|
| 156 |
+
while (low <= high) {
|
| 157 |
+
const mid = high + low >> 1;
|
| 158 |
+
if (end < this._tokens[mid].end) {
|
| 159 |
+
high = mid - 1;
|
| 160 |
+
} else if (end > this._tokens[mid].end) {
|
| 161 |
+
low = mid + 1;
|
| 162 |
+
} else {
|
| 163 |
+
return mid;
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
return high;
|
| 167 |
+
}
|
| 168 |
+
}
|
| 169 |
+
exports.TokenMap = TokenMap;
|
| 170 |
+
function* childrenIterator(node) {
|
| 171 |
+
if (node.type === "TemplateLiteral") {
|
| 172 |
+
yield node.quasis[0];
|
| 173 |
+
for (let i = 1; i < node.quasis.length; i++) {
|
| 174 |
+
yield node.expressions[i - 1];
|
| 175 |
+
yield node.quasis[i];
|
| 176 |
+
}
|
| 177 |
+
return;
|
| 178 |
+
}
|
| 179 |
+
const keys = VISITOR_KEYS[node.type];
|
| 180 |
+
for (const key of keys) {
|
| 181 |
+
const child = node[key];
|
| 182 |
+
if (!child) continue;
|
| 183 |
+
if (Array.isArray(child)) {
|
| 184 |
+
yield* child;
|
| 185 |
+
} else {
|
| 186 |
+
yield child;
|
| 187 |
+
}
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
//# sourceMappingURL=token-map.js.map
|
ui/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","has","getIndexes","get","find","condition","k","index","tok","findLastIndex","findMatching","test","occurrenceCount","i","count","cache","matchesOriginal","token","end","start","value","startsWith","startMatches","endMatches","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: Map<t.Node, number[]> = new Map();\n _nodesOccurrencesCountCache: Map<\n t.Node,\n { test: string; count: number; i: number }\n > = new Map();\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 = null;\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,\n occurrenceCount: number = 0,\n ): Token | null {\n const indexes = this._nodesToTokenIndexes.get(node);\n if (indexes) {\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 && 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 &&\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;AAE5B,MAAMI,QAAQ,CAAC;EAYpBC,WAAWA,CAACC,GAAW,EAAEC,MAAe,EAAEC,MAAc,EAAE;IAAA,KAX1DC,OAAO;IAAA,KACPC,OAAO;IAAA,KAEPC,oBAAoB,GAA0B,IAAIC,GAAG,CAAC,CAAC;IAAA,KACvDC,2BAA2B,GAGvB,IAAID,GAAG,CAAC,CAAC;IAAA,KAEbE,YAAY,GAAG,IAAIF,GAAG,CAA0C,CAAC;IAG/D,IAAI,CAACH,OAAO,GAAGF,MAAM;IACrB,IAAI,CAACG,OAAO,GAAGF,MAAM;IAErBN,YAAY,CAACI,GAAG,EAAES,IAAI,IAAI;MACxB,MAAMC,OAAO,GAAG,IAAI,CAACC,uBAAuB,CAACF,IAAI,CAAC;MAClD,IAAIC,OAAO,CAACE,MAAM,GAAG,CAAC,EAAE,IAAI,CAACP,oBAAoB,CAACQ,GAAG,CAACJ,IAAI,EAAEC,OAAO,CAAC;IACtE,CAAC,CAAC;IAEF,IAAI,CAACF,YAAY,G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": "7.27.1",
|
| 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.27.1",
|
| 23 |
+
"@babel/types": "^7.27.1",
|
| 24 |
+
"@jridgewell/gen-mapping": "^0.3.5",
|
| 25 |
+
"@jridgewell/trace-mapping": "^0.3.25",
|
| 26 |
+
"jsesc": "^3.0.2"
|
| 27 |
+
},
|
| 28 |
+
"devDependencies": {
|
| 29 |
+
"@babel/core": "^7.27.1",
|
| 30 |
+
"@babel/helper-fixtures": "^7.27.1",
|
| 31 |
+
"@babel/plugin-transform-typescript": "^7.27.1",
|
| 32 |
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
| 33 |
+
"@types/jsesc": "^2.5.0",
|
| 34 |
+
"charcodes": "^0.2.0"
|
| 35 |
+
},
|
| 36 |
+
"engines": {
|
| 37 |
+
"node": ">=6.9.0"
|
| 38 |
+
},
|
| 39 |
+
"type": "commonjs"
|
| 40 |
+
}
|