mirror of
https://github.com/ylw00/qxVm.git
synced 2025-04-09 02:13:29 +08:00
框架主题
This commit is contained in:
commit
39cf2599ad
.vscode
node_modules
.bin
.package-lock.json@babel
generator
LICENSEREADME.md
lib
buffer.jsbuffer.js.map
package.jsongenerators
base.jsbase.js.mapclasses.jsclasses.js.mapexpressions.jsexpressions.js.mapflow.jsflow.js.mapindex.jsindex.js.mapjsx.jsjsx.js.mapmethods.jsmethods.js.mapmodules.jsmodules.js.mapstatements.jsstatements.js.maptemplate-literals.jstemplate-literals.js.maptypes.jstypes.js.maptypescript.jstypescript.js.map
index.jsindex.js.mapnode
printer.jsprinter.js.mapsource-map.jssource-map.js.maphelper-string-parser
helper-validator-identifier
parser
types
LICENSEREADME.md
lib
asserts
ast-types/generated
builders
flow
createFlowUnionType.jscreateFlowUnionType.js.mapcreateTypeAnnotationBasedOnTypeof.jscreateTypeAnnotationBasedOnTypeof.js.map
generated
react
typescript
validateNode.jsvalidateNode.js.mapclone
27
.vscode/launch.json
vendored
Normal file
27
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
// 使用 IntelliSense 了解相关属性。
|
||||
// 悬停以查看现有属性的描述。
|
||||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "pwa-node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"program": "${workspaceFolder}\\z_working\\rs5Vm.js"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "浏览器无环境",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"runtimeExecutable": "node-inspect",
|
||||
"program": "${workspaceFolder}\\z_working\\rs5Vm.js"
|
||||
}
|
||||
]
|
||||
}
|
0
node_modules/.bin/acorn
generated
vendored
Normal file
0
node_modules/.bin/acorn
generated
vendored
Normal file
0
node_modules/.bin/jsesc
generated
vendored
Normal file
0
node_modules/.bin/jsesc
generated
vendored
Normal file
0
node_modules/.bin/parser
generated
vendored
Normal file
0
node_modules/.bin/parser
generated
vendored
Normal file
0
node_modules/.bin/vm2
generated
vendored
Normal file
0
node_modules/.bin/vm2
generated
vendored
Normal file
156
node_modules/.package-lock.json
generated
vendored
Normal file
156
node_modules/.package-lock.json
generated
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
{
|
||||
"name": "QXVM",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@babel/generator": {
|
||||
"version": "7.20.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.5.tgz",
|
||||
"integrity": "sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.20.5",
|
||||
"@jridgewell/gen-mapping": "^0.3.2",
|
||||
"jsesc": "^2.5.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
"version": "7.19.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz",
|
||||
"integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-validator-identifier": {
|
||||
"version": "7.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
|
||||
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.20.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.5.tgz",
|
||||
"integrity": "sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==",
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.20.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz",
|
||||
"integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.19.4",
|
||||
"@babel/helper-validator-identifier": "^7.19.1",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
|
||||
"integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==",
|
||||
"dependencies": {
|
||||
"@jridgewell/set-array": "^1.0.1",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.10",
|
||||
"@jridgewell/trace-mapping": "^0.3.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/resolve-uri": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
|
||||
"integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/set-array": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
|
||||
"integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/sourcemap-codec": {
|
||||
"version": "1.4.14",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
|
||||
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw=="
|
||||
},
|
||||
"node_modules/@jridgewell/trace-mapping": {
|
||||
"version": "0.3.17",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz",
|
||||
"integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==",
|
||||
"dependencies": {
|
||||
"@jridgewell/resolve-uri": "3.1.0",
|
||||
"@jridgewell/sourcemap-codec": "1.4.14"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz",
|
||||
"integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jsesc": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
|
||||
"integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
|
||||
"bin": {
|
||||
"jsesc": "bin/jsesc"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/to-fast-properties": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
||||
"integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/vm2": {
|
||||
"version": "3.9.13",
|
||||
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.13.tgz",
|
||||
"integrity": "sha512-0rvxpB8P8Shm4wX2EKOiMp7H2zq+HUE/UwodY0pCZXs9IffIKZq6vUti5OgkVCTakKo9e/fgO4X1fkwfjWxE3Q==",
|
||||
"dependencies": {
|
||||
"acorn": "^8.7.0",
|
||||
"acorn-walk": "^8.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"vm2": "bin/vm2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
22
node_modules/@babel/generator/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/generator/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/generator/README.md
generated
vendored
Normal file
19
node_modules/@babel/generator/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/generator
|
||||
|
||||
> Turns an AST into code.
|
||||
|
||||
See our website [@babel/generator](https://babeljs.io/docs/en/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.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/generator
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/generator --dev
|
||||
```
|
294
node_modules/@babel/generator/lib/buffer.js
generated
vendored
Normal file
294
node_modules/@babel/generator/lib/buffer.js
generated
vendored
Normal file
@ -0,0 +1,294 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
class Buffer {
|
||||
constructor(map) {
|
||||
this._map = null;
|
||||
this._buf = "";
|
||||
this._str = "";
|
||||
this._appendCount = 0;
|
||||
this._last = 0;
|
||||
this._queue = [];
|
||||
this._queueCursor = 0;
|
||||
this._position = {
|
||||
line: 1,
|
||||
column: 0
|
||||
};
|
||||
this._sourcePosition = {
|
||||
identifierName: undefined,
|
||||
line: undefined,
|
||||
column: undefined,
|
||||
filename: undefined
|
||||
};
|
||||
this._map = map;
|
||||
this._allocQueue();
|
||||
}
|
||||
_allocQueue() {
|
||||
const queue = this._queue;
|
||||
for (let i = 0; i < 16; i++) {
|
||||
queue.push({
|
||||
char: 0,
|
||||
repeat: 1,
|
||||
line: undefined,
|
||||
column: undefined,
|
||||
identifierName: undefined,
|
||||
filename: ""
|
||||
});
|
||||
}
|
||||
}
|
||||
_pushQueue(char, repeat, line, column, identifierName, filename) {
|
||||
const cursor = this._queueCursor;
|
||||
if (cursor === this._queue.length) {
|
||||
this._allocQueue();
|
||||
}
|
||||
const item = this._queue[cursor];
|
||||
item.char = char;
|
||||
item.repeat = repeat;
|
||||
item.line = line;
|
||||
item.column = column;
|
||||
item.identifierName = identifierName;
|
||||
item.filename = filename;
|
||||
this._queueCursor++;
|
||||
}
|
||||
_popQueue() {
|
||||
if (this._queueCursor === 0) {
|
||||
throw new Error("Cannot pop from empty queue");
|
||||
}
|
||||
return this._queue[--this._queueCursor];
|
||||
}
|
||||
|
||||
get() {
|
||||
this._flush();
|
||||
const map = this._map;
|
||||
const result = {
|
||||
code: (this._buf + this._str).trimRight(),
|
||||
decodedMap: map == null ? void 0 : map.getDecoded(),
|
||||
get map() {
|
||||
const resultMap = map ? map.get() : null;
|
||||
result.map = resultMap;
|
||||
return resultMap;
|
||||
},
|
||||
set map(value) {
|
||||
Object.defineProperty(result, "map", {
|
||||
value,
|
||||
writable: true
|
||||
});
|
||||
},
|
||||
get rawMappings() {
|
||||
const mappings = map == null ? void 0 : map.getRawMappings();
|
||||
result.rawMappings = mappings;
|
||||
return mappings;
|
||||
},
|
||||
set rawMappings(value) {
|
||||
Object.defineProperty(result, "rawMappings", {
|
||||
value,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
append(str, maybeNewline) {
|
||||
this._flush();
|
||||
this._append(str, this._sourcePosition, maybeNewline);
|
||||
}
|
||||
appendChar(char) {
|
||||
this._flush();
|
||||
this._appendChar(char, 1, this._sourcePosition);
|
||||
}
|
||||
|
||||
queue(char) {
|
||||
if (char === 10) {
|
||||
while (this._queueCursor !== 0) {
|
||||
const char = this._queue[this._queueCursor - 1].char;
|
||||
if (char !== 32 && char !== 9) {
|
||||
break;
|
||||
}
|
||||
this._queueCursor--;
|
||||
}
|
||||
}
|
||||
const sourcePosition = this._sourcePosition;
|
||||
this._pushQueue(char, 1, sourcePosition.line, sourcePosition.column, sourcePosition.identifierName, sourcePosition.filename);
|
||||
}
|
||||
|
||||
queueIndentation(char, repeat) {
|
||||
this._pushQueue(char, repeat, undefined, undefined, undefined, undefined);
|
||||
}
|
||||
_flush() {
|
||||
const queueCursor = this._queueCursor;
|
||||
const queue = this._queue;
|
||||
for (let i = 0; i < queueCursor; i++) {
|
||||
const item = queue[i];
|
||||
this._appendChar(item.char, item.repeat, item);
|
||||
}
|
||||
this._queueCursor = 0;
|
||||
}
|
||||
_appendChar(char, repeat, sourcePos) {
|
||||
this._last = char;
|
||||
this._str += repeat > 1 ? String.fromCharCode(char).repeat(repeat) : String.fromCharCode(char);
|
||||
if (char !== 10) {
|
||||
this._mark(sourcePos.line, sourcePos.column, sourcePos.identifierName, sourcePos.filename);
|
||||
this._position.column += repeat;
|
||||
} else {
|
||||
this._position.line++;
|
||||
this._position.column = 0;
|
||||
}
|
||||
}
|
||||
_append(str, sourcePos, maybeNewline) {
|
||||
const len = str.length;
|
||||
const position = this._position;
|
||||
this._last = str.charCodeAt(len - 1);
|
||||
if (++this._appendCount > 4096) {
|
||||
+this._str;
|
||||
this._buf += this._str;
|
||||
this._str = str;
|
||||
this._appendCount = 0;
|
||||
} else {
|
||||
this._str += str;
|
||||
}
|
||||
if (!maybeNewline && !this._map) {
|
||||
position.column += len;
|
||||
return;
|
||||
}
|
||||
const {
|
||||
column,
|
||||
identifierName,
|
||||
filename
|
||||
} = sourcePos;
|
||||
let line = sourcePos.line;
|
||||
|
||||
let i = str.indexOf("\n");
|
||||
let last = 0;
|
||||
|
||||
if (i !== 0) {
|
||||
this._mark(line, column, identifierName, filename);
|
||||
}
|
||||
|
||||
while (i !== -1) {
|
||||
position.line++;
|
||||
position.column = 0;
|
||||
last = i + 1;
|
||||
|
||||
if (last < len) {
|
||||
this._mark(++line, 0, identifierName, filename);
|
||||
}
|
||||
i = str.indexOf("\n", last);
|
||||
}
|
||||
position.column += len - last;
|
||||
}
|
||||
_mark(line, column, identifierName, filename) {
|
||||
var _this$_map;
|
||||
(_this$_map = this._map) == null ? void 0 : _this$_map.mark(this._position, line, column, identifierName, filename);
|
||||
}
|
||||
removeTrailingNewline() {
|
||||
const queueCursor = this._queueCursor;
|
||||
if (queueCursor !== 0 && this._queue[queueCursor - 1].char === 10) {
|
||||
this._queueCursor--;
|
||||
}
|
||||
}
|
||||
removeLastSemicolon() {
|
||||
const queueCursor = this._queueCursor;
|
||||
if (queueCursor !== 0 && this._queue[queueCursor - 1].char === 59) {
|
||||
this._queueCursor--;
|
||||
}
|
||||
}
|
||||
getLastChar() {
|
||||
const queueCursor = this._queueCursor;
|
||||
return queueCursor !== 0 ? this._queue[queueCursor - 1].char : this._last;
|
||||
}
|
||||
|
||||
getNewlineCount() {
|
||||
const queueCursor = this._queueCursor;
|
||||
let count = 0;
|
||||
if (queueCursor === 0) return this._last === 10 ? 1 : 0;
|
||||
for (let i = queueCursor - 1; i >= 0; i--) {
|
||||
if (this._queue[i].char !== 10) {
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
return count === queueCursor && this._last === 10 ? count + 1 : count;
|
||||
}
|
||||
|
||||
endsWithCharAndNewline() {
|
||||
const queue = this._queue;
|
||||
const queueCursor = this._queueCursor;
|
||||
if (queueCursor !== 0) {
|
||||
const lastCp = queue[queueCursor - 1].char;
|
||||
if (lastCp !== 10) return;
|
||||
if (queueCursor > 1) {
|
||||
return queue[queueCursor - 2].char;
|
||||
} else {
|
||||
return this._last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hasContent() {
|
||||
return this._queueCursor !== 0 || !!this._last;
|
||||
}
|
||||
|
||||
exactSource(loc, cb) {
|
||||
if (!this._map) return cb();
|
||||
this.source("start", loc);
|
||||
cb();
|
||||
this.source("end", loc);
|
||||
}
|
||||
|
||||
source(prop, loc) {
|
||||
if (!this._map) return;
|
||||
|
||||
this._normalizePosition(prop, loc, 0, 0);
|
||||
}
|
||||
sourceWithOffset(prop, loc, lineOffset, columnOffset) {
|
||||
if (!this._map) return;
|
||||
this._normalizePosition(prop, loc, lineOffset, columnOffset);
|
||||
}
|
||||
|
||||
withSource(prop, loc, cb) {
|
||||
if (!this._map) return cb();
|
||||
this.source(prop, loc);
|
||||
cb();
|
||||
}
|
||||
_normalizePosition(prop, loc, lineOffset, columnOffset) {
|
||||
const pos = loc[prop];
|
||||
const target = this._sourcePosition;
|
||||
target.identifierName = prop === "start" && loc.identifierName || undefined;
|
||||
if (pos) {
|
||||
target.line = pos.line + lineOffset;
|
||||
target.column = pos.column + columnOffset;
|
||||
target.filename = loc.filename;
|
||||
}
|
||||
}
|
||||
getCurrentColumn() {
|
||||
const queue = this._queue;
|
||||
const queueCursor = this._queueCursor;
|
||||
let lastIndex = -1;
|
||||
let len = 0;
|
||||
for (let i = 0; i < queueCursor; i++) {
|
||||
const item = queue[i];
|
||||
if (item.char === 10) {
|
||||
lastIndex = len;
|
||||
}
|
||||
len += item.repeat;
|
||||
}
|
||||
return lastIndex === -1 ? this._position.column + len : len - 1 - lastIndex;
|
||||
}
|
||||
getCurrentLine() {
|
||||
let count = 0;
|
||||
const queue = this._queue;
|
||||
for (let i = 0; i < this._queueCursor; i++) {
|
||||
if (queue[i].char === 10) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return this._position.line + count;
|
||||
}
|
||||
}
|
||||
exports.default = Buffer;
|
||||
|
||||
//# sourceMappingURL=buffer.js.map
|
1
node_modules/@babel/generator/lib/buffer.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/buffer.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
95
node_modules/@babel/generator/lib/generators/base.js
generated
vendored
Normal file
95
node_modules/@babel/generator/lib/generators/base.js
generated
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.BlockStatement = BlockStatement;
|
||||
exports.Directive = Directive;
|
||||
exports.DirectiveLiteral = DirectiveLiteral;
|
||||
exports.File = File;
|
||||
exports.InterpreterDirective = InterpreterDirective;
|
||||
exports.Placeholder = Placeholder;
|
||||
exports.Program = Program;
|
||||
function File(node) {
|
||||
if (node.program) {
|
||||
this.print(node.program.interpreter, node);
|
||||
}
|
||||
this.print(node.program, node);
|
||||
}
|
||||
function Program(node) {
|
||||
var _node$directives;
|
||||
this.noIndentInnerCommentsHere();
|
||||
this.printInnerComments();
|
||||
const directivesLen = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
|
||||
if (directivesLen) {
|
||||
var _node$directives$trai;
|
||||
const newline = node.body.length ? 2 : 1;
|
||||
this.printSequence(node.directives, node, {
|
||||
trailingCommentsLineOffset: newline
|
||||
});
|
||||
if (!((_node$directives$trai = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai.length)) {
|
||||
this.newline(newline);
|
||||
}
|
||||
}
|
||||
this.printSequence(node.body, node);
|
||||
}
|
||||
function BlockStatement(node) {
|
||||
var _node$directives2;
|
||||
this.tokenChar(123);
|
||||
const directivesLen = (_node$directives2 = node.directives) == null ? void 0 : _node$directives2.length;
|
||||
if (directivesLen) {
|
||||
var _node$directives$trai2;
|
||||
const newline = node.body.length ? 2 : 1;
|
||||
this.printSequence(node.directives, node, {
|
||||
indent: true,
|
||||
trailingCommentsLineOffset: newline
|
||||
});
|
||||
if (!((_node$directives$trai2 = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai2.length)) {
|
||||
this.newline(newline);
|
||||
}
|
||||
}
|
||||
this.printSequence(node.body, node, {
|
||||
indent: true
|
||||
});
|
||||
this.sourceWithOffset("end", node.loc, 0, -1);
|
||||
this.rightBrace();
|
||||
}
|
||||
function Directive(node) {
|
||||
this.print(node.value, node);
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
|
||||
const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
|
||||
function DirectiveLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
if (!this.format.minified && raw !== undefined) {
|
||||
this.token(raw);
|
||||
return;
|
||||
}
|
||||
const {
|
||||
value
|
||||
} = node;
|
||||
|
||||
if (!unescapedDoubleQuoteRE.test(value)) {
|
||||
this.token(`"${value}"`);
|
||||
} else if (!unescapedSingleQuoteRE.test(value)) {
|
||||
this.token(`'${value}'`);
|
||||
} else {
|
||||
throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
|
||||
}
|
||||
}
|
||||
function InterpreterDirective(node) {
|
||||
this.token(`#!${node.value}`);
|
||||
this.newline(1, true);
|
||||
}
|
||||
function Placeholder(node) {
|
||||
this.token("%%");
|
||||
this.print(node.name);
|
||||
this.token("%%");
|
||||
if (node.expectedNode === "Statement") {
|
||||
this.semicolon();
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=base.js.map
|
1
node_modules/@babel/generator/lib/generators/base.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/base.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
186
node_modules/@babel/generator/lib/generators/classes.js
generated
vendored
Normal file
186
node_modules/@babel/generator/lib/generators/classes.js
generated
vendored
Normal file
@ -0,0 +1,186 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ClassAccessorProperty = ClassAccessorProperty;
|
||||
exports.ClassBody = ClassBody;
|
||||
exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration;
|
||||
exports.ClassMethod = ClassMethod;
|
||||
exports.ClassPrivateMethod = ClassPrivateMethod;
|
||||
exports.ClassPrivateProperty = ClassPrivateProperty;
|
||||
exports.ClassProperty = ClassProperty;
|
||||
exports.StaticBlock = StaticBlock;
|
||||
exports._classMethodHead = _classMethodHead;
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
isExportDefaultDeclaration,
|
||||
isExportNamedDeclaration
|
||||
} = _t;
|
||||
function ClassDeclaration(node, parent) {
|
||||
{
|
||||
if (!this.format.decoratorsBeforeExport || !isExportDefaultDeclaration(parent) && !isExportNamedDeclaration(parent)) {
|
||||
this.printJoin(node.decorators, node);
|
||||
}
|
||||
}
|
||||
if (node.declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
if (node.abstract) {
|
||||
this.word("abstract");
|
||||
this.space();
|
||||
}
|
||||
this.word("class");
|
||||
if (node.id) {
|
||||
this.space();
|
||||
this.print(node.id, node);
|
||||
}
|
||||
this.print(node.typeParameters, node);
|
||||
if (node.superClass) {
|
||||
this.space();
|
||||
this.word("extends");
|
||||
this.space();
|
||||
this.print(node.superClass, node);
|
||||
this.print(node.superTypeParameters, node);
|
||||
}
|
||||
if (node.implements) {
|
||||
this.space();
|
||||
this.word("implements");
|
||||
this.space();
|
||||
this.printList(node.implements, node);
|
||||
}
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function ClassBody(node) {
|
||||
this.tokenChar(123);
|
||||
if (node.body.length === 0) {
|
||||
this.tokenChar(125);
|
||||
} else {
|
||||
this.newline();
|
||||
this.indent();
|
||||
this.printSequence(node.body, node);
|
||||
this.dedent();
|
||||
if (!this.endsWith(10)) this.newline();
|
||||
this.sourceWithOffset("end", node.loc, 0, -1);
|
||||
this.rightBrace();
|
||||
}
|
||||
}
|
||||
function ClassProperty(node) {
|
||||
var _node$key$loc, _node$key$loc$end;
|
||||
this.printJoin(node.decorators, node);
|
||||
|
||||
const endLine = (_node$key$loc = node.key.loc) == null ? void 0 : (_node$key$loc$end = _node$key$loc.end) == null ? void 0 : _node$key$loc$end.line;
|
||||
if (endLine) this.catchUp(endLine);
|
||||
this.tsPrintClassMemberModifiers(node);
|
||||
if (node.computed) {
|
||||
this.tokenChar(91);
|
||||
this.print(node.key, node);
|
||||
this.tokenChar(93);
|
||||
} else {
|
||||
this._variance(node);
|
||||
this.print(node.key, node);
|
||||
}
|
||||
|
||||
if (node.optional) {
|
||||
this.tokenChar(63);
|
||||
}
|
||||
if (node.definite) {
|
||||
this.tokenChar(33);
|
||||
}
|
||||
this.print(node.typeAnnotation, node);
|
||||
if (node.value) {
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.value, node);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function ClassAccessorProperty(node) {
|
||||
var _node$key$loc2, _node$key$loc2$end;
|
||||
this.printJoin(node.decorators, node);
|
||||
|
||||
const endLine = (_node$key$loc2 = node.key.loc) == null ? void 0 : (_node$key$loc2$end = _node$key$loc2.end) == null ? void 0 : _node$key$loc2$end.line;
|
||||
if (endLine) this.catchUp(endLine);
|
||||
|
||||
this.tsPrintClassMemberModifiers(node);
|
||||
this.word("accessor", true);
|
||||
this.space();
|
||||
if (node.computed) {
|
||||
this.tokenChar(91);
|
||||
this.print(node.key, node);
|
||||
this.tokenChar(93);
|
||||
} else {
|
||||
this._variance(node);
|
||||
this.print(node.key, node);
|
||||
}
|
||||
|
||||
if (node.optional) {
|
||||
this.tokenChar(63);
|
||||
}
|
||||
if (node.definite) {
|
||||
this.tokenChar(33);
|
||||
}
|
||||
this.print(node.typeAnnotation, node);
|
||||
if (node.value) {
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.value, node);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function ClassPrivateProperty(node) {
|
||||
this.printJoin(node.decorators, node);
|
||||
if (node.static) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
}
|
||||
this.print(node.key, node);
|
||||
this.print(node.typeAnnotation, node);
|
||||
if (node.value) {
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.value, node);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function ClassMethod(node) {
|
||||
this._classMethodHead(node);
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function ClassPrivateMethod(node) {
|
||||
this._classMethodHead(node);
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function _classMethodHead(node) {
|
||||
var _node$key$loc3, _node$key$loc3$end;
|
||||
this.printJoin(node.decorators, node);
|
||||
|
||||
const endLine = (_node$key$loc3 = node.key.loc) == null ? void 0 : (_node$key$loc3$end = _node$key$loc3.end) == null ? void 0 : _node$key$loc3$end.line;
|
||||
if (endLine) this.catchUp(endLine);
|
||||
this.tsPrintClassMemberModifiers(node);
|
||||
this._methodHead(node);
|
||||
}
|
||||
function StaticBlock(node) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
this.tokenChar(123);
|
||||
if (node.body.length === 0) {
|
||||
this.tokenChar(125);
|
||||
} else {
|
||||
this.newline();
|
||||
this.printSequence(node.body, node, {
|
||||
indent: true
|
||||
});
|
||||
this.sourceWithOffset("end", node.loc, 0, -1);
|
||||
this.rightBrace();
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=classes.js.map
|
1
node_modules/@babel/generator/lib/generators/classes.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/classes.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
299
node_modules/@babel/generator/lib/generators/expressions.js
generated
vendored
Normal file
299
node_modules/@babel/generator/lib/generators/expressions.js
generated
vendored
Normal file
@ -0,0 +1,299 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression;
|
||||
exports.AssignmentPattern = AssignmentPattern;
|
||||
exports.AwaitExpression = AwaitExpression;
|
||||
exports.BindExpression = BindExpression;
|
||||
exports.CallExpression = CallExpression;
|
||||
exports.ConditionalExpression = ConditionalExpression;
|
||||
exports.Decorator = Decorator;
|
||||
exports.DoExpression = DoExpression;
|
||||
exports.EmptyStatement = EmptyStatement;
|
||||
exports.ExpressionStatement = ExpressionStatement;
|
||||
exports.Import = Import;
|
||||
exports.MemberExpression = MemberExpression;
|
||||
exports.MetaProperty = MetaProperty;
|
||||
exports.ModuleExpression = ModuleExpression;
|
||||
exports.NewExpression = NewExpression;
|
||||
exports.OptionalCallExpression = OptionalCallExpression;
|
||||
exports.OptionalMemberExpression = OptionalMemberExpression;
|
||||
exports.ParenthesizedExpression = ParenthesizedExpression;
|
||||
exports.PrivateName = PrivateName;
|
||||
exports.SequenceExpression = SequenceExpression;
|
||||
exports.Super = Super;
|
||||
exports.ThisExpression = ThisExpression;
|
||||
exports.UnaryExpression = UnaryExpression;
|
||||
exports.UpdateExpression = UpdateExpression;
|
||||
exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
|
||||
exports.YieldExpression = YieldExpression;
|
||||
var _t = require("@babel/types");
|
||||
var n = require("../node");
|
||||
const {
|
||||
isCallExpression,
|
||||
isLiteral,
|
||||
isMemberExpression,
|
||||
isNewExpression
|
||||
} = _t;
|
||||
function UnaryExpression(node) {
|
||||
if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" ||
|
||||
node.operator === "throw") {
|
||||
this.word(node.operator);
|
||||
this.space();
|
||||
} else {
|
||||
this.token(node.operator);
|
||||
}
|
||||
this.print(node.argument, node);
|
||||
}
|
||||
function DoExpression(node) {
|
||||
if (node.async) {
|
||||
this.word("async", true);
|
||||
this.space();
|
||||
}
|
||||
this.word("do");
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function ParenthesizedExpression(node) {
|
||||
this.tokenChar(40);
|
||||
this.print(node.expression, node);
|
||||
this.tokenChar(41);
|
||||
}
|
||||
function UpdateExpression(node) {
|
||||
if (node.prefix) {
|
||||
this.token(node.operator);
|
||||
this.print(node.argument, node);
|
||||
} else {
|
||||
this.printTerminatorless(node.argument, node, true);
|
||||
this.token(node.operator);
|
||||
}
|
||||
}
|
||||
function ConditionalExpression(node) {
|
||||
this.print(node.test, node);
|
||||
this.space();
|
||||
this.tokenChar(63);
|
||||
this.space();
|
||||
this.print(node.consequent, node);
|
||||
this.space();
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.alternate, node);
|
||||
}
|
||||
function NewExpression(node, parent) {
|
||||
this.word("new");
|
||||
this.space();
|
||||
this.print(node.callee, node);
|
||||
if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, {
|
||||
callee: node
|
||||
}) && !isMemberExpression(parent) && !isNewExpression(parent)) {
|
||||
return;
|
||||
}
|
||||
this.print(node.typeArguments, node);
|
||||
this.print(node.typeParameters, node);
|
||||
|
||||
if (node.optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
this.tokenChar(40);
|
||||
this.printList(node.arguments, node);
|
||||
this.tokenChar(41);
|
||||
}
|
||||
function SequenceExpression(node) {
|
||||
this.printList(node.expressions, node);
|
||||
}
|
||||
function ThisExpression() {
|
||||
this.word("this");
|
||||
}
|
||||
function Super() {
|
||||
this.word("super");
|
||||
}
|
||||
function isDecoratorMemberExpression(node) {
|
||||
switch (node.type) {
|
||||
case "Identifier":
|
||||
return true;
|
||||
case "MemberExpression":
|
||||
return !node.computed && node.property.type === "Identifier" && isDecoratorMemberExpression(node.object);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function shouldParenthesizeDecoratorExpression(node) {
|
||||
if (node.type === "ParenthesizedExpression") {
|
||||
return false;
|
||||
}
|
||||
return !isDecoratorMemberExpression(node.type === "CallExpression" ? node.callee : node);
|
||||
}
|
||||
function Decorator(node) {
|
||||
this.tokenChar(64);
|
||||
const {
|
||||
expression
|
||||
} = node;
|
||||
if (shouldParenthesizeDecoratorExpression(expression)) {
|
||||
this.tokenChar(40);
|
||||
this.print(expression, node);
|
||||
this.tokenChar(41);
|
||||
} else {
|
||||
this.print(expression, node);
|
||||
}
|
||||
this.newline();
|
||||
}
|
||||
function OptionalMemberExpression(node) {
|
||||
this.print(node.object, node);
|
||||
if (!node.computed && isMemberExpression(node.property)) {
|
||||
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
||||
}
|
||||
let computed = node.computed;
|
||||
if (isLiteral(node.property) && typeof node.property.value === "number") {
|
||||
computed = true;
|
||||
}
|
||||
if (node.optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
if (computed) {
|
||||
this.tokenChar(91);
|
||||
this.print(node.property, node);
|
||||
this.tokenChar(93);
|
||||
} else {
|
||||
if (!node.optional) {
|
||||
this.tokenChar(46);
|
||||
}
|
||||
this.print(node.property, node);
|
||||
}
|
||||
}
|
||||
function OptionalCallExpression(node) {
|
||||
this.print(node.callee, node);
|
||||
this.print(node.typeParameters, node);
|
||||
|
||||
if (node.optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
this.print(node.typeArguments, node);
|
||||
|
||||
this.tokenChar(40);
|
||||
this.printList(node.arguments, node);
|
||||
this.tokenChar(41);
|
||||
}
|
||||
function CallExpression(node) {
|
||||
this.print(node.callee, node);
|
||||
this.print(node.typeArguments, node);
|
||||
this.print(node.typeParameters, node);
|
||||
this.tokenChar(40);
|
||||
this.printList(node.arguments, node);
|
||||
this.tokenChar(41);
|
||||
}
|
||||
function Import() {
|
||||
this.word("import");
|
||||
}
|
||||
function AwaitExpression(node) {
|
||||
this.word("await");
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
this.printTerminatorless(node.argument, node, false);
|
||||
}
|
||||
}
|
||||
function YieldExpression(node) {
|
||||
this.word("yield", true);
|
||||
if (node.delegate) {
|
||||
this.tokenChar(42);
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
this.print(node.argument, node);
|
||||
}
|
||||
} else {
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
this.printTerminatorless(node.argument, node, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
function EmptyStatement() {
|
||||
this.semicolon(true);
|
||||
}
|
||||
|
||||
function ExpressionStatement(node) {
|
||||
this.print(node.expression, node);
|
||||
this.semicolon();
|
||||
}
|
||||
function AssignmentPattern(node) {
|
||||
this.print(node.left, node);
|
||||
if (node.left.optional) this.tokenChar(63);
|
||||
this.print(node.left.typeAnnotation, node);
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.right, node);
|
||||
}
|
||||
function AssignmentExpression(node, parent) {
|
||||
const parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent);
|
||||
if (parens) {
|
||||
this.tokenChar(40);
|
||||
}
|
||||
this.print(node.left, node);
|
||||
this.space();
|
||||
if (node.operator === "in" || node.operator === "instanceof") {
|
||||
this.word(node.operator);
|
||||
} else {
|
||||
this.token(node.operator);
|
||||
}
|
||||
this.space();
|
||||
this.print(node.right, node);
|
||||
if (parens) {
|
||||
this.tokenChar(41);
|
||||
}
|
||||
}
|
||||
function BindExpression(node) {
|
||||
this.print(node.object, node);
|
||||
this.token("::");
|
||||
this.print(node.callee, node);
|
||||
}
|
||||
function MemberExpression(node) {
|
||||
this.print(node.object, node);
|
||||
if (!node.computed && isMemberExpression(node.property)) {
|
||||
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
||||
}
|
||||
let computed = node.computed;
|
||||
if (isLiteral(node.property) && typeof node.property.value === "number") {
|
||||
computed = true;
|
||||
}
|
||||
if (computed) {
|
||||
this.tokenChar(91);
|
||||
this.print(node.property, node);
|
||||
this.tokenChar(93);
|
||||
} else {
|
||||
this.tokenChar(46);
|
||||
this.print(node.property, node);
|
||||
}
|
||||
}
|
||||
function MetaProperty(node) {
|
||||
this.print(node.meta, node);
|
||||
this.tokenChar(46);
|
||||
this.print(node.property, node);
|
||||
}
|
||||
function PrivateName(node) {
|
||||
this.tokenChar(35);
|
||||
this.print(node.id, node);
|
||||
}
|
||||
function V8IntrinsicIdentifier(node) {
|
||||
this.tokenChar(37);
|
||||
this.word(node.name);
|
||||
}
|
||||
function ModuleExpression(node) {
|
||||
this.word("module", true);
|
||||
this.space();
|
||||
this.tokenChar(123);
|
||||
this.indent();
|
||||
const {
|
||||
body
|
||||
} = node;
|
||||
if (body.body.length || body.directives.length) {
|
||||
this.newline();
|
||||
}
|
||||
this.print(body, node);
|
||||
this.dedent();
|
||||
this.sourceWithOffset("end", node.loc, 0, -1);
|
||||
this.rightBrace();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=expressions.js.map
|
1
node_modules/@babel/generator/lib/generators/expressions.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/expressions.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
663
node_modules/@babel/generator/lib/generators/flow.js
generated
vendored
Normal file
663
node_modules/@babel/generator/lib/generators/flow.js
generated
vendored
Normal file
@ -0,0 +1,663 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.AnyTypeAnnotation = AnyTypeAnnotation;
|
||||
exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
|
||||
exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
|
||||
exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
|
||||
exports.DeclareClass = DeclareClass;
|
||||
exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
|
||||
exports.DeclareExportDeclaration = DeclareExportDeclaration;
|
||||
exports.DeclareFunction = DeclareFunction;
|
||||
exports.DeclareInterface = DeclareInterface;
|
||||
exports.DeclareModule = DeclareModule;
|
||||
exports.DeclareModuleExports = DeclareModuleExports;
|
||||
exports.DeclareOpaqueType = DeclareOpaqueType;
|
||||
exports.DeclareTypeAlias = DeclareTypeAlias;
|
||||
exports.DeclareVariable = DeclareVariable;
|
||||
exports.DeclaredPredicate = DeclaredPredicate;
|
||||
exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
|
||||
exports.EnumBooleanBody = EnumBooleanBody;
|
||||
exports.EnumBooleanMember = EnumBooleanMember;
|
||||
exports.EnumDeclaration = EnumDeclaration;
|
||||
exports.EnumDefaultedMember = EnumDefaultedMember;
|
||||
exports.EnumNumberBody = EnumNumberBody;
|
||||
exports.EnumNumberMember = EnumNumberMember;
|
||||
exports.EnumStringBody = EnumStringBody;
|
||||
exports.EnumStringMember = EnumStringMember;
|
||||
exports.EnumSymbolBody = EnumSymbolBody;
|
||||
exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
|
||||
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
||||
exports.FunctionTypeParam = FunctionTypeParam;
|
||||
exports.IndexedAccessType = IndexedAccessType;
|
||||
exports.InferredPredicate = InferredPredicate;
|
||||
exports.InterfaceDeclaration = InterfaceDeclaration;
|
||||
exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends;
|
||||
exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
|
||||
exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
|
||||
exports.MixedTypeAnnotation = MixedTypeAnnotation;
|
||||
exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
|
||||
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
||||
Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types2.NumericLiteral;
|
||||
}
|
||||
});
|
||||
exports.NumberTypeAnnotation = NumberTypeAnnotation;
|
||||
exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
|
||||
exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
|
||||
exports.ObjectTypeIndexer = ObjectTypeIndexer;
|
||||
exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
|
||||
exports.ObjectTypeProperty = ObjectTypeProperty;
|
||||
exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
|
||||
exports.OpaqueType = OpaqueType;
|
||||
exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
|
||||
exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
|
||||
Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types2.StringLiteral;
|
||||
}
|
||||
});
|
||||
exports.StringTypeAnnotation = StringTypeAnnotation;
|
||||
exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
|
||||
exports.ThisTypeAnnotation = ThisTypeAnnotation;
|
||||
exports.TupleTypeAnnotation = TupleTypeAnnotation;
|
||||
exports.TypeAlias = TypeAlias;
|
||||
exports.TypeAnnotation = TypeAnnotation;
|
||||
exports.TypeCastExpression = TypeCastExpression;
|
||||
exports.TypeParameter = TypeParameter;
|
||||
exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation;
|
||||
exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
|
||||
exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
||||
exports.Variance = Variance;
|
||||
exports.VoidTypeAnnotation = VoidTypeAnnotation;
|
||||
exports._interfaceish = _interfaceish;
|
||||
exports._variance = _variance;
|
||||
var _t = require("@babel/types");
|
||||
var _modules = require("./modules");
|
||||
var _types2 = require("./types");
|
||||
const {
|
||||
isDeclareExportDeclaration,
|
||||
isStatement
|
||||
} = _t;
|
||||
function AnyTypeAnnotation() {
|
||||
this.word("any");
|
||||
}
|
||||
function ArrayTypeAnnotation(node) {
|
||||
this.print(node.elementType, node, true);
|
||||
this.tokenChar(91);
|
||||
this.tokenChar(93);
|
||||
}
|
||||
function BooleanTypeAnnotation() {
|
||||
this.word("boolean");
|
||||
}
|
||||
function BooleanLiteralTypeAnnotation(node) {
|
||||
this.word(node.value ? "true" : "false");
|
||||
}
|
||||
function NullLiteralTypeAnnotation() {
|
||||
this.word("null");
|
||||
}
|
||||
function DeclareClass(node, parent) {
|
||||
if (!isDeclareExportDeclaration(parent)) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
this.word("class");
|
||||
this.space();
|
||||
this._interfaceish(node);
|
||||
}
|
||||
function DeclareFunction(node, parent) {
|
||||
if (!isDeclareExportDeclaration(parent)) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
this.word("function");
|
||||
this.space();
|
||||
this.print(node.id, node);
|
||||
this.print(node.id.typeAnnotation.typeAnnotation, node);
|
||||
if (node.predicate) {
|
||||
this.space();
|
||||
this.print(node.predicate, node);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function InferredPredicate() {
|
||||
this.tokenChar(37);
|
||||
this.word("checks");
|
||||
}
|
||||
function DeclaredPredicate(node) {
|
||||
this.tokenChar(37);
|
||||
this.word("checks");
|
||||
this.tokenChar(40);
|
||||
this.print(node.value, node);
|
||||
this.tokenChar(41);
|
||||
}
|
||||
function DeclareInterface(node) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
this.InterfaceDeclaration(node);
|
||||
}
|
||||
function DeclareModule(node) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
this.word("module");
|
||||
this.space();
|
||||
this.print(node.id, node);
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function DeclareModuleExports(node) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
this.word("module");
|
||||
this.tokenChar(46);
|
||||
this.word("exports");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
function DeclareTypeAlias(node) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
this.TypeAlias(node);
|
||||
}
|
||||
function DeclareOpaqueType(node, parent) {
|
||||
if (!isDeclareExportDeclaration(parent)) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
this.OpaqueType(node);
|
||||
}
|
||||
function DeclareVariable(node, parent) {
|
||||
if (!isDeclareExportDeclaration(parent)) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
this.word("var");
|
||||
this.space();
|
||||
this.print(node.id, node);
|
||||
this.print(node.id.typeAnnotation, node);
|
||||
this.semicolon();
|
||||
}
|
||||
function DeclareExportDeclaration(node) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
this.word("export");
|
||||
this.space();
|
||||
if (node.default) {
|
||||
this.word("default");
|
||||
this.space();
|
||||
}
|
||||
FlowExportDeclaration.call(this, node);
|
||||
}
|
||||
function DeclareExportAllDeclaration(node) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
_modules.ExportAllDeclaration.call(this, node);
|
||||
}
|
||||
function EnumDeclaration(node) {
|
||||
const {
|
||||
id,
|
||||
body
|
||||
} = node;
|
||||
this.word("enum");
|
||||
this.space();
|
||||
this.print(id, node);
|
||||
this.print(body, node);
|
||||
}
|
||||
function enumExplicitType(context, name, hasExplicitType) {
|
||||
if (hasExplicitType) {
|
||||
context.space();
|
||||
context.word("of");
|
||||
context.space();
|
||||
context.word(name);
|
||||
}
|
||||
context.space();
|
||||
}
|
||||
function enumBody(context, node) {
|
||||
const {
|
||||
members
|
||||
} = node;
|
||||
context.token("{");
|
||||
context.indent();
|
||||
context.newline();
|
||||
for (const member of members) {
|
||||
context.print(member, node);
|
||||
context.newline();
|
||||
}
|
||||
if (node.hasUnknownMembers) {
|
||||
context.token("...");
|
||||
context.newline();
|
||||
}
|
||||
context.dedent();
|
||||
context.token("}");
|
||||
}
|
||||
function EnumBooleanBody(node) {
|
||||
const {
|
||||
explicitType
|
||||
} = node;
|
||||
enumExplicitType(this, "boolean", explicitType);
|
||||
enumBody(this, node);
|
||||
}
|
||||
function EnumNumberBody(node) {
|
||||
const {
|
||||
explicitType
|
||||
} = node;
|
||||
enumExplicitType(this, "number", explicitType);
|
||||
enumBody(this, node);
|
||||
}
|
||||
function EnumStringBody(node) {
|
||||
const {
|
||||
explicitType
|
||||
} = node;
|
||||
enumExplicitType(this, "string", explicitType);
|
||||
enumBody(this, node);
|
||||
}
|
||||
function EnumSymbolBody(node) {
|
||||
enumExplicitType(this, "symbol", true);
|
||||
enumBody(this, node);
|
||||
}
|
||||
function EnumDefaultedMember(node) {
|
||||
const {
|
||||
id
|
||||
} = node;
|
||||
this.print(id, node);
|
||||
this.tokenChar(44);
|
||||
}
|
||||
function enumInitializedMember(context, node) {
|
||||
const {
|
||||
id,
|
||||
init
|
||||
} = node;
|
||||
context.print(id, node);
|
||||
context.space();
|
||||
context.token("=");
|
||||
context.space();
|
||||
context.print(init, node);
|
||||
context.token(",");
|
||||
}
|
||||
function EnumBooleanMember(node) {
|
||||
enumInitializedMember(this, node);
|
||||
}
|
||||
function EnumNumberMember(node) {
|
||||
enumInitializedMember(this, node);
|
||||
}
|
||||
function EnumStringMember(node) {
|
||||
enumInitializedMember(this, node);
|
||||
}
|
||||
function FlowExportDeclaration(node) {
|
||||
if (node.declaration) {
|
||||
const declar = node.declaration;
|
||||
this.print(declar, node);
|
||||
if (!isStatement(declar)) this.semicolon();
|
||||
} else {
|
||||
this.tokenChar(123);
|
||||
if (node.specifiers.length) {
|
||||
this.space();
|
||||
this.printList(node.specifiers, node);
|
||||
this.space();
|
||||
}
|
||||
this.tokenChar(125);
|
||||
if (node.source) {
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
this.print(node.source, node);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
}
|
||||
function ExistsTypeAnnotation() {
|
||||
this.tokenChar(42);
|
||||
}
|
||||
function FunctionTypeAnnotation(node, parent) {
|
||||
this.print(node.typeParameters, node);
|
||||
this.tokenChar(40);
|
||||
if (node.this) {
|
||||
this.word("this");
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.this.typeAnnotation, node);
|
||||
if (node.params.length || node.rest) {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
}
|
||||
}
|
||||
this.printList(node.params, node);
|
||||
if (node.rest) {
|
||||
if (node.params.length) {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
}
|
||||
this.token("...");
|
||||
this.print(node.rest, node);
|
||||
}
|
||||
this.tokenChar(41);
|
||||
|
||||
if (parent && (parent.type === "ObjectTypeCallProperty" || parent.type === "ObjectTypeInternalSlot" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method)) {
|
||||
this.tokenChar(58);
|
||||
} else {
|
||||
this.space();
|
||||
this.token("=>");
|
||||
}
|
||||
this.space();
|
||||
this.print(node.returnType, node);
|
||||
}
|
||||
function FunctionTypeParam(node) {
|
||||
this.print(node.name, node);
|
||||
if (node.optional) this.tokenChar(63);
|
||||
if (node.name) {
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
}
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
function InterfaceExtends(node) {
|
||||
this.print(node.id, node);
|
||||
this.print(node.typeParameters, node, true);
|
||||
}
|
||||
function _interfaceish(node) {
|
||||
var _node$extends;
|
||||
this.print(node.id, node);
|
||||
this.print(node.typeParameters, node);
|
||||
if ((_node$extends = node.extends) != null && _node$extends.length) {
|
||||
this.space();
|
||||
this.word("extends");
|
||||
this.space();
|
||||
this.printList(node.extends, node);
|
||||
}
|
||||
if (node.mixins && node.mixins.length) {
|
||||
this.space();
|
||||
this.word("mixins");
|
||||
this.space();
|
||||
this.printList(node.mixins, node);
|
||||
}
|
||||
if (node.implements && node.implements.length) {
|
||||
this.space();
|
||||
this.word("implements");
|
||||
this.space();
|
||||
this.printList(node.implements, node);
|
||||
}
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function _variance(node) {
|
||||
if (node.variance) {
|
||||
if (node.variance.kind === "plus") {
|
||||
this.tokenChar(43);
|
||||
} else if (node.variance.kind === "minus") {
|
||||
this.tokenChar(45);
|
||||
}
|
||||
}
|
||||
}
|
||||
function InterfaceDeclaration(node) {
|
||||
this.word("interface");
|
||||
this.space();
|
||||
this._interfaceish(node);
|
||||
}
|
||||
function andSeparator() {
|
||||
this.space();
|
||||
this.tokenChar(38);
|
||||
this.space();
|
||||
}
|
||||
function InterfaceTypeAnnotation(node) {
|
||||
this.word("interface");
|
||||
if (node.extends && node.extends.length) {
|
||||
this.space();
|
||||
this.word("extends");
|
||||
this.space();
|
||||
this.printList(node.extends, node);
|
||||
}
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function IntersectionTypeAnnotation(node) {
|
||||
this.printJoin(node.types, node, {
|
||||
separator: andSeparator
|
||||
});
|
||||
}
|
||||
function MixedTypeAnnotation() {
|
||||
this.word("mixed");
|
||||
}
|
||||
function EmptyTypeAnnotation() {
|
||||
this.word("empty");
|
||||
}
|
||||
function NullableTypeAnnotation(node) {
|
||||
this.tokenChar(63);
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
function NumberTypeAnnotation() {
|
||||
this.word("number");
|
||||
}
|
||||
function StringTypeAnnotation() {
|
||||
this.word("string");
|
||||
}
|
||||
function ThisTypeAnnotation() {
|
||||
this.word("this");
|
||||
}
|
||||
function TupleTypeAnnotation(node) {
|
||||
this.tokenChar(91);
|
||||
this.printList(node.types, node);
|
||||
this.tokenChar(93);
|
||||
}
|
||||
function TypeofTypeAnnotation(node) {
|
||||
this.word("typeof");
|
||||
this.space();
|
||||
this.print(node.argument, node);
|
||||
}
|
||||
function TypeAlias(node) {
|
||||
this.word("type");
|
||||
this.space();
|
||||
this.print(node.id, node);
|
||||
this.print(node.typeParameters, node);
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.right, node);
|
||||
this.semicolon();
|
||||
}
|
||||
function TypeAnnotation(node) {
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
if (node.optional) this.tokenChar(63);
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
function TypeParameterInstantiation(node) {
|
||||
this.tokenChar(60);
|
||||
this.printList(node.params, node, {});
|
||||
this.tokenChar(62);
|
||||
}
|
||||
function TypeParameter(node) {
|
||||
this._variance(node);
|
||||
this.word(node.name);
|
||||
if (node.bound) {
|
||||
this.print(node.bound, node);
|
||||
}
|
||||
if (node.default) {
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.default, node);
|
||||
}
|
||||
}
|
||||
function OpaqueType(node) {
|
||||
this.word("opaque");
|
||||
this.space();
|
||||
this.word("type");
|
||||
this.space();
|
||||
this.print(node.id, node);
|
||||
this.print(node.typeParameters, node);
|
||||
if (node.supertype) {
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.supertype, node);
|
||||
}
|
||||
if (node.impltype) {
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.impltype, node);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function ObjectTypeAnnotation(node) {
|
||||
if (node.exact) {
|
||||
this.token("{|");
|
||||
} else {
|
||||
this.tokenChar(123);
|
||||
}
|
||||
|
||||
const props = [...node.properties, ...(node.callProperties || []), ...(node.indexers || []), ...(node.internalSlots || [])];
|
||||
if (props.length) {
|
||||
this.newline();
|
||||
this.space();
|
||||
this.printJoin(props, node, {
|
||||
addNewlines(leading) {
|
||||
if (leading && !props[0]) return 1;
|
||||
},
|
||||
indent: true,
|
||||
statement: true,
|
||||
iterator: () => {
|
||||
if (props.length !== 1 || node.inexact) {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.space();
|
||||
}
|
||||
if (node.inexact) {
|
||||
this.indent();
|
||||
this.token("...");
|
||||
if (props.length) {
|
||||
this.newline();
|
||||
}
|
||||
this.dedent();
|
||||
}
|
||||
if (node.exact) {
|
||||
this.token("|}");
|
||||
} else {
|
||||
this.tokenChar(125);
|
||||
}
|
||||
}
|
||||
function ObjectTypeInternalSlot(node) {
|
||||
if (node.static) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
}
|
||||
this.tokenChar(91);
|
||||
this.tokenChar(91);
|
||||
this.print(node.id, node);
|
||||
this.tokenChar(93);
|
||||
this.tokenChar(93);
|
||||
if (node.optional) this.tokenChar(63);
|
||||
if (!node.method) {
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
}
|
||||
this.print(node.value, node);
|
||||
}
|
||||
function ObjectTypeCallProperty(node) {
|
||||
if (node.static) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
}
|
||||
this.print(node.value, node);
|
||||
}
|
||||
function ObjectTypeIndexer(node) {
|
||||
if (node.static) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
}
|
||||
this._variance(node);
|
||||
this.tokenChar(91);
|
||||
if (node.id) {
|
||||
this.print(node.id, node);
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
}
|
||||
this.print(node.key, node);
|
||||
this.tokenChar(93);
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.value, node);
|
||||
}
|
||||
function ObjectTypeProperty(node) {
|
||||
if (node.proto) {
|
||||
this.word("proto");
|
||||
this.space();
|
||||
}
|
||||
if (node.static) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
}
|
||||
if (node.kind === "get" || node.kind === "set") {
|
||||
this.word(node.kind);
|
||||
this.space();
|
||||
}
|
||||
this._variance(node);
|
||||
this.print(node.key, node);
|
||||
if (node.optional) this.tokenChar(63);
|
||||
if (!node.method) {
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
}
|
||||
this.print(node.value, node);
|
||||
}
|
||||
function ObjectTypeSpreadProperty(node) {
|
||||
this.token("...");
|
||||
this.print(node.argument, node);
|
||||
}
|
||||
function QualifiedTypeIdentifier(node) {
|
||||
this.print(node.qualification, node);
|
||||
this.tokenChar(46);
|
||||
this.print(node.id, node);
|
||||
}
|
||||
function SymbolTypeAnnotation() {
|
||||
this.word("symbol");
|
||||
}
|
||||
function orSeparator() {
|
||||
this.space();
|
||||
this.tokenChar(124);
|
||||
this.space();
|
||||
}
|
||||
function UnionTypeAnnotation(node) {
|
||||
this.printJoin(node.types, node, {
|
||||
separator: orSeparator
|
||||
});
|
||||
}
|
||||
function TypeCastExpression(node) {
|
||||
this.tokenChar(40);
|
||||
this.print(node.expression, node);
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.tokenChar(41);
|
||||
}
|
||||
function Variance(node) {
|
||||
if (node.kind === "plus") {
|
||||
this.tokenChar(43);
|
||||
} else {
|
||||
this.tokenChar(45);
|
||||
}
|
||||
}
|
||||
function VoidTypeAnnotation() {
|
||||
this.word("void");
|
||||
}
|
||||
function IndexedAccessType(node) {
|
||||
this.print(node.objectType, node, true);
|
||||
this.tokenChar(91);
|
||||
this.print(node.indexType, node);
|
||||
this.tokenChar(93);
|
||||
}
|
||||
function OptionalIndexedAccessType(node) {
|
||||
this.print(node.objectType, node);
|
||||
if (node.optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
this.tokenChar(91);
|
||||
this.print(node.indexType, node);
|
||||
this.tokenChar(93);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=flow.js.map
|
1
node_modules/@babel/generator/lib/generators/flow.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/flow.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
128
node_modules/@babel/generator/lib/generators/index.js
generated
vendored
Normal file
128
node_modules/@babel/generator/lib/generators/index.js
generated
vendored
Normal file
@ -0,0 +1,128 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _templateLiterals = require("./template-literals");
|
||||
Object.keys(_templateLiterals).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _templateLiterals[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _templateLiterals[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _expressions = require("./expressions");
|
||||
Object.keys(_expressions).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _expressions[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _expressions[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _statements = require("./statements");
|
||||
Object.keys(_statements).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _statements[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _statements[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _classes = require("./classes");
|
||||
Object.keys(_classes).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _classes[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _classes[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _methods = require("./methods");
|
||||
Object.keys(_methods).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _methods[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _methods[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _modules = require("./modules");
|
||||
Object.keys(_modules).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _modules[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _modules[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _types = require("./types");
|
||||
Object.keys(_types).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _types[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _flow = require("./flow");
|
||||
Object.keys(_flow).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _flow[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _flow[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _base = require("./base");
|
||||
Object.keys(_base).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _base[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _base[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _jsx = require("./jsx");
|
||||
Object.keys(_jsx).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _jsx[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _jsx[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _typescript = require("./typescript");
|
||||
Object.keys(_typescript).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (key in exports && exports[key] === _typescript[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _typescript[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@babel/generator/lib/generators/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":[],"sources":["../../src/generators/index.ts"],"sourcesContent":["export * from \"./template-literals\";\nexport * from \"./expressions\";\nexport * from \"./statements\";\nexport * from \"./classes\";\nexport * from \"./methods\";\nexport * from \"./modules\";\nexport * from \"./types\";\nexport * from \"./flow\";\nexport * from \"./base\";\nexport * from \"./jsx\";\nexport * from \"./typescript\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
123
node_modules/@babel/generator/lib/generators/jsx.js
generated
vendored
Normal file
123
node_modules/@babel/generator/lib/generators/jsx.js
generated
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.JSXAttribute = JSXAttribute;
|
||||
exports.JSXClosingElement = JSXClosingElement;
|
||||
exports.JSXClosingFragment = JSXClosingFragment;
|
||||
exports.JSXElement = JSXElement;
|
||||
exports.JSXEmptyExpression = JSXEmptyExpression;
|
||||
exports.JSXExpressionContainer = JSXExpressionContainer;
|
||||
exports.JSXFragment = JSXFragment;
|
||||
exports.JSXIdentifier = JSXIdentifier;
|
||||
exports.JSXMemberExpression = JSXMemberExpression;
|
||||
exports.JSXNamespacedName = JSXNamespacedName;
|
||||
exports.JSXOpeningElement = JSXOpeningElement;
|
||||
exports.JSXOpeningFragment = JSXOpeningFragment;
|
||||
exports.JSXSpreadAttribute = JSXSpreadAttribute;
|
||||
exports.JSXSpreadChild = JSXSpreadChild;
|
||||
exports.JSXText = JSXText;
|
||||
function JSXAttribute(node) {
|
||||
this.print(node.name, node);
|
||||
if (node.value) {
|
||||
this.tokenChar(61);
|
||||
this.print(node.value, node);
|
||||
}
|
||||
}
|
||||
function JSXIdentifier(node) {
|
||||
this.word(node.name);
|
||||
}
|
||||
function JSXNamespacedName(node) {
|
||||
this.print(node.namespace, node);
|
||||
this.tokenChar(58);
|
||||
this.print(node.name, node);
|
||||
}
|
||||
function JSXMemberExpression(node) {
|
||||
this.print(node.object, node);
|
||||
this.tokenChar(46);
|
||||
this.print(node.property, node);
|
||||
}
|
||||
function JSXSpreadAttribute(node) {
|
||||
this.tokenChar(123);
|
||||
this.token("...");
|
||||
this.print(node.argument, node);
|
||||
this.tokenChar(125);
|
||||
}
|
||||
function JSXExpressionContainer(node) {
|
||||
this.tokenChar(123);
|
||||
this.print(node.expression, node);
|
||||
this.tokenChar(125);
|
||||
}
|
||||
function JSXSpreadChild(node) {
|
||||
this.tokenChar(123);
|
||||
this.token("...");
|
||||
this.print(node.expression, node);
|
||||
this.tokenChar(125);
|
||||
}
|
||||
function JSXText(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
if (raw !== undefined) {
|
||||
this.token(raw, true);
|
||||
} else {
|
||||
this.token(node.value, true);
|
||||
}
|
||||
}
|
||||
function JSXElement(node) {
|
||||
const open = node.openingElement;
|
||||
this.print(open, node);
|
||||
if (open.selfClosing) return;
|
||||
this.indent();
|
||||
for (const child of node.children) {
|
||||
this.print(child, node);
|
||||
}
|
||||
this.dedent();
|
||||
this.print(node.closingElement, node);
|
||||
}
|
||||
function spaceSeparator() {
|
||||
this.space();
|
||||
}
|
||||
function JSXOpeningElement(node) {
|
||||
this.tokenChar(60);
|
||||
this.print(node.name, node);
|
||||
this.print(node.typeParameters, node);
|
||||
if (node.attributes.length > 0) {
|
||||
this.space();
|
||||
this.printJoin(node.attributes, node, {
|
||||
separator: spaceSeparator
|
||||
});
|
||||
}
|
||||
if (node.selfClosing) {
|
||||
this.space();
|
||||
this.token("/>");
|
||||
} else {
|
||||
this.tokenChar(62);
|
||||
}
|
||||
}
|
||||
function JSXClosingElement(node) {
|
||||
this.token("</");
|
||||
this.print(node.name, node);
|
||||
this.tokenChar(62);
|
||||
}
|
||||
function JSXEmptyExpression() {
|
||||
this.printInnerComments();
|
||||
}
|
||||
function JSXFragment(node) {
|
||||
this.print(node.openingFragment, node);
|
||||
this.indent();
|
||||
for (const child of node.children) {
|
||||
this.print(child, node);
|
||||
}
|
||||
this.dedent();
|
||||
this.print(node.closingFragment, node);
|
||||
}
|
||||
function JSXOpeningFragment() {
|
||||
this.tokenChar(60);
|
||||
this.tokenChar(62);
|
||||
}
|
||||
function JSXClosingFragment() {
|
||||
this.token("</");
|
||||
this.tokenChar(62);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=jsx.js.map
|
1
node_modules/@babel/generator/lib/generators/jsx.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/jsx.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
137
node_modules/@babel/generator/lib/generators/methods.js
generated
vendored
Normal file
137
node_modules/@babel/generator/lib/generators/methods.js
generated
vendored
Normal file
@ -0,0 +1,137 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
||||
exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression;
|
||||
exports._functionHead = _functionHead;
|
||||
exports._methodHead = _methodHead;
|
||||
exports._param = _param;
|
||||
exports._parameters = _parameters;
|
||||
exports._params = _params;
|
||||
exports._predicate = _predicate;
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
isIdentifier
|
||||
} = _t;
|
||||
function _params(node) {
|
||||
this.print(node.typeParameters, node);
|
||||
this.tokenChar(40);
|
||||
this._parameters(node.params, node);
|
||||
this.tokenChar(41);
|
||||
const noLineTerminator = node.type === "ArrowFunctionExpression";
|
||||
this.print(node.returnType, node, noLineTerminator);
|
||||
this._noLineTerminator = noLineTerminator;
|
||||
}
|
||||
function _parameters(parameters, parent) {
|
||||
const paramLength = parameters.length;
|
||||
for (let i = 0; i < paramLength; i++) {
|
||||
this._param(parameters[i], parent);
|
||||
if (i < parameters.length - 1) {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
}
|
||||
}
|
||||
}
|
||||
function _param(parameter, parent) {
|
||||
this.printJoin(parameter.decorators, parameter);
|
||||
this.print(parameter, parent);
|
||||
if (
|
||||
parameter.optional) {
|
||||
this.tokenChar(63);
|
||||
}
|
||||
|
||||
this.print(
|
||||
parameter.typeAnnotation, parameter);
|
||||
}
|
||||
|
||||
function _methodHead(node) {
|
||||
const kind = node.kind;
|
||||
const key = node.key;
|
||||
if (kind === "get" || kind === "set") {
|
||||
this.word(kind);
|
||||
this.space();
|
||||
}
|
||||
if (node.async) {
|
||||
this.word("async", true);
|
||||
this.space();
|
||||
}
|
||||
if (kind === "method" ||
|
||||
kind === "init") {
|
||||
if (node.generator) {
|
||||
this.tokenChar(42);
|
||||
}
|
||||
}
|
||||
if (node.computed) {
|
||||
this.tokenChar(91);
|
||||
this.print(key, node);
|
||||
this.tokenChar(93);
|
||||
} else {
|
||||
this.print(key, node);
|
||||
}
|
||||
if (
|
||||
node.optional) {
|
||||
this.tokenChar(63);
|
||||
}
|
||||
this._params(node);
|
||||
}
|
||||
function _predicate(node, noLineTerminatorAfter) {
|
||||
if (node.predicate) {
|
||||
if (!node.returnType) {
|
||||
this.tokenChar(58);
|
||||
}
|
||||
this.space();
|
||||
this.print(node.predicate, node, noLineTerminatorAfter);
|
||||
}
|
||||
}
|
||||
function _functionHead(node) {
|
||||
if (node.async) {
|
||||
this.word("async");
|
||||
this._endsWithInnerRaw = false;
|
||||
this.space();
|
||||
}
|
||||
this.word("function");
|
||||
if (node.generator) {
|
||||
this._endsWithInnerRaw = false;
|
||||
this.tokenChar(42);
|
||||
}
|
||||
this.space();
|
||||
if (node.id) {
|
||||
this.print(node.id, node);
|
||||
}
|
||||
this._params(node);
|
||||
if (node.type !== "TSDeclareFunction") {
|
||||
this._predicate(node);
|
||||
}
|
||||
}
|
||||
function FunctionExpression(node) {
|
||||
this._functionHead(node);
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function ArrowFunctionExpression(node) {
|
||||
if (node.async) {
|
||||
this.word("async", true);
|
||||
this.space();
|
||||
}
|
||||
|
||||
let firstParam;
|
||||
if (!this.format.retainLines && node.params.length === 1 && isIdentifier(firstParam = node.params[0]) && !hasTypesOrComments(node, firstParam)) {
|
||||
this.print(firstParam, node, true);
|
||||
} else {
|
||||
this._params(node);
|
||||
}
|
||||
this._predicate(node, true);
|
||||
this.space();
|
||||
this.printInnerComments();
|
||||
this.token("=>");
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function hasTypesOrComments(node, param) {
|
||||
var _param$leadingComment, _param$trailingCommen;
|
||||
return !!(node.typeParameters || node.returnType || node.predicate || param.typeAnnotation || param.optional || (_param$leadingComment = param.leadingComments) != null && _param$leadingComment.length || (_param$trailingCommen = param.trailingComments) != null && _param$trailingCommen.length);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=methods.js.map
|
1
node_modules/@babel/generator/lib/generators/methods.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/methods.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
244
node_modules/@babel/generator/lib/generators/modules.js
generated
vendored
Normal file
244
node_modules/@babel/generator/lib/generators/modules.js
generated
vendored
Normal file
@ -0,0 +1,244 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ExportAllDeclaration = ExportAllDeclaration;
|
||||
exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
|
||||
exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
|
||||
exports.ExportNamedDeclaration = ExportNamedDeclaration;
|
||||
exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
|
||||
exports.ExportSpecifier = ExportSpecifier;
|
||||
exports.ImportAttribute = ImportAttribute;
|
||||
exports.ImportDeclaration = ImportDeclaration;
|
||||
exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
|
||||
exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
|
||||
exports.ImportSpecifier = ImportSpecifier;
|
||||
exports._printAssertions = _printAssertions;
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
isClassDeclaration,
|
||||
isExportDefaultSpecifier,
|
||||
isExportNamespaceSpecifier,
|
||||
isImportDefaultSpecifier,
|
||||
isImportNamespaceSpecifier,
|
||||
isStatement
|
||||
} = _t;
|
||||
function ImportSpecifier(node) {
|
||||
if (node.importKind === "type" || node.importKind === "typeof") {
|
||||
this.word(node.importKind);
|
||||
this.space();
|
||||
}
|
||||
this.print(node.imported, node);
|
||||
if (node.local && node.local.name !== node.imported.name) {
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.local, node);
|
||||
}
|
||||
}
|
||||
function ImportDefaultSpecifier(node) {
|
||||
this.print(node.local, node);
|
||||
}
|
||||
function ExportDefaultSpecifier(node) {
|
||||
this.print(node.exported, node);
|
||||
}
|
||||
function ExportSpecifier(node) {
|
||||
if (node.exportKind === "type") {
|
||||
this.word("type");
|
||||
this.space();
|
||||
}
|
||||
this.print(node.local, node);
|
||||
if (node.exported && node.local.name !== node.exported.name) {
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.exported, node);
|
||||
}
|
||||
}
|
||||
function ExportNamespaceSpecifier(node) {
|
||||
this.tokenChar(42);
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.exported, node);
|
||||
}
|
||||
function _printAssertions(node) {
|
||||
this.word("assert");
|
||||
this.space();
|
||||
this.tokenChar(123);
|
||||
this.space();
|
||||
this.printList(node.assertions, node);
|
||||
this.space();
|
||||
this.tokenChar(125);
|
||||
}
|
||||
function ExportAllDeclaration(node) {
|
||||
var _node$assertions;
|
||||
this.word("export");
|
||||
this.space();
|
||||
if (node.exportKind === "type") {
|
||||
this.word("type");
|
||||
this.space();
|
||||
}
|
||||
this.tokenChar(42);
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
if ((_node$assertions = node.assertions) != null && _node$assertions.length) {
|
||||
this.print(node.source, node, true);
|
||||
this.space();
|
||||
this._printAssertions(node);
|
||||
} else {
|
||||
this.print(node.source, node);
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function ExportNamedDeclaration(node) {
|
||||
{
|
||||
if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
|
||||
this.printJoin(node.declaration.decorators, node);
|
||||
}
|
||||
}
|
||||
this.word("export");
|
||||
this.space();
|
||||
if (node.declaration) {
|
||||
const declar = node.declaration;
|
||||
this.print(declar, node);
|
||||
if (!isStatement(declar)) this.semicolon();
|
||||
} else {
|
||||
if (node.exportKind === "type") {
|
||||
this.word("type");
|
||||
this.space();
|
||||
}
|
||||
const specifiers = node.specifiers.slice(0);
|
||||
|
||||
let hasSpecial = false;
|
||||
for (;;) {
|
||||
const first = specifiers[0];
|
||||
if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) {
|
||||
hasSpecial = true;
|
||||
this.print(specifiers.shift(), node);
|
||||
if (specifiers.length) {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (specifiers.length || !specifiers.length && !hasSpecial) {
|
||||
this.tokenChar(123);
|
||||
if (specifiers.length) {
|
||||
this.space();
|
||||
this.printList(specifiers, node);
|
||||
this.space();
|
||||
}
|
||||
this.tokenChar(125);
|
||||
}
|
||||
if (node.source) {
|
||||
var _node$assertions2;
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
if ((_node$assertions2 = node.assertions) != null && _node$assertions2.length) {
|
||||
this.print(node.source, node, true);
|
||||
this.space();
|
||||
this._printAssertions(node);
|
||||
} else {
|
||||
this.print(node.source, node);
|
||||
}
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
}
|
||||
function ExportDefaultDeclaration(node) {
|
||||
{
|
||||
if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
|
||||
this.printJoin(node.declaration.decorators, node);
|
||||
}
|
||||
}
|
||||
this.word("export");
|
||||
this.noIndentInnerCommentsHere();
|
||||
this.space();
|
||||
this.word("default");
|
||||
this.space();
|
||||
const declar = node.declaration;
|
||||
this.print(declar, node);
|
||||
if (!isStatement(declar)) this.semicolon();
|
||||
}
|
||||
function ImportDeclaration(node) {
|
||||
var _node$assertions3;
|
||||
this.word("import");
|
||||
this.space();
|
||||
const isTypeKind = node.importKind === "type" || node.importKind === "typeof";
|
||||
if (isTypeKind) {
|
||||
this.noIndentInnerCommentsHere();
|
||||
this.word(node.importKind);
|
||||
this.space();
|
||||
} else if (node.module) {
|
||||
this.noIndentInnerCommentsHere();
|
||||
this.word("module");
|
||||
this.space();
|
||||
}
|
||||
const specifiers = node.specifiers.slice(0);
|
||||
const hasSpecifiers = !!specifiers.length;
|
||||
while (hasSpecifiers) {
|
||||
const first = specifiers[0];
|
||||
if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
|
||||
this.print(specifiers.shift(), node);
|
||||
if (specifiers.length) {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (specifiers.length) {
|
||||
this.tokenChar(123);
|
||||
this.space();
|
||||
this.printList(specifiers, node);
|
||||
this.space();
|
||||
this.tokenChar(125);
|
||||
} else if (isTypeKind && !hasSpecifiers) {
|
||||
this.tokenChar(123);
|
||||
this.tokenChar(125);
|
||||
}
|
||||
if (hasSpecifiers || isTypeKind) {
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
}
|
||||
if ((_node$assertions3 = node.assertions) != null && _node$assertions3.length) {
|
||||
this.print(node.source, node, true);
|
||||
this.space();
|
||||
this._printAssertions(node);
|
||||
} else {
|
||||
this.print(node.source, node);
|
||||
}
|
||||
{
|
||||
var _node$attributes;
|
||||
if ((_node$attributes = node.attributes) != null && _node$attributes.length) {
|
||||
this.space();
|
||||
this.word("with");
|
||||
this.space();
|
||||
this.printList(node.attributes, node);
|
||||
}
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function ImportAttribute(node) {
|
||||
this.print(node.key);
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.value);
|
||||
}
|
||||
function ImportNamespaceSpecifier(node) {
|
||||
this.tokenChar(42);
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.local, node);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=modules.js.map
|
1
node_modules/@babel/generator/lib/generators/modules.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/modules.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
280
node_modules/@babel/generator/lib/generators/statements.js
generated
vendored
Normal file
280
node_modules/@babel/generator/lib/generators/statements.js
generated
vendored
Normal file
@ -0,0 +1,280 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.BreakStatement = BreakStatement;
|
||||
exports.CatchClause = CatchClause;
|
||||
exports.ContinueStatement = ContinueStatement;
|
||||
exports.DebuggerStatement = DebuggerStatement;
|
||||
exports.DoWhileStatement = DoWhileStatement;
|
||||
exports.ForOfStatement = exports.ForInStatement = void 0;
|
||||
exports.ForStatement = ForStatement;
|
||||
exports.IfStatement = IfStatement;
|
||||
exports.LabeledStatement = LabeledStatement;
|
||||
exports.ReturnStatement = ReturnStatement;
|
||||
exports.SwitchCase = SwitchCase;
|
||||
exports.SwitchStatement = SwitchStatement;
|
||||
exports.ThrowStatement = ThrowStatement;
|
||||
exports.TryStatement = TryStatement;
|
||||
exports.VariableDeclaration = VariableDeclaration;
|
||||
exports.VariableDeclarator = VariableDeclarator;
|
||||
exports.WhileStatement = WhileStatement;
|
||||
exports.WithStatement = WithStatement;
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
isFor,
|
||||
isForStatement,
|
||||
isIfStatement,
|
||||
isStatement
|
||||
} = _t;
|
||||
function WithStatement(node) {
|
||||
this.word("with");
|
||||
this.space();
|
||||
this.tokenChar(40);
|
||||
this.print(node.object, node);
|
||||
this.tokenChar(41);
|
||||
this.printBlock(node);
|
||||
}
|
||||
function IfStatement(node) {
|
||||
this.word("if");
|
||||
this.space();
|
||||
this.tokenChar(40);
|
||||
this.print(node.test, node);
|
||||
this.tokenChar(41);
|
||||
this.space();
|
||||
const needsBlock = node.alternate && isIfStatement(getLastStatement(node.consequent));
|
||||
if (needsBlock) {
|
||||
this.tokenChar(123);
|
||||
this.newline();
|
||||
this.indent();
|
||||
}
|
||||
this.printAndIndentOnComments(node.consequent, node);
|
||||
if (needsBlock) {
|
||||
this.dedent();
|
||||
this.newline();
|
||||
this.tokenChar(125);
|
||||
}
|
||||
if (node.alternate) {
|
||||
if (this.endsWith(125)) this.space();
|
||||
this.word("else");
|
||||
this.space();
|
||||
this.printAndIndentOnComments(node.alternate, node);
|
||||
}
|
||||
}
|
||||
|
||||
function getLastStatement(statement) {
|
||||
const {
|
||||
body
|
||||
} = statement;
|
||||
if (isStatement(body) === false) {
|
||||
return statement;
|
||||
}
|
||||
return getLastStatement(body);
|
||||
}
|
||||
function ForStatement(node) {
|
||||
this.word("for");
|
||||
this.space();
|
||||
this.tokenChar(40);
|
||||
this.inForStatementInitCounter++;
|
||||
this.print(node.init, node);
|
||||
this.inForStatementInitCounter--;
|
||||
this.tokenChar(59);
|
||||
if (node.test) {
|
||||
this.space();
|
||||
this.print(node.test, node);
|
||||
}
|
||||
this.tokenChar(59);
|
||||
if (node.update) {
|
||||
this.space();
|
||||
this.print(node.update, node);
|
||||
}
|
||||
this.tokenChar(41);
|
||||
this.printBlock(node);
|
||||
}
|
||||
function WhileStatement(node) {
|
||||
this.word("while");
|
||||
this.space();
|
||||
this.tokenChar(40);
|
||||
this.print(node.test, node);
|
||||
this.tokenChar(41);
|
||||
this.printBlock(node);
|
||||
}
|
||||
function ForXStatement(node) {
|
||||
this.word("for");
|
||||
this.space();
|
||||
const isForOf = node.type === "ForOfStatement";
|
||||
if (isForOf && node.await) {
|
||||
this.word("await");
|
||||
this.space();
|
||||
}
|
||||
this.noIndentInnerCommentsHere();
|
||||
this.tokenChar(40);
|
||||
this.print(node.left, node);
|
||||
this.space();
|
||||
this.word(isForOf ? "of" : "in");
|
||||
this.space();
|
||||
this.print(node.right, node);
|
||||
this.tokenChar(41);
|
||||
this.printBlock(node);
|
||||
}
|
||||
const ForInStatement = ForXStatement;
|
||||
exports.ForInStatement = ForInStatement;
|
||||
const ForOfStatement = ForXStatement;
|
||||
exports.ForOfStatement = ForOfStatement;
|
||||
function DoWhileStatement(node) {
|
||||
this.word("do");
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
this.space();
|
||||
this.word("while");
|
||||
this.space();
|
||||
this.tokenChar(40);
|
||||
this.print(node.test, node);
|
||||
this.tokenChar(41);
|
||||
this.semicolon();
|
||||
}
|
||||
function printStatementAfterKeyword(printer, node, parent, isLabel) {
|
||||
if (node) {
|
||||
printer.space();
|
||||
printer.printTerminatorless(node, parent, isLabel);
|
||||
}
|
||||
printer.semicolon();
|
||||
}
|
||||
function BreakStatement(node) {
|
||||
this.word("break");
|
||||
printStatementAfterKeyword(this, node.label, node, true);
|
||||
}
|
||||
function ContinueStatement(node) {
|
||||
this.word("continue");
|
||||
printStatementAfterKeyword(this, node.label, node, true);
|
||||
}
|
||||
function ReturnStatement(node) {
|
||||
this.word("return");
|
||||
printStatementAfterKeyword(this, node.argument, node, false);
|
||||
}
|
||||
function ThrowStatement(node) {
|
||||
this.word("throw");
|
||||
printStatementAfterKeyword(this, node.argument, node, false);
|
||||
}
|
||||
function LabeledStatement(node) {
|
||||
this.print(node.label, node);
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function TryStatement(node) {
|
||||
this.word("try");
|
||||
this.space();
|
||||
this.print(node.block, node);
|
||||
this.space();
|
||||
|
||||
if (node.handlers) {
|
||||
this.print(node.handlers[0], node);
|
||||
} else {
|
||||
this.print(node.handler, node);
|
||||
}
|
||||
if (node.finalizer) {
|
||||
this.space();
|
||||
this.word("finally");
|
||||
this.space();
|
||||
this.print(node.finalizer, node);
|
||||
}
|
||||
}
|
||||
function CatchClause(node) {
|
||||
this.word("catch");
|
||||
this.space();
|
||||
if (node.param) {
|
||||
this.tokenChar(40);
|
||||
this.print(node.param, node);
|
||||
this.print(node.param.typeAnnotation, node);
|
||||
this.tokenChar(41);
|
||||
this.space();
|
||||
}
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function SwitchStatement(node) {
|
||||
this.word("switch");
|
||||
this.space();
|
||||
this.tokenChar(40);
|
||||
this.print(node.discriminant, node);
|
||||
this.tokenChar(41);
|
||||
this.space();
|
||||
this.tokenChar(123);
|
||||
this.printSequence(node.cases, node, {
|
||||
indent: true,
|
||||
addNewlines(leading, cas) {
|
||||
if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
|
||||
}
|
||||
});
|
||||
this.tokenChar(125);
|
||||
}
|
||||
function SwitchCase(node) {
|
||||
if (node.test) {
|
||||
this.word("case");
|
||||
this.space();
|
||||
this.print(node.test, node);
|
||||
this.tokenChar(58);
|
||||
} else {
|
||||
this.word("default");
|
||||
this.tokenChar(58);
|
||||
}
|
||||
if (node.consequent.length) {
|
||||
this.newline();
|
||||
this.printSequence(node.consequent, node, {
|
||||
indent: true
|
||||
});
|
||||
}
|
||||
}
|
||||
function DebuggerStatement() {
|
||||
this.word("debugger");
|
||||
this.semicolon();
|
||||
}
|
||||
function VariableDeclaration(node, parent) {
|
||||
if (node.declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
const {
|
||||
kind
|
||||
} = node;
|
||||
this.word(kind, kind === "using");
|
||||
this.space();
|
||||
let hasInits = false;
|
||||
if (!isFor(parent)) {
|
||||
for (const declar of node.declarations) {
|
||||
if (declar.init) {
|
||||
hasInits = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.printList(node.declarations, node, {
|
||||
separator: hasInits ? function () {
|
||||
this.tokenChar(44);
|
||||
this.newline();
|
||||
} : undefined,
|
||||
indent: node.declarations.length > 1 ? true : false
|
||||
});
|
||||
if (isFor(parent)) {
|
||||
if (isForStatement(parent)) {
|
||||
if (parent.init === node) return;
|
||||
} else {
|
||||
if (parent.left === node) return;
|
||||
}
|
||||
}
|
||||
this.semicolon();
|
||||
}
|
||||
function VariableDeclarator(node) {
|
||||
this.print(node.id, node);
|
||||
if (node.definite) this.tokenChar(33);
|
||||
this.print(node.id.typeAnnotation, node);
|
||||
if (node.init) {
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.init, node);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=statements.js.map
|
1
node_modules/@babel/generator/lib/generators/statements.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/statements.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
30
node_modules/@babel/generator/lib/generators/template-literals.js
generated
vendored
Normal file
30
node_modules/@babel/generator/lib/generators/template-literals.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TaggedTemplateExpression = TaggedTemplateExpression;
|
||||
exports.TemplateElement = TemplateElement;
|
||||
exports.TemplateLiteral = TemplateLiteral;
|
||||
function TaggedTemplateExpression(node) {
|
||||
this.print(node.tag, node);
|
||||
this.print(node.typeParameters, node);
|
||||
this.print(node.quasi, node);
|
||||
}
|
||||
function TemplateElement(node, parent) {
|
||||
const isFirst = parent.quasis[0] === node;
|
||||
const isLast = parent.quasis[parent.quasis.length - 1] === node;
|
||||
const value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
|
||||
this.token(value, true);
|
||||
}
|
||||
function TemplateLiteral(node) {
|
||||
const quasis = node.quasis;
|
||||
for (let i = 0; i < quasis.length; i++) {
|
||||
this.print(quasis[i], node);
|
||||
if (i + 1 < quasis.length) {
|
||||
this.print(node.expressions[i], node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=template-literals.js.map
|
1
node_modules/@babel/generator/lib/generators/template-literals.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/template-literals.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["TaggedTemplateExpression","node","print","tag","typeParameters","quasi","TemplateElement","parent","isFirst","quasis","isLast","length","value","raw","token","TemplateLiteral","i","expressions"],"sources":["../../src/generators/template-literals.ts"],"sourcesContent":["import type Printer from \"../printer\";\nimport type * as t from \"@babel/types\";\n\nexport function TaggedTemplateExpression(\n this: Printer,\n node: t.TaggedTemplateExpression,\n) {\n this.print(node.tag, node);\n this.print(node.typeParameters, node); // TS\n this.print(node.quasi, node);\n}\n\nexport function TemplateElement(\n this: Printer,\n node: t.TemplateElement,\n parent: t.TemplateLiteral,\n) {\n const isFirst = parent.quasis[0] === node;\n const isLast = parent.quasis[parent.quasis.length - 1] === node;\n\n const value = (isFirst ? \"`\" : \"}\") + node.value.raw + (isLast ? \"`\" : \"${\");\n\n this.token(value, true);\n}\n\nexport function TemplateLiteral(this: Printer, node: t.TemplateLiteral) {\n const quasis = node.quasis;\n\n for (let i = 0; i < quasis.length; i++) {\n this.print(quasis[i], node);\n\n if (i + 1 < quasis.length) {\n this.print(node.expressions[i], node);\n }\n }\n}\n"],"mappings":";;;;;;;;AAGO,SAASA,wBAAwB,CAEtCC,IAAgC,EAChC;EACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,GAAG,EAAEF,IAAI,CAAC;EAC1B,IAAI,CAACC,KAAK,CAACD,IAAI,CAACG,cAAc,EAAEH,IAAI,CAAC;EACrC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACI,KAAK,EAAEJ,IAAI,CAAC;AAC9B;AAEO,SAASK,eAAe,CAE7BL,IAAuB,EACvBM,MAAyB,EACzB;EACA,MAAMC,OAAO,GAAGD,MAAM,CAACE,MAAM,CAAC,CAAC,CAAC,KAAKR,IAAI;EACzC,MAAMS,MAAM,GAAGH,MAAM,CAACE,MAAM,CAACF,MAAM,CAACE,MAAM,CAACE,MAAM,GAAG,CAAC,CAAC,KAAKV,IAAI;EAE/D,MAAMW,KAAK,GAAG,CAACJ,OAAO,GAAG,GAAG,GAAG,GAAG,IAAIP,IAAI,CAACW,KAAK,CAACC,GAAG,IAAIH,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC;EAE5E,IAAI,CAACI,KAAK,CAACF,KAAK,EAAE,IAAI,CAAC;AACzB;AAEO,SAASG,eAAe,CAAgBd,IAAuB,EAAE;EACtE,MAAMQ,MAAM,GAAGR,IAAI,CAACQ,MAAM;EAE1B,KAAK,IAAIO,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGP,MAAM,CAACE,MAAM,EAAEK,CAAC,EAAE,EAAE;IACtC,IAAI,CAACd,KAAK,CAACO,MAAM,CAACO,CAAC,CAAC,EAAEf,IAAI,CAAC;IAE3B,IAAIe,CAAC,GAAG,CAAC,GAAGP,MAAM,CAACE,MAAM,EAAE;MACzB,IAAI,CAACT,KAAK,CAACD,IAAI,CAACgB,WAAW,CAACD,CAAC,CAAC,EAAEf,IAAI,CAAC;IACvC;EACF;AACF"}
|
224
node_modules/@babel/generator/lib/generators/types.js
generated
vendored
Normal file
224
node_modules/@babel/generator/lib/generators/types.js
generated
vendored
Normal file
@ -0,0 +1,224 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ArgumentPlaceholder = ArgumentPlaceholder;
|
||||
exports.ArrayPattern = exports.ArrayExpression = ArrayExpression;
|
||||
exports.BigIntLiteral = BigIntLiteral;
|
||||
exports.BooleanLiteral = BooleanLiteral;
|
||||
exports.DecimalLiteral = DecimalLiteral;
|
||||
exports.Identifier = Identifier;
|
||||
exports.NullLiteral = NullLiteral;
|
||||
exports.NumericLiteral = NumericLiteral;
|
||||
exports.ObjectPattern = exports.ObjectExpression = ObjectExpression;
|
||||
exports.ObjectMethod = ObjectMethod;
|
||||
exports.ObjectProperty = ObjectProperty;
|
||||
exports.PipelineBareFunction = PipelineBareFunction;
|
||||
exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
|
||||
exports.PipelineTopicExpression = PipelineTopicExpression;
|
||||
exports.RecordExpression = RecordExpression;
|
||||
exports.RegExpLiteral = RegExpLiteral;
|
||||
exports.SpreadElement = exports.RestElement = RestElement;
|
||||
exports.StringLiteral = StringLiteral;
|
||||
exports.TopicReference = TopicReference;
|
||||
exports.TupleExpression = TupleExpression;
|
||||
var _t = require("@babel/types");
|
||||
var _jsesc = require("jsesc");
|
||||
const {
|
||||
isAssignmentPattern,
|
||||
isIdentifier
|
||||
} = _t;
|
||||
function Identifier(node) {
|
||||
this.word(node.name);
|
||||
}
|
||||
function ArgumentPlaceholder() {
|
||||
this.tokenChar(63);
|
||||
}
|
||||
function RestElement(node) {
|
||||
this.token("...");
|
||||
this.print(node.argument, node);
|
||||
}
|
||||
function ObjectExpression(node) {
|
||||
const props = node.properties;
|
||||
this.tokenChar(123);
|
||||
if (props.length) {
|
||||
this.space();
|
||||
this.printList(props, node, {
|
||||
indent: true,
|
||||
statement: true
|
||||
});
|
||||
this.space();
|
||||
}
|
||||
this.sourceWithOffset("end", node.loc, 0, -1);
|
||||
this.tokenChar(125);
|
||||
}
|
||||
function ObjectMethod(node) {
|
||||
this.printJoin(node.decorators, node);
|
||||
this._methodHead(node);
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
function ObjectProperty(node) {
|
||||
this.printJoin(node.decorators, node);
|
||||
if (node.computed) {
|
||||
this.tokenChar(91);
|
||||
this.print(node.key, node);
|
||||
this.tokenChar(93);
|
||||
} else {
|
||||
if (isAssignmentPattern(node.value) && isIdentifier(node.key) &&
|
||||
node.key.name === node.value.left.name) {
|
||||
this.print(node.value, node);
|
||||
return;
|
||||
}
|
||||
this.print(node.key, node);
|
||||
|
||||
if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.value, node);
|
||||
}
|
||||
function ArrayExpression(node) {
|
||||
const elems = node.elements;
|
||||
const len = elems.length;
|
||||
this.tokenChar(91);
|
||||
for (let i = 0; i < elems.length; i++) {
|
||||
const elem = elems[i];
|
||||
if (elem) {
|
||||
if (i > 0) this.space();
|
||||
this.print(elem, node);
|
||||
if (i < len - 1) this.tokenChar(44);
|
||||
} else {
|
||||
this.tokenChar(44);
|
||||
}
|
||||
}
|
||||
this.tokenChar(93);
|
||||
}
|
||||
function RecordExpression(node) {
|
||||
const props = node.properties;
|
||||
let startToken;
|
||||
let endToken;
|
||||
if (this.format.recordAndTupleSyntaxType === "bar") {
|
||||
startToken = "{|";
|
||||
endToken = "|}";
|
||||
} else if (this.format.recordAndTupleSyntaxType !== "hash" && this.format.recordAndTupleSyntaxType != null) {
|
||||
throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
|
||||
} else {
|
||||
startToken = "#{";
|
||||
endToken = "}";
|
||||
}
|
||||
this.token(startToken);
|
||||
if (props.length) {
|
||||
this.space();
|
||||
this.printList(props, node, {
|
||||
indent: true,
|
||||
statement: true
|
||||
});
|
||||
this.space();
|
||||
}
|
||||
this.token(endToken);
|
||||
}
|
||||
function TupleExpression(node) {
|
||||
const elems = node.elements;
|
||||
const len = elems.length;
|
||||
let startToken;
|
||||
let endToken;
|
||||
if (this.format.recordAndTupleSyntaxType === "bar") {
|
||||
startToken = "[|";
|
||||
endToken = "|]";
|
||||
} else if (this.format.recordAndTupleSyntaxType === "hash") {
|
||||
startToken = "#[";
|
||||
endToken = "]";
|
||||
} else {
|
||||
throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
|
||||
}
|
||||
this.token(startToken);
|
||||
for (let i = 0; i < elems.length; i++) {
|
||||
const elem = elems[i];
|
||||
if (elem) {
|
||||
if (i > 0) this.space();
|
||||
this.print(elem, node);
|
||||
if (i < len - 1) this.tokenChar(44);
|
||||
}
|
||||
}
|
||||
this.token(endToken);
|
||||
}
|
||||
function RegExpLiteral(node) {
|
||||
this.word(`/${node.pattern}/${node.flags}`);
|
||||
}
|
||||
function BooleanLiteral(node) {
|
||||
this.word(node.value ? "true" : "false");
|
||||
}
|
||||
function NullLiteral() {
|
||||
this.word("null");
|
||||
}
|
||||
function NumericLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
const opts = this.format.jsescOption;
|
||||
const value = node.value + "";
|
||||
if (opts.numbers) {
|
||||
this.number(_jsesc(node.value, opts));
|
||||
} else if (raw == null) {
|
||||
this.number(value);
|
||||
} else if (this.format.minified) {
|
||||
this.number(raw.length < value.length ? raw : value);
|
||||
} else {
|
||||
this.number(raw);
|
||||
}
|
||||
}
|
||||
function StringLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
if (!this.format.minified && raw !== undefined) {
|
||||
this.token(raw);
|
||||
return;
|
||||
}
|
||||
const val = _jsesc(node.value, Object.assign(this.format.jsescOption, this.format.jsonCompatibleStrings && {
|
||||
json: true
|
||||
}));
|
||||
return this.token(val);
|
||||
}
|
||||
function BigIntLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
if (!this.format.minified && raw !== undefined) {
|
||||
this.word(raw);
|
||||
return;
|
||||
}
|
||||
this.word(node.value + "n");
|
||||
}
|
||||
function DecimalLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
if (!this.format.minified && raw !== undefined) {
|
||||
this.word(raw);
|
||||
return;
|
||||
}
|
||||
this.word(node.value + "m");
|
||||
}
|
||||
|
||||
const validTopicTokenSet = new Set(["^^", "@@", "^", "%", "#"]);
|
||||
function TopicReference() {
|
||||
const {
|
||||
topicToken
|
||||
} = this.format;
|
||||
if (validTopicTokenSet.has(topicToken)) {
|
||||
this.token(topicToken);
|
||||
} else {
|
||||
const givenTopicTokenJSON = JSON.stringify(topicToken);
|
||||
const validTopics = Array.from(validTopicTokenSet, v => JSON.stringify(v));
|
||||
throw new Error(`The "topicToken" generator option must be one of ` + `${validTopics.join(", ")} (${givenTopicTokenJSON} received instead).`);
|
||||
}
|
||||
}
|
||||
|
||||
function PipelineTopicExpression(node) {
|
||||
this.print(node.expression, node);
|
||||
}
|
||||
function PipelineBareFunction(node) {
|
||||
this.print(node.callee, node);
|
||||
}
|
||||
function PipelinePrimaryTopicReference() {
|
||||
this.tokenChar(35);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=types.js.map
|
1
node_modules/@babel/generator/lib/generators/types.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/types.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
697
node_modules/@babel/generator/lib/generators/typescript.js
generated
vendored
Normal file
697
node_modules/@babel/generator/lib/generators/typescript.js
generated
vendored
Normal file
@ -0,0 +1,697 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TSAnyKeyword = TSAnyKeyword;
|
||||
exports.TSArrayType = TSArrayType;
|
||||
exports.TSSatisfiesExpression = exports.TSAsExpression = TSTypeExpression;
|
||||
exports.TSBigIntKeyword = TSBigIntKeyword;
|
||||
exports.TSBooleanKeyword = TSBooleanKeyword;
|
||||
exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration;
|
||||
exports.TSConditionalType = TSConditionalType;
|
||||
exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;
|
||||
exports.TSConstructorType = TSConstructorType;
|
||||
exports.TSDeclareFunction = TSDeclareFunction;
|
||||
exports.TSDeclareMethod = TSDeclareMethod;
|
||||
exports.TSEnumDeclaration = TSEnumDeclaration;
|
||||
exports.TSEnumMember = TSEnumMember;
|
||||
exports.TSExportAssignment = TSExportAssignment;
|
||||
exports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;
|
||||
exports.TSExternalModuleReference = TSExternalModuleReference;
|
||||
exports.TSFunctionType = TSFunctionType;
|
||||
exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
|
||||
exports.TSImportType = TSImportType;
|
||||
exports.TSIndexSignature = TSIndexSignature;
|
||||
exports.TSIndexedAccessType = TSIndexedAccessType;
|
||||
exports.TSInferType = TSInferType;
|
||||
exports.TSInstantiationExpression = TSInstantiationExpression;
|
||||
exports.TSInterfaceBody = TSInterfaceBody;
|
||||
exports.TSInterfaceDeclaration = TSInterfaceDeclaration;
|
||||
exports.TSIntersectionType = TSIntersectionType;
|
||||
exports.TSIntrinsicKeyword = TSIntrinsicKeyword;
|
||||
exports.TSLiteralType = TSLiteralType;
|
||||
exports.TSMappedType = TSMappedType;
|
||||
exports.TSMethodSignature = TSMethodSignature;
|
||||
exports.TSModuleBlock = TSModuleBlock;
|
||||
exports.TSModuleDeclaration = TSModuleDeclaration;
|
||||
exports.TSNamedTupleMember = TSNamedTupleMember;
|
||||
exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
|
||||
exports.TSNeverKeyword = TSNeverKeyword;
|
||||
exports.TSNonNullExpression = TSNonNullExpression;
|
||||
exports.TSNullKeyword = TSNullKeyword;
|
||||
exports.TSNumberKeyword = TSNumberKeyword;
|
||||
exports.TSObjectKeyword = TSObjectKeyword;
|
||||
exports.TSOptionalType = TSOptionalType;
|
||||
exports.TSParameterProperty = TSParameterProperty;
|
||||
exports.TSParenthesizedType = TSParenthesizedType;
|
||||
exports.TSPropertySignature = TSPropertySignature;
|
||||
exports.TSQualifiedName = TSQualifiedName;
|
||||
exports.TSRestType = TSRestType;
|
||||
exports.TSStringKeyword = TSStringKeyword;
|
||||
exports.TSSymbolKeyword = TSSymbolKeyword;
|
||||
exports.TSThisType = TSThisType;
|
||||
exports.TSTupleType = TSTupleType;
|
||||
exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
|
||||
exports.TSTypeAnnotation = TSTypeAnnotation;
|
||||
exports.TSTypeAssertion = TSTypeAssertion;
|
||||
exports.TSTypeLiteral = TSTypeLiteral;
|
||||
exports.TSTypeOperator = TSTypeOperator;
|
||||
exports.TSTypeParameter = TSTypeParameter;
|
||||
exports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
|
||||
exports.TSTypePredicate = TSTypePredicate;
|
||||
exports.TSTypeQuery = TSTypeQuery;
|
||||
exports.TSTypeReference = TSTypeReference;
|
||||
exports.TSUndefinedKeyword = TSUndefinedKeyword;
|
||||
exports.TSUnionType = TSUnionType;
|
||||
exports.TSUnknownKeyword = TSUnknownKeyword;
|
||||
exports.TSVoidKeyword = TSVoidKeyword;
|
||||
exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers;
|
||||
exports.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType;
|
||||
exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
|
||||
exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase;
|
||||
exports.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody;
|
||||
function TSTypeAnnotation(node) {
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
if (node.optional) this.tokenChar(63);
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
function TSTypeParameterInstantiation(node, parent) {
|
||||
this.tokenChar(60);
|
||||
this.printList(node.params, node, {});
|
||||
if (parent.type === "ArrowFunctionExpression" && node.params.length === 1) {
|
||||
this.tokenChar(44);
|
||||
}
|
||||
this.tokenChar(62);
|
||||
}
|
||||
function TSTypeParameter(node) {
|
||||
if (node.in) {
|
||||
this.word("in");
|
||||
this.space();
|
||||
}
|
||||
if (node.out) {
|
||||
this.word("out");
|
||||
this.space();
|
||||
}
|
||||
this.word(node.name);
|
||||
if (node.constraint) {
|
||||
this.space();
|
||||
this.word("extends");
|
||||
this.space();
|
||||
this.print(node.constraint, node);
|
||||
}
|
||||
if (node.default) {
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.default, node);
|
||||
}
|
||||
}
|
||||
function TSParameterProperty(node) {
|
||||
if (node.accessibility) {
|
||||
this.word(node.accessibility);
|
||||
this.space();
|
||||
}
|
||||
if (node.readonly) {
|
||||
this.word("readonly");
|
||||
this.space();
|
||||
}
|
||||
this._param(node.parameter);
|
||||
}
|
||||
function TSDeclareFunction(node) {
|
||||
if (node.declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
this._functionHead(node);
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function TSDeclareMethod(node) {
|
||||
this._classMethodHead(node);
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function TSQualifiedName(node) {
|
||||
this.print(node.left, node);
|
||||
this.tokenChar(46);
|
||||
this.print(node.right, node);
|
||||
}
|
||||
function TSCallSignatureDeclaration(node) {
|
||||
this.tsPrintSignatureDeclarationBase(node);
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function TSConstructSignatureDeclaration(node) {
|
||||
this.word("new");
|
||||
this.space();
|
||||
this.tsPrintSignatureDeclarationBase(node);
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function TSPropertySignature(node) {
|
||||
const {
|
||||
readonly,
|
||||
initializer
|
||||
} = node;
|
||||
if (readonly) {
|
||||
this.word("readonly");
|
||||
this.space();
|
||||
}
|
||||
this.tsPrintPropertyOrMethodName(node);
|
||||
this.print(node.typeAnnotation, node);
|
||||
if (initializer) {
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(initializer, node);
|
||||
}
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function tsPrintPropertyOrMethodName(node) {
|
||||
if (node.computed) {
|
||||
this.tokenChar(91);
|
||||
}
|
||||
this.print(node.key, node);
|
||||
if (node.computed) {
|
||||
this.tokenChar(93);
|
||||
}
|
||||
if (node.optional) {
|
||||
this.tokenChar(63);
|
||||
}
|
||||
}
|
||||
function TSMethodSignature(node) {
|
||||
const {
|
||||
kind
|
||||
} = node;
|
||||
if (kind === "set" || kind === "get") {
|
||||
this.word(kind);
|
||||
this.space();
|
||||
}
|
||||
this.tsPrintPropertyOrMethodName(node);
|
||||
this.tsPrintSignatureDeclarationBase(node);
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function TSIndexSignature(node) {
|
||||
const {
|
||||
readonly,
|
||||
static: isStatic
|
||||
} = node;
|
||||
if (isStatic) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
}
|
||||
if (readonly) {
|
||||
this.word("readonly");
|
||||
this.space();
|
||||
}
|
||||
this.tokenChar(91);
|
||||
this._parameters(node.parameters, node);
|
||||
this.tokenChar(93);
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function TSAnyKeyword() {
|
||||
this.word("any");
|
||||
}
|
||||
function TSBigIntKeyword() {
|
||||
this.word("bigint");
|
||||
}
|
||||
function TSUnknownKeyword() {
|
||||
this.word("unknown");
|
||||
}
|
||||
function TSNumberKeyword() {
|
||||
this.word("number");
|
||||
}
|
||||
function TSObjectKeyword() {
|
||||
this.word("object");
|
||||
}
|
||||
function TSBooleanKeyword() {
|
||||
this.word("boolean");
|
||||
}
|
||||
function TSStringKeyword() {
|
||||
this.word("string");
|
||||
}
|
||||
function TSSymbolKeyword() {
|
||||
this.word("symbol");
|
||||
}
|
||||
function TSVoidKeyword() {
|
||||
this.word("void");
|
||||
}
|
||||
function TSUndefinedKeyword() {
|
||||
this.word("undefined");
|
||||
}
|
||||
function TSNullKeyword() {
|
||||
this.word("null");
|
||||
}
|
||||
function TSNeverKeyword() {
|
||||
this.word("never");
|
||||
}
|
||||
function TSIntrinsicKeyword() {
|
||||
this.word("intrinsic");
|
||||
}
|
||||
function TSThisType() {
|
||||
this.word("this");
|
||||
}
|
||||
function TSFunctionType(node) {
|
||||
this.tsPrintFunctionOrConstructorType(node);
|
||||
}
|
||||
function TSConstructorType(node) {
|
||||
if (node.abstract) {
|
||||
this.word("abstract");
|
||||
this.space();
|
||||
}
|
||||
this.word("new");
|
||||
this.space();
|
||||
this.tsPrintFunctionOrConstructorType(node);
|
||||
}
|
||||
function tsPrintFunctionOrConstructorType(node) {
|
||||
const {
|
||||
typeParameters
|
||||
} = node;
|
||||
const parameters =
|
||||
node.parameters;
|
||||
this.print(typeParameters, node);
|
||||
this.tokenChar(40);
|
||||
this._parameters(parameters, node);
|
||||
this.tokenChar(41);
|
||||
this.space();
|
||||
this.token("=>");
|
||||
this.space();
|
||||
const returnType =
|
||||
node.typeAnnotation;
|
||||
this.print(returnType.typeAnnotation, node);
|
||||
}
|
||||
function TSTypeReference(node) {
|
||||
this.print(node.typeName, node, true);
|
||||
this.print(node.typeParameters, node, true);
|
||||
}
|
||||
function TSTypePredicate(node) {
|
||||
if (node.asserts) {
|
||||
this.word("asserts");
|
||||
this.space();
|
||||
}
|
||||
this.print(node.parameterName);
|
||||
if (node.typeAnnotation) {
|
||||
this.space();
|
||||
this.word("is");
|
||||
this.space();
|
||||
this.print(node.typeAnnotation.typeAnnotation);
|
||||
}
|
||||
}
|
||||
function TSTypeQuery(node) {
|
||||
this.word("typeof");
|
||||
this.space();
|
||||
this.print(node.exprName);
|
||||
if (node.typeParameters) {
|
||||
this.print(node.typeParameters, node);
|
||||
}
|
||||
}
|
||||
function TSTypeLiteral(node) {
|
||||
this.tsPrintTypeLiteralOrInterfaceBody(node.members, node);
|
||||
}
|
||||
function tsPrintTypeLiteralOrInterfaceBody(members, node) {
|
||||
tsPrintBraced(this, members, node);
|
||||
}
|
||||
function tsPrintBraced(printer, members, node) {
|
||||
printer.token("{");
|
||||
if (members.length) {
|
||||
printer.indent();
|
||||
printer.newline();
|
||||
for (const member of members) {
|
||||
printer.print(member, node);
|
||||
printer.newline();
|
||||
}
|
||||
printer.dedent();
|
||||
}
|
||||
printer.sourceWithOffset("end", node.loc, 0, -1);
|
||||
printer.rightBrace();
|
||||
}
|
||||
function TSArrayType(node) {
|
||||
this.print(node.elementType, node, true);
|
||||
this.token("[]");
|
||||
}
|
||||
function TSTupleType(node) {
|
||||
this.tokenChar(91);
|
||||
this.printList(node.elementTypes, node);
|
||||
this.tokenChar(93);
|
||||
}
|
||||
function TSOptionalType(node) {
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.tokenChar(63);
|
||||
}
|
||||
function TSRestType(node) {
|
||||
this.token("...");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
function TSNamedTupleMember(node) {
|
||||
this.print(node.label, node);
|
||||
if (node.optional) this.tokenChar(63);
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.elementType, node);
|
||||
}
|
||||
function TSUnionType(node) {
|
||||
tsPrintUnionOrIntersectionType(this, node, "|");
|
||||
}
|
||||
function TSIntersectionType(node) {
|
||||
tsPrintUnionOrIntersectionType(this, node, "&");
|
||||
}
|
||||
function tsPrintUnionOrIntersectionType(printer, node, sep) {
|
||||
printer.printJoin(node.types, node, {
|
||||
separator() {
|
||||
this.space();
|
||||
this.token(sep);
|
||||
this.space();
|
||||
}
|
||||
});
|
||||
}
|
||||
function TSConditionalType(node) {
|
||||
this.print(node.checkType);
|
||||
this.space();
|
||||
this.word("extends");
|
||||
this.space();
|
||||
this.print(node.extendsType);
|
||||
this.space();
|
||||
this.tokenChar(63);
|
||||
this.space();
|
||||
this.print(node.trueType);
|
||||
this.space();
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.falseType);
|
||||
}
|
||||
function TSInferType(node) {
|
||||
this.token("infer");
|
||||
this.space();
|
||||
this.print(node.typeParameter);
|
||||
}
|
||||
function TSParenthesizedType(node) {
|
||||
this.tokenChar(40);
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.tokenChar(41);
|
||||
}
|
||||
function TSTypeOperator(node) {
|
||||
this.word(node.operator);
|
||||
this.space();
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
function TSIndexedAccessType(node) {
|
||||
this.print(node.objectType, node, true);
|
||||
this.tokenChar(91);
|
||||
this.print(node.indexType, node);
|
||||
this.tokenChar(93);
|
||||
}
|
||||
function TSMappedType(node) {
|
||||
const {
|
||||
nameType,
|
||||
optional,
|
||||
readonly,
|
||||
typeParameter
|
||||
} = node;
|
||||
this.tokenChar(123);
|
||||
this.space();
|
||||
if (readonly) {
|
||||
tokenIfPlusMinus(this, readonly);
|
||||
this.word("readonly");
|
||||
this.space();
|
||||
}
|
||||
this.tokenChar(91);
|
||||
this.word(typeParameter.name);
|
||||
this.space();
|
||||
this.word("in");
|
||||
this.space();
|
||||
this.print(typeParameter.constraint, typeParameter);
|
||||
if (nameType) {
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(nameType, node);
|
||||
}
|
||||
this.tokenChar(93);
|
||||
if (optional) {
|
||||
tokenIfPlusMinus(this, optional);
|
||||
this.tokenChar(63);
|
||||
}
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.space();
|
||||
this.tokenChar(125);
|
||||
}
|
||||
function tokenIfPlusMinus(self, tok) {
|
||||
if (tok !== true) {
|
||||
self.token(tok);
|
||||
}
|
||||
}
|
||||
function TSLiteralType(node) {
|
||||
this.print(node.literal, node);
|
||||
}
|
||||
function TSExpressionWithTypeArguments(node) {
|
||||
this.print(node.expression, node);
|
||||
this.print(node.typeParameters, node);
|
||||
}
|
||||
function TSInterfaceDeclaration(node) {
|
||||
const {
|
||||
declare,
|
||||
id,
|
||||
typeParameters,
|
||||
extends: extendz,
|
||||
body
|
||||
} = node;
|
||||
if (declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
this.word("interface");
|
||||
this.space();
|
||||
this.print(id, node);
|
||||
this.print(typeParameters, node);
|
||||
if (extendz != null && extendz.length) {
|
||||
this.space();
|
||||
this.word("extends");
|
||||
this.space();
|
||||
this.printList(extendz, node);
|
||||
}
|
||||
this.space();
|
||||
this.print(body, node);
|
||||
}
|
||||
function TSInterfaceBody(node) {
|
||||
this.tsPrintTypeLiteralOrInterfaceBody(node.body, node);
|
||||
}
|
||||
function TSTypeAliasDeclaration(node) {
|
||||
const {
|
||||
declare,
|
||||
id,
|
||||
typeParameters,
|
||||
typeAnnotation
|
||||
} = node;
|
||||
if (declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
this.word("type");
|
||||
this.space();
|
||||
this.print(id, node);
|
||||
this.print(typeParameters, node);
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(typeAnnotation, node);
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function TSTypeExpression(node) {
|
||||
var _expression$trailingC;
|
||||
const {
|
||||
type,
|
||||
expression,
|
||||
typeAnnotation
|
||||
} = node;
|
||||
const forceParens = !!((_expression$trailingC = expression.trailingComments) != null && _expression$trailingC.length);
|
||||
this.print(expression, node, true, undefined, forceParens);
|
||||
this.space();
|
||||
this.word(type === "TSAsExpression" ? "as" : "satisfies");
|
||||
this.space();
|
||||
this.print(typeAnnotation, node);
|
||||
}
|
||||
function TSTypeAssertion(node) {
|
||||
const {
|
||||
typeAnnotation,
|
||||
expression
|
||||
} = node;
|
||||
this.tokenChar(60);
|
||||
this.print(typeAnnotation, node);
|
||||
this.tokenChar(62);
|
||||
this.space();
|
||||
this.print(expression, node);
|
||||
}
|
||||
function TSInstantiationExpression(node) {
|
||||
this.print(node.expression, node);
|
||||
this.print(node.typeParameters, node);
|
||||
}
|
||||
function TSEnumDeclaration(node) {
|
||||
const {
|
||||
declare,
|
||||
const: isConst,
|
||||
id,
|
||||
members
|
||||
} = node;
|
||||
if (declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
if (isConst) {
|
||||
this.word("const");
|
||||
this.space();
|
||||
}
|
||||
this.word("enum");
|
||||
this.space();
|
||||
this.print(id, node);
|
||||
this.space();
|
||||
tsPrintBraced(this, members, node);
|
||||
}
|
||||
function TSEnumMember(node) {
|
||||
const {
|
||||
id,
|
||||
initializer
|
||||
} = node;
|
||||
this.print(id, node);
|
||||
if (initializer) {
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(initializer, node);
|
||||
}
|
||||
this.tokenChar(44);
|
||||
}
|
||||
function TSModuleDeclaration(node) {
|
||||
const {
|
||||
declare,
|
||||
id
|
||||
} = node;
|
||||
if (declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
if (!node.global) {
|
||||
this.word(id.type === "Identifier" ? "namespace" : "module");
|
||||
this.space();
|
||||
}
|
||||
this.print(id, node);
|
||||
if (!node.body) {
|
||||
this.tokenChar(59);
|
||||
return;
|
||||
}
|
||||
let body = node.body;
|
||||
while (body.type === "TSModuleDeclaration") {
|
||||
this.tokenChar(46);
|
||||
this.print(body.id, body);
|
||||
body = body.body;
|
||||
}
|
||||
this.space();
|
||||
this.print(body, node);
|
||||
}
|
||||
function TSModuleBlock(node) {
|
||||
tsPrintBraced(this, node.body, node);
|
||||
}
|
||||
function TSImportType(node) {
|
||||
const {
|
||||
argument,
|
||||
qualifier,
|
||||
typeParameters
|
||||
} = node;
|
||||
this.word("import");
|
||||
this.tokenChar(40);
|
||||
this.print(argument, node);
|
||||
this.tokenChar(41);
|
||||
if (qualifier) {
|
||||
this.tokenChar(46);
|
||||
this.print(qualifier, node);
|
||||
}
|
||||
if (typeParameters) {
|
||||
this.print(typeParameters, node);
|
||||
}
|
||||
}
|
||||
function TSImportEqualsDeclaration(node) {
|
||||
const {
|
||||
isExport,
|
||||
id,
|
||||
moduleReference
|
||||
} = node;
|
||||
if (isExport) {
|
||||
this.word("export");
|
||||
this.space();
|
||||
}
|
||||
this.word("import");
|
||||
this.space();
|
||||
this.print(id, node);
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(moduleReference, node);
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function TSExternalModuleReference(node) {
|
||||
this.token("require(");
|
||||
this.print(node.expression, node);
|
||||
this.tokenChar(41);
|
||||
}
|
||||
function TSNonNullExpression(node) {
|
||||
this.print(node.expression, node);
|
||||
this.tokenChar(33);
|
||||
}
|
||||
function TSExportAssignment(node) {
|
||||
this.word("export");
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.expression, node);
|
||||
this.tokenChar(59);
|
||||
}
|
||||
function TSNamespaceExportDeclaration(node) {
|
||||
this.word("export");
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.word("namespace");
|
||||
this.space();
|
||||
this.print(node.id, node);
|
||||
}
|
||||
function tsPrintSignatureDeclarationBase(node) {
|
||||
const {
|
||||
typeParameters
|
||||
} = node;
|
||||
const parameters = node.parameters;
|
||||
this.print(typeParameters, node);
|
||||
this.tokenChar(40);
|
||||
this._parameters(parameters, node);
|
||||
this.tokenChar(41);
|
||||
const returnType = node.typeAnnotation;
|
||||
this.print(returnType, node);
|
||||
}
|
||||
function tsPrintClassMemberModifiers(node) {
|
||||
const isField = node.type === "ClassAccessorProperty" || node.type === "ClassProperty";
|
||||
if (isField && node.declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
if (node.accessibility) {
|
||||
this.word(node.accessibility);
|
||||
this.space();
|
||||
}
|
||||
if (node.static) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
}
|
||||
if (node.override) {
|
||||
this.word("override");
|
||||
this.space();
|
||||
}
|
||||
if (node.abstract) {
|
||||
this.word("abstract");
|
||||
this.space();
|
||||
}
|
||||
if (isField && node.readonly) {
|
||||
this.word("readonly");
|
||||
this.space();
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=typescript.js.map
|
1
node_modules/@babel/generator/lib/generators/typescript.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/generators/typescript.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
98
node_modules/@babel/generator/lib/index.js
generated
vendored
Normal file
98
node_modules/@babel/generator/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.CodeGenerator = void 0;
|
||||
exports.default = generate;
|
||||
var _sourceMap = require("./source-map");
|
||||
var _printer = require("./printer");
|
||||
|
||||
class Generator extends _printer.default {
|
||||
constructor(ast, opts = {}, code) {
|
||||
const format = normalizeOptions(code, opts);
|
||||
const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
|
||||
super(format, map);
|
||||
this.ast = void 0;
|
||||
this.ast = ast;
|
||||
}
|
||||
|
||||
generate() {
|
||||
return super.generate(this.ast);
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeOptions(code, opts) {
|
||||
const format = {
|
||||
auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
|
||||
auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
|
||||
shouldPrintComment: opts.shouldPrintComment,
|
||||
retainLines: opts.retainLines,
|
||||
retainFunctionParens: opts.retainFunctionParens,
|
||||
comments: opts.comments == null || opts.comments,
|
||||
compact: opts.compact,
|
||||
minified: opts.minified,
|
||||
concise: opts.concise,
|
||||
indent: {
|
||||
adjustMultilineComment: true,
|
||||
style: " "
|
||||
},
|
||||
jsescOption: Object.assign({
|
||||
quotes: "double",
|
||||
wrap: true,
|
||||
minimal: false
|
||||
}, opts.jsescOption),
|
||||
recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType,
|
||||
topicToken: opts.topicToken
|
||||
};
|
||||
{
|
||||
format.decoratorsBeforeExport = !!opts.decoratorsBeforeExport;
|
||||
format.jsonCompatibleStrings = opts.jsonCompatibleStrings;
|
||||
}
|
||||
if (format.minified) {
|
||||
format.compact = true;
|
||||
format.shouldPrintComment = format.shouldPrintComment || (() => format.comments);
|
||||
} else {
|
||||
format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.includes("@license") || value.includes("@preserve"));
|
||||
}
|
||||
if (format.compact === "auto") {
|
||||
format.compact = code.length > 500000;
|
||||
|
||||
if (format.compact) {
|
||||
console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`);
|
||||
}
|
||||
}
|
||||
if (format.compact) {
|
||||
format.indent.adjustMultilineComment = false;
|
||||
}
|
||||
const {
|
||||
auxiliaryCommentBefore,
|
||||
auxiliaryCommentAfter,
|
||||
shouldPrintComment
|
||||
} = format;
|
||||
if (auxiliaryCommentBefore && !shouldPrintComment(auxiliaryCommentBefore)) {
|
||||
format.auxiliaryCommentBefore = undefined;
|
||||
}
|
||||
if (auxiliaryCommentAfter && !shouldPrintComment(auxiliaryCommentAfter)) {
|
||||
format.auxiliaryCommentAfter = undefined;
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
||||
class CodeGenerator {
|
||||
constructor(ast, opts, code) {
|
||||
this._generator = void 0;
|
||||
this._generator = new Generator(ast, opts, code);
|
||||
}
|
||||
generate() {
|
||||
return this._generator.generate();
|
||||
}
|
||||
}
|
||||
|
||||
exports.CodeGenerator = CodeGenerator;
|
||||
function generate(ast, opts, code) {
|
||||
const gen = new Generator(ast, opts, code);
|
||||
return gen.generate();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@babel/generator/lib/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
79
node_modules/@babel/generator/lib/node/index.js
generated
vendored
Normal file
79
node_modules/@babel/generator/lib/node/index.js
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.needsParens = needsParens;
|
||||
exports.needsWhitespace = needsWhitespace;
|
||||
exports.needsWhitespaceAfter = needsWhitespaceAfter;
|
||||
exports.needsWhitespaceBefore = needsWhitespaceBefore;
|
||||
var whitespace = require("./whitespace");
|
||||
var parens = require("./parentheses");
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
FLIPPED_ALIAS_KEYS,
|
||||
isCallExpression,
|
||||
isExpressionStatement,
|
||||
isMemberExpression,
|
||||
isNewExpression
|
||||
} = _t;
|
||||
function expandAliases(obj) {
|
||||
const newObj = {};
|
||||
function add(type, func) {
|
||||
const fn = newObj[type];
|
||||
newObj[type] = fn ? function (node, parent, stack) {
|
||||
const result = fn(node, parent, stack);
|
||||
return result == null ? func(node, parent, stack) : result;
|
||||
} : func;
|
||||
}
|
||||
for (const type of Object.keys(obj)) {
|
||||
const aliases = FLIPPED_ALIAS_KEYS[type];
|
||||
if (aliases) {
|
||||
for (const alias of aliases) {
|
||||
add(alias, obj[type]);
|
||||
}
|
||||
} else {
|
||||
add(type, obj[type]);
|
||||
}
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
const expandedParens = expandAliases(parens);
|
||||
const expandedWhitespaceNodes = expandAliases(whitespace.nodes);
|
||||
function find(obj, node, parent, printStack) {
|
||||
const fn = obj[node.type];
|
||||
return fn ? fn(node, parent, printStack) : null;
|
||||
}
|
||||
function isOrHasCallExpression(node) {
|
||||
if (isCallExpression(node)) {
|
||||
return true;
|
||||
}
|
||||
return isMemberExpression(node) && isOrHasCallExpression(node.object);
|
||||
}
|
||||
function needsWhitespace(node, parent, type) {
|
||||
if (!node) return false;
|
||||
if (isExpressionStatement(node)) {
|
||||
node = node.expression;
|
||||
}
|
||||
const flag = find(expandedWhitespaceNodes, node, parent);
|
||||
if (typeof flag === "number") {
|
||||
return (flag & type) !== 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function needsWhitespaceBefore(node, parent) {
|
||||
return needsWhitespace(node, parent, 1);
|
||||
}
|
||||
function needsWhitespaceAfter(node, parent) {
|
||||
return needsWhitespace(node, parent, 2);
|
||||
}
|
||||
function needsParens(node, parent, printStack) {
|
||||
if (!parent) return false;
|
||||
if (isNewExpression(parent) && parent.callee === node) {
|
||||
if (isOrHasCallExpression(node)) return true;
|
||||
}
|
||||
return find(expandedParens, node, parent, printStack);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@babel/generator/lib/node/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/node/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
312
node_modules/@babel/generator/lib/node/parentheses.js
generated
vendored
Normal file
312
node_modules/@babel/generator/lib/node/parentheses.js
generated
vendored
Normal file
@ -0,0 +1,312 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
||||
exports.AssignmentExpression = AssignmentExpression;
|
||||
exports.Binary = Binary;
|
||||
exports.BinaryExpression = BinaryExpression;
|
||||
exports.ClassExpression = ClassExpression;
|
||||
exports.ConditionalExpression = ConditionalExpression;
|
||||
exports.DoExpression = DoExpression;
|
||||
exports.FunctionExpression = FunctionExpression;
|
||||
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
||||
exports.Identifier = Identifier;
|
||||
exports.LogicalExpression = LogicalExpression;
|
||||
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
||||
exports.ObjectExpression = ObjectExpression;
|
||||
exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
|
||||
exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression;
|
||||
exports.SequenceExpression = SequenceExpression;
|
||||
exports.TSTypeAssertion = exports.TSSatisfiesExpression = exports.TSAsExpression = TSAsExpression;
|
||||
exports.TSInferType = TSInferType;
|
||||
exports.TSInstantiationExpression = TSInstantiationExpression;
|
||||
exports.TSIntersectionType = exports.TSUnionType = TSUnionType;
|
||||
exports.UnaryLike = UnaryLike;
|
||||
exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
||||
exports.UpdateExpression = UpdateExpression;
|
||||
exports.AwaitExpression = exports.YieldExpression = YieldExpression;
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
isArrayTypeAnnotation,
|
||||
isArrowFunctionExpression,
|
||||
isAssignmentExpression,
|
||||
isAwaitExpression,
|
||||
isBinary,
|
||||
isBinaryExpression,
|
||||
isUpdateExpression,
|
||||
isCallExpression,
|
||||
isClass,
|
||||
isClassExpression,
|
||||
isConditional,
|
||||
isConditionalExpression,
|
||||
isExportDeclaration,
|
||||
isExportDefaultDeclaration,
|
||||
isExpressionStatement,
|
||||
isFor,
|
||||
isForInStatement,
|
||||
isForOfStatement,
|
||||
isForStatement,
|
||||
isFunctionExpression,
|
||||
isIfStatement,
|
||||
isIndexedAccessType,
|
||||
isIntersectionTypeAnnotation,
|
||||
isLogicalExpression,
|
||||
isMemberExpression,
|
||||
isNewExpression,
|
||||
isNullableTypeAnnotation,
|
||||
isObjectPattern,
|
||||
isOptionalCallExpression,
|
||||
isOptionalMemberExpression,
|
||||
isReturnStatement,
|
||||
isSequenceExpression,
|
||||
isSwitchStatement,
|
||||
isTSArrayType,
|
||||
isTSAsExpression,
|
||||
isTSInstantiationExpression,
|
||||
isTSIntersectionType,
|
||||
isTSNonNullExpression,
|
||||
isTSOptionalType,
|
||||
isTSRestType,
|
||||
isTSTypeAssertion,
|
||||
isTSUnionType,
|
||||
isTaggedTemplateExpression,
|
||||
isThrowStatement,
|
||||
isTypeAnnotation,
|
||||
isUnaryLike,
|
||||
isUnionTypeAnnotation,
|
||||
isVariableDeclarator,
|
||||
isWhileStatement,
|
||||
isYieldExpression,
|
||||
isTSSatisfiesExpression
|
||||
} = _t;
|
||||
const PRECEDENCE = {
|
||||
"||": 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
|
||||
};
|
||||
const isClassExtendsClause = (node, parent) => isClass(parent, {
|
||||
superClass: node
|
||||
});
|
||||
const hasPostfixPart = (node, parent) => (isMemberExpression(parent) || isOptionalMemberExpression(parent)) && parent.object === node || (isCallExpression(parent) || isOptionalCallExpression(parent) || isNewExpression(parent)) && parent.callee === node || isTaggedTemplateExpression(parent) && parent.tag === node || isTSNonNullExpression(parent);
|
||||
function NullableTypeAnnotation(node, parent) {
|
||||
return isArrayTypeAnnotation(parent);
|
||||
}
|
||||
function FunctionTypeAnnotation(node, parent, printStack) {
|
||||
if (printStack.length < 3) return;
|
||||
return (
|
||||
isUnionTypeAnnotation(parent) ||
|
||||
isIntersectionTypeAnnotation(parent) ||
|
||||
isArrayTypeAnnotation(parent) ||
|
||||
isTypeAnnotation(parent) &&
|
||||
isArrowFunctionExpression(printStack[printStack.length - 3])
|
||||
);
|
||||
}
|
||||
function UpdateExpression(node, parent) {
|
||||
return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);
|
||||
}
|
||||
function ObjectExpression(node, parent, printStack) {
|
||||
return isFirstInContext(printStack, 1 | 2);
|
||||
}
|
||||
function DoExpression(node, parent, printStack) {
|
||||
return !node.async && isFirstInContext(printStack, 1);
|
||||
}
|
||||
function Binary(node, parent) {
|
||||
if (node.operator === "**" && isBinaryExpression(parent, {
|
||||
operator: "**"
|
||||
})) {
|
||||
return parent.left === node;
|
||||
}
|
||||
if (isClassExtendsClause(node, parent)) {
|
||||
return true;
|
||||
}
|
||||
if (hasPostfixPart(node, parent) || isUnaryLike(parent) || isAwaitExpression(parent)) {
|
||||
return true;
|
||||
}
|
||||
if (isBinary(parent)) {
|
||||
const parentOp = parent.operator;
|
||||
const parentPos = PRECEDENCE[parentOp];
|
||||
const nodeOp = node.operator;
|
||||
const nodePos = PRECEDENCE[nodeOp];
|
||||
if (
|
||||
parentPos === nodePos && parent.right === node && !isLogicalExpression(parent) || parentPos > nodePos) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
function UnionTypeAnnotation(node, parent) {
|
||||
return isArrayTypeAnnotation(parent) || isNullableTypeAnnotation(parent) || isIntersectionTypeAnnotation(parent) || isUnionTypeAnnotation(parent);
|
||||
}
|
||||
function OptionalIndexedAccessType(node, parent) {
|
||||
return isIndexedAccessType(parent, {
|
||||
objectType: node
|
||||
});
|
||||
}
|
||||
function TSAsExpression() {
|
||||
return true;
|
||||
}
|
||||
function TSUnionType(node, parent) {
|
||||
return isTSArrayType(parent) || isTSOptionalType(parent) || isTSIntersectionType(parent) || isTSUnionType(parent) || isTSRestType(parent);
|
||||
}
|
||||
function TSInferType(node, parent) {
|
||||
return isTSArrayType(parent) || isTSOptionalType(parent);
|
||||
}
|
||||
function TSInstantiationExpression(node, parent) {
|
||||
return (isCallExpression(parent) || isOptionalCallExpression(parent) || isNewExpression(parent) || isTSInstantiationExpression(parent)) && !!parent.typeParameters;
|
||||
}
|
||||
function BinaryExpression(node, parent) {
|
||||
return node.operator === "in" && (isVariableDeclarator(parent) || isFor(parent));
|
||||
}
|
||||
function SequenceExpression(node, parent) {
|
||||
if (
|
||||
isForStatement(parent) || isThrowStatement(parent) || isReturnStatement(parent) || isIfStatement(parent) && parent.test === node || isWhileStatement(parent) && parent.test === node || isForInStatement(parent) && parent.right === node || isSwitchStatement(parent) && parent.discriminant === node || isExpressionStatement(parent) && parent.expression === node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
function YieldExpression(node, parent) {
|
||||
return isBinary(parent) || isUnaryLike(parent) || hasPostfixPart(node, parent) || isAwaitExpression(parent) && isYieldExpression(node) || isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
|
||||
}
|
||||
function ClassExpression(node, parent, printStack) {
|
||||
return isFirstInContext(printStack, 1 | 4);
|
||||
}
|
||||
function UnaryLike(node, parent) {
|
||||
return hasPostfixPart(node, parent) || isBinaryExpression(parent, {
|
||||
operator: "**",
|
||||
left: node
|
||||
}) || isClassExtendsClause(node, parent);
|
||||
}
|
||||
function FunctionExpression(node, parent, printStack) {
|
||||
return isFirstInContext(printStack, 1 | 4);
|
||||
}
|
||||
function ArrowFunctionExpression(node, parent) {
|
||||
return isExportDeclaration(parent) || ConditionalExpression(node, parent);
|
||||
}
|
||||
function ConditionalExpression(node, parent) {
|
||||
if (isUnaryLike(parent) || isBinary(parent) || isConditionalExpression(parent, {
|
||||
test: node
|
||||
}) || isAwaitExpression(parent) || isTSTypeAssertion(parent) || isTSAsExpression(parent) || isTSSatisfiesExpression(parent)) {
|
||||
return true;
|
||||
}
|
||||
return UnaryLike(node, parent);
|
||||
}
|
||||
function OptionalMemberExpression(node, parent) {
|
||||
return isCallExpression(parent, {
|
||||
callee: node
|
||||
}) || isMemberExpression(parent, {
|
||||
object: node
|
||||
});
|
||||
}
|
||||
function AssignmentExpression(node, parent) {
|
||||
if (isObjectPattern(node.left)) {
|
||||
return true;
|
||||
} else {
|
||||
return ConditionalExpression(node, parent);
|
||||
}
|
||||
}
|
||||
function LogicalExpression(node, parent) {
|
||||
switch (node.operator) {
|
||||
case "||":
|
||||
if (!isLogicalExpression(parent)) return false;
|
||||
return parent.operator === "??" || parent.operator === "&&";
|
||||
case "&&":
|
||||
return isLogicalExpression(parent, {
|
||||
operator: "??"
|
||||
});
|
||||
case "??":
|
||||
return isLogicalExpression(parent) && parent.operator !== "??";
|
||||
}
|
||||
}
|
||||
function Identifier(node, parent, printStack) {
|
||||
var _node$extra;
|
||||
if ((_node$extra = node.extra) != null && _node$extra.parenthesized && isAssignmentExpression(parent, {
|
||||
left: node
|
||||
}) && (isFunctionExpression(parent.right) || isClassExpression(parent.right)) && parent.right.id == null) {
|
||||
return true;
|
||||
}
|
||||
if (node.name === "let") {
|
||||
const isFollowedByBracket = isMemberExpression(parent, {
|
||||
object: node,
|
||||
computed: true
|
||||
}) || isOptionalMemberExpression(parent, {
|
||||
object: node,
|
||||
computed: true,
|
||||
optional: false
|
||||
});
|
||||
return isFirstInContext(printStack, isFollowedByBracket ? 1 | 8 | 16 | 32 : 32);
|
||||
}
|
||||
|
||||
return node.name === "async" && isForOfStatement(parent) && node === parent.left;
|
||||
}
|
||||
|
||||
function isFirstInContext(printStack, checkParam) {
|
||||
const expressionStatement = checkParam & 1;
|
||||
const arrowBody = checkParam & 2;
|
||||
const exportDefault = checkParam & 4;
|
||||
const forHead = checkParam & 8;
|
||||
const forInHead = checkParam & 16;
|
||||
const forOfHead = checkParam & 32;
|
||||
let i = printStack.length - 1;
|
||||
if (i <= 0) return;
|
||||
let node = printStack[i];
|
||||
i--;
|
||||
let parent = printStack[i];
|
||||
while (i >= 0) {
|
||||
if (expressionStatement && isExpressionStatement(parent, {
|
||||
expression: node
|
||||
}) || exportDefault && isExportDefaultDeclaration(parent, {
|
||||
declaration: node
|
||||
}) || arrowBody && isArrowFunctionExpression(parent, {
|
||||
body: node
|
||||
}) || forHead && isForStatement(parent, {
|
||||
init: node
|
||||
}) || forInHead && isForInStatement(parent, {
|
||||
left: node
|
||||
}) || forOfHead && isForOfStatement(parent, {
|
||||
left: node
|
||||
})) {
|
||||
return true;
|
||||
}
|
||||
if (i > 0 && (hasPostfixPart(node, parent) && !isNewExpression(parent) || isSequenceExpression(parent) && parent.expressions[0] === node || isUpdateExpression(parent) && !parent.prefix || isConditional(parent, {
|
||||
test: node
|
||||
}) || isBinary(parent, {
|
||||
left: node
|
||||
}) || isAssignmentExpression(parent, {
|
||||
left: node
|
||||
}))) {
|
||||
node = parent;
|
||||
i--;
|
||||
parent = printStack[i];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=parentheses.js.map
|
1
node_modules/@babel/generator/lib/node/parentheses.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/node/parentheses.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
160
node_modules/@babel/generator/lib/node/whitespace.js
generated
vendored
Normal file
160
node_modules/@babel/generator/lib/node/whitespace.js
generated
vendored
Normal file
@ -0,0 +1,160 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.nodes = void 0;
|
||||
var _t = require("@babel/types");
|
||||
const {
|
||||
FLIPPED_ALIAS_KEYS,
|
||||
isArrayExpression,
|
||||
isAssignmentExpression,
|
||||
isBinary,
|
||||
isBlockStatement,
|
||||
isCallExpression,
|
||||
isFunction,
|
||||
isIdentifier,
|
||||
isLiteral,
|
||||
isMemberExpression,
|
||||
isObjectExpression,
|
||||
isOptionalCallExpression,
|
||||
isOptionalMemberExpression,
|
||||
isStringLiteral
|
||||
} = _t;
|
||||
function crawlInternal(node, state) {
|
||||
if (!node) return state;
|
||||
if (isMemberExpression(node) || isOptionalMemberExpression(node)) {
|
||||
crawlInternal(node.object, state);
|
||||
if (node.computed) crawlInternal(node.property, state);
|
||||
} else if (isBinary(node) || isAssignmentExpression(node)) {
|
||||
crawlInternal(node.left, state);
|
||||
crawlInternal(node.right, state);
|
||||
} else if (isCallExpression(node) || isOptionalCallExpression(node)) {
|
||||
state.hasCall = true;
|
||||
crawlInternal(node.callee, state);
|
||||
} else if (isFunction(node)) {
|
||||
state.hasFunction = true;
|
||||
} else if (isIdentifier(node)) {
|
||||
state.hasHelper =
|
||||
state.hasHelper || node.callee && isHelper(node.callee);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
function crawl(node) {
|
||||
return crawlInternal(node, {
|
||||
hasCall: false,
|
||||
hasFunction: false,
|
||||
hasHelper: false
|
||||
});
|
||||
}
|
||||
|
||||
function isHelper(node) {
|
||||
if (!node) return false;
|
||||
if (isMemberExpression(node)) {
|
||||
return isHelper(node.object) || isHelper(node.property);
|
||||
} else if (isIdentifier(node)) {
|
||||
return node.name === "require" || node.name.charCodeAt(0) === 95;
|
||||
} else if (isCallExpression(node)) {
|
||||
return isHelper(node.callee);
|
||||
} else if (isBinary(node) || isAssignmentExpression(node)) {
|
||||
return isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function isType(node) {
|
||||
return isLiteral(node) || isObjectExpression(node) || isArrayExpression(node) || isIdentifier(node) || isMemberExpression(node);
|
||||
}
|
||||
|
||||
const nodes = {
|
||||
|
||||
AssignmentExpression(node) {
|
||||
const state = crawl(node.right);
|
||||
if (state.hasCall && state.hasHelper || state.hasFunction) {
|
||||
return state.hasFunction ? 1 | 2 : 2;
|
||||
}
|
||||
},
|
||||
|
||||
SwitchCase(node, parent) {
|
||||
return (!!node.consequent.length || parent.cases[0] === node ? 1 : 0) | (!node.consequent.length && parent.cases[parent.cases.length - 1] === node ? 2 : 0);
|
||||
},
|
||||
|
||||
LogicalExpression(node) {
|
||||
if (isFunction(node.left) || isFunction(node.right)) {
|
||||
return 2;
|
||||
}
|
||||
},
|
||||
|
||||
Literal(node) {
|
||||
if (isStringLiteral(node) && node.value === "use strict") {
|
||||
return 2;
|
||||
}
|
||||
},
|
||||
|
||||
CallExpression(node) {
|
||||
if (isFunction(node.callee) || isHelper(node)) {
|
||||
return 1 | 2;
|
||||
}
|
||||
},
|
||||
OptionalCallExpression(node) {
|
||||
if (isFunction(node.callee)) {
|
||||
return 1 | 2;
|
||||
}
|
||||
},
|
||||
|
||||
VariableDeclaration(node) {
|
||||
for (let i = 0; i < node.declarations.length; i++) {
|
||||
const declar = node.declarations[i];
|
||||
let enabled = isHelper(declar.id) && !isType(declar.init);
|
||||
if (!enabled && declar.init) {
|
||||
const state = crawl(declar.init);
|
||||
enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
|
||||
}
|
||||
if (enabled) {
|
||||
return 1 | 2;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
IfStatement(node) {
|
||||
if (isBlockStatement(node.consequent)) {
|
||||
return 1 | 2;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.nodes = nodes;
|
||||
|
||||
nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) {
|
||||
if (parent.properties[0] === node) {
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
nodes.ObjectTypeCallProperty = function (node, parent) {
|
||||
var _parent$properties;
|
||||
if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) != null && _parent$properties.length)) {
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
nodes.ObjectTypeIndexer = function (node, parent) {
|
||||
var _parent$properties2, _parent$callPropertie;
|
||||
if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) != null && _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) != null && _parent$callPropertie.length)) {
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
nodes.ObjectTypeInternalSlot = function (node, parent) {
|
||||
var _parent$properties3, _parent$callPropertie2, _parent$indexers;
|
||||
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)) {
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) {
|
||||
[type].concat(FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
|
||||
const ret = amounts ? 1 | 2 : 0;
|
||||
nodes[type] = () => ret;
|
||||
});
|
||||
});
|
||||
|
||||
//# sourceMappingURL=whitespace.js.map
|
1
node_modules/@babel/generator/lib/node/whitespace.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/node/whitespace.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
664
node_modules/@babel/generator/lib/printer.js
generated
vendored
Normal file
664
node_modules/@babel/generator/lib/printer.js
generated
vendored
Normal file
@ -0,0 +1,664 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _buffer = require("./buffer");
|
||||
var n = require("./node");
|
||||
var _t = require("@babel/types");
|
||||
var generatorFunctions = require("./generators");
|
||||
const {
|
||||
isFunction,
|
||||
isStatement,
|
||||
isClassBody,
|
||||
isTSInterfaceBody
|
||||
} = _t;
|
||||
const SCIENTIFIC_NOTATION = /e/i;
|
||||
const ZERO_DECIMAL_INTEGER = /\.0+$/;
|
||||
const NON_DECIMAL_LITERAL = /^0[box]/;
|
||||
const PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/;
|
||||
const HAS_NEWLINE = /[\n\r\u2028\u2029]/;
|
||||
const HAS_BlOCK_COMMENT_END = /\*\//;
|
||||
const {
|
||||
needsParens
|
||||
} = n;
|
||||
class Printer {
|
||||
constructor(format, map) {
|
||||
this.inForStatementInitCounter = 0;
|
||||
this._printStack = [];
|
||||
this._indent = 0;
|
||||
this._indentChar = 0;
|
||||
this._indentRepeat = 0;
|
||||
this._insideAux = false;
|
||||
this._parenPushNewlineState = null;
|
||||
this._noLineTerminator = false;
|
||||
this._printAuxAfterOnNextUserNode = false;
|
||||
this._printedComments = new Set();
|
||||
this._endsWithInteger = false;
|
||||
this._endsWithWord = false;
|
||||
this._lastCommentLine = 0;
|
||||
this._endsWithInnerRaw = false;
|
||||
this._indentInnerComments = true;
|
||||
this.format = format;
|
||||
this._buf = new _buffer.default(map);
|
||||
this._indentChar = format.indent.style.charCodeAt(0);
|
||||
this._indentRepeat = format.indent.style.length;
|
||||
}
|
||||
generate(ast) {
|
||||
this.print(ast);
|
||||
this._maybeAddAuxComment();
|
||||
return this._buf.get();
|
||||
}
|
||||
|
||||
indent() {
|
||||
if (this.format.compact || this.format.concise) return;
|
||||
this._indent++;
|
||||
}
|
||||
|
||||
dedent() {
|
||||
if (this.format.compact || this.format.concise) return;
|
||||
this._indent--;
|
||||
}
|
||||
|
||||
semicolon(force = false) {
|
||||
this._maybeAddAuxComment();
|
||||
if (force) {
|
||||
this._appendChar(59);
|
||||
} else {
|
||||
this._queue(59);
|
||||
}
|
||||
this._noLineTerminator = false;
|
||||
}
|
||||
|
||||
rightBrace() {
|
||||
if (this.format.minified) {
|
||||
this._buf.removeLastSemicolon();
|
||||
}
|
||||
this.tokenChar(125);
|
||||
}
|
||||
|
||||
space(force = false) {
|
||||
if (this.format.compact) return;
|
||||
if (force) {
|
||||
this._space();
|
||||
} else if (this._buf.hasContent()) {
|
||||
const lastCp = this.getLastChar();
|
||||
if (lastCp !== 32 && lastCp !== 10) {
|
||||
this._space();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
word(str, noLineTerminatorAfter = false) {
|
||||
this._maybePrintInnerComments();
|
||||
|
||||
if (this._endsWithWord || str.charCodeAt(0) === 47 && this.endsWith(47)) {
|
||||
this._space();
|
||||
}
|
||||
this._maybeAddAuxComment();
|
||||
this._append(str, false);
|
||||
this._endsWithWord = true;
|
||||
this._noLineTerminator = noLineTerminatorAfter;
|
||||
}
|
||||
|
||||
number(str) {
|
||||
this.word(str);
|
||||
|
||||
this._endsWithInteger = Number.isInteger(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46;
|
||||
}
|
||||
|
||||
token(str, maybeNewline = false) {
|
||||
this._maybePrintInnerComments();
|
||||
|
||||
const lastChar = this.getLastChar();
|
||||
const strFirst = str.charCodeAt(0);
|
||||
if (lastChar === 33 && str === "--" ||
|
||||
strFirst === 43 && lastChar === 43 || strFirst === 45 && lastChar === 45 ||
|
||||
strFirst === 46 && this._endsWithInteger) {
|
||||
this._space();
|
||||
}
|
||||
this._maybeAddAuxComment();
|
||||
this._append(str, maybeNewline);
|
||||
this._noLineTerminator = false;
|
||||
}
|
||||
tokenChar(char) {
|
||||
this._maybePrintInnerComments();
|
||||
|
||||
const lastChar = this.getLastChar();
|
||||
if (
|
||||
char === 43 && lastChar === 43 || char === 45 && lastChar === 45 ||
|
||||
char === 46 && this._endsWithInteger) {
|
||||
this._space();
|
||||
}
|
||||
this._maybeAddAuxComment();
|
||||
this._appendChar(char);
|
||||
this._noLineTerminator = false;
|
||||
}
|
||||
|
||||
newline(i = 1, force) {
|
||||
if (i <= 0) return;
|
||||
if (!force) {
|
||||
if (this.format.retainLines || this.format.compact) return;
|
||||
if (this.format.concise) {
|
||||
this.space();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (i > 2) i = 2;
|
||||
|
||||
i -= this._buf.getNewlineCount();
|
||||
for (let j = 0; j < i; j++) {
|
||||
this._newline();
|
||||
}
|
||||
return;
|
||||
}
|
||||
endsWith(char) {
|
||||
return this.getLastChar() === char;
|
||||
}
|
||||
getLastChar() {
|
||||
return this._buf.getLastChar();
|
||||
}
|
||||
endsWithCharAndNewline() {
|
||||
return this._buf.endsWithCharAndNewline();
|
||||
}
|
||||
removeTrailingNewline() {
|
||||
this._buf.removeTrailingNewline();
|
||||
}
|
||||
exactSource(loc, cb) {
|
||||
if (!loc) return cb();
|
||||
this._catchUp("start", loc);
|
||||
this._buf.exactSource(loc, cb);
|
||||
}
|
||||
source(prop, loc) {
|
||||
if (!loc) return;
|
||||
this._catchUp(prop, loc);
|
||||
this._buf.source(prop, loc);
|
||||
}
|
||||
sourceWithOffset(prop, loc, lineOffset, columnOffset) {
|
||||
if (!loc) return;
|
||||
this._catchUp(prop, loc);
|
||||
this._buf.sourceWithOffset(prop, loc, lineOffset, columnOffset);
|
||||
}
|
||||
withSource(prop, loc, cb) {
|
||||
if (!loc) return cb();
|
||||
this._catchUp(prop, loc);
|
||||
this._buf.withSource(prop, loc, cb);
|
||||
}
|
||||
_space() {
|
||||
this._queue(32);
|
||||
}
|
||||
_newline() {
|
||||
this._queue(10);
|
||||
}
|
||||
_append(str, maybeNewline) {
|
||||
this._maybeAddParen(str);
|
||||
this._maybeIndent(str.charCodeAt(0));
|
||||
this._buf.append(str, maybeNewline);
|
||||
this._endsWithWord = false;
|
||||
this._endsWithInteger = false;
|
||||
}
|
||||
_appendChar(char) {
|
||||
this._maybeAddParenChar(char);
|
||||
this._maybeIndent(char);
|
||||
this._buf.appendChar(char);
|
||||
this._endsWithWord = false;
|
||||
this._endsWithInteger = false;
|
||||
}
|
||||
_queue(char) {
|
||||
this._maybeAddParenChar(char);
|
||||
this._maybeIndent(char);
|
||||
this._buf.queue(char);
|
||||
this._endsWithWord = false;
|
||||
this._endsWithInteger = false;
|
||||
}
|
||||
_maybeIndent(firstChar) {
|
||||
if (this._indent && firstChar !== 10 && this.endsWith(10)) {
|
||||
this._buf.queueIndentation(this._indentChar, this._getIndent());
|
||||
}
|
||||
}
|
||||
_shouldIndent(firstChar) {
|
||||
if (this._indent && firstChar !== 10 && this.endsWith(10)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
_maybeAddParenChar(char) {
|
||||
const parenPushNewlineState = this._parenPushNewlineState;
|
||||
if (!parenPushNewlineState) return;
|
||||
|
||||
if (char === 32) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (char !== 10) {
|
||||
this._parenPushNewlineState = null;
|
||||
return;
|
||||
}
|
||||
this.tokenChar(40);
|
||||
this.indent();
|
||||
parenPushNewlineState.printed = true;
|
||||
}
|
||||
_maybeAddParen(str) {
|
||||
const parenPushNewlineState = this._parenPushNewlineState;
|
||||
if (!parenPushNewlineState) return;
|
||||
|
||||
const len = str.length;
|
||||
let i;
|
||||
for (i = 0; i < len && str.charCodeAt(i) === 32; i++) continue;
|
||||
if (i === len) {
|
||||
return;
|
||||
}
|
||||
|
||||
const cha = str.charCodeAt(i);
|
||||
if (cha !== 10) {
|
||||
if (
|
||||
cha !== 47 ||
|
||||
i + 1 === len) {
|
||||
this._parenPushNewlineState = null;
|
||||
return;
|
||||
}
|
||||
const chaPost = str.charCodeAt(i + 1);
|
||||
if (chaPost === 42) {
|
||||
|
||||
if (PURE_ANNOTATION_RE.test(str.slice(i + 2, len - 2))) {
|
||||
return;
|
||||
}
|
||||
|
||||
} else if (chaPost !== 47) {
|
||||
this._parenPushNewlineState = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.tokenChar(40);
|
||||
this.indent();
|
||||
parenPushNewlineState.printed = true;
|
||||
}
|
||||
catchUp(line) {
|
||||
if (!this.format.retainLines) return;
|
||||
|
||||
const count = line - this._buf.getCurrentLine();
|
||||
for (let i = 0; i < count; i++) {
|
||||
this._newline();
|
||||
}
|
||||
}
|
||||
_catchUp(prop, loc) {
|
||||
if (!this.format.retainLines) return;
|
||||
|
||||
const pos = loc ? loc[prop] : null;
|
||||
if ((pos == null ? void 0 : pos.line) != null) {
|
||||
const count = pos.line - this._buf.getCurrentLine();
|
||||
for (let i = 0; i < count; i++) {
|
||||
this._newline();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_getIndent() {
|
||||
return this._indentRepeat * this._indent;
|
||||
}
|
||||
printTerminatorless(node, parent, isLabel) {
|
||||
if (isLabel) {
|
||||
this._noLineTerminator = true;
|
||||
this.print(node, parent);
|
||||
} else {
|
||||
const terminatorState = {
|
||||
printed: false
|
||||
};
|
||||
this._parenPushNewlineState = terminatorState;
|
||||
this.print(node, parent);
|
||||
if (terminatorState.printed) {
|
||||
this.dedent();
|
||||
this.newline();
|
||||
this.tokenChar(41);
|
||||
}
|
||||
}
|
||||
}
|
||||
print(node, parent, noLineTerminatorAfter,
|
||||
trailingCommentsLineOffset, forceParens) {
|
||||
if (!node) return;
|
||||
this._endsWithInnerRaw = false;
|
||||
const nodeType = node.type;
|
||||
const format = this.format;
|
||||
const oldConcise = format.concise;
|
||||
if (
|
||||
node._compact) {
|
||||
format.concise = true;
|
||||
}
|
||||
const printMethod = this[nodeType];
|
||||
if (printMethod === undefined) {
|
||||
throw new ReferenceError(`unknown node of type ${JSON.stringify(nodeType)} with constructor ${JSON.stringify(node.constructor.name)}`);
|
||||
}
|
||||
this._printStack.push(node);
|
||||
const oldInAux = this._insideAux;
|
||||
this._insideAux = node.loc == undefined;
|
||||
this._maybeAddAuxComment(this._insideAux && !oldInAux);
|
||||
let shouldPrintParens = false;
|
||||
if (forceParens) {
|
||||
shouldPrintParens = true;
|
||||
} else if (format.retainFunctionParens && nodeType === "FunctionExpression" && node.extra && node.extra.parenthesized) {
|
||||
shouldPrintParens = true;
|
||||
} else {
|
||||
shouldPrintParens = needsParens(node, parent, this._printStack);
|
||||
}
|
||||
if (shouldPrintParens) {
|
||||
this.tokenChar(40);
|
||||
this._endsWithInnerRaw = false;
|
||||
}
|
||||
this._lastCommentLine = 0;
|
||||
this._printLeadingComments(node, parent);
|
||||
const loc = nodeType === "Program" || nodeType === "File" ? null : node.loc;
|
||||
this.exactSource(loc, printMethod.bind(this, node, parent));
|
||||
if (shouldPrintParens) {
|
||||
this._printTrailingComments(node, parent);
|
||||
this.tokenChar(41);
|
||||
this._noLineTerminator = noLineTerminatorAfter;
|
||||
} else if (noLineTerminatorAfter && !this._noLineTerminator) {
|
||||
this._noLineTerminator = true;
|
||||
this._printTrailingComments(node, parent);
|
||||
} else {
|
||||
this._printTrailingComments(node, parent, trailingCommentsLineOffset);
|
||||
}
|
||||
|
||||
this._printStack.pop();
|
||||
format.concise = oldConcise;
|
||||
this._insideAux = oldInAux;
|
||||
this._endsWithInnerRaw = false;
|
||||
}
|
||||
_maybeAddAuxComment(enteredPositionlessNode) {
|
||||
if (enteredPositionlessNode) this._printAuxBeforeComment();
|
||||
if (!this._insideAux) this._printAuxAfterComment();
|
||||
}
|
||||
_printAuxBeforeComment() {
|
||||
if (this._printAuxAfterOnNextUserNode) return;
|
||||
this._printAuxAfterOnNextUserNode = true;
|
||||
const comment = this.format.auxiliaryCommentBefore;
|
||||
if (comment) {
|
||||
this._printComment({
|
||||
type: "CommentBlock",
|
||||
value: comment
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
_printAuxAfterComment() {
|
||||
if (!this._printAuxAfterOnNextUserNode) return;
|
||||
this._printAuxAfterOnNextUserNode = false;
|
||||
const comment = this.format.auxiliaryCommentAfter;
|
||||
if (comment) {
|
||||
this._printComment({
|
||||
type: "CommentBlock",
|
||||
value: comment
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
getPossibleRaw(node) {
|
||||
const extra = node.extra;
|
||||
if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) {
|
||||
return extra.raw;
|
||||
}
|
||||
}
|
||||
printJoin(nodes, parent, opts = {}) {
|
||||
if (!(nodes != null && nodes.length)) return;
|
||||
if (opts.indent) this.indent();
|
||||
const newlineOpts = {
|
||||
addNewlines: opts.addNewlines,
|
||||
nextNodeStartLine: 0
|
||||
};
|
||||
const separator = opts.separator ? opts.separator.bind(this) : null;
|
||||
const len = nodes.length;
|
||||
for (let i = 0; i < len; i++) {
|
||||
const node = nodes[i];
|
||||
if (!node) continue;
|
||||
if (opts.statement) this._printNewline(i === 0, newlineOpts);
|
||||
this.print(node, parent, undefined, opts.trailingCommentsLineOffset || 0);
|
||||
opts.iterator == null ? void 0 : opts.iterator(node, i);
|
||||
if (i < len - 1) separator == null ? void 0 : separator();
|
||||
if (opts.statement) {
|
||||
if (i + 1 === len) {
|
||||
this.newline(1);
|
||||
} else {
|
||||
var _nextNode$loc;
|
||||
const nextNode = nodes[i + 1];
|
||||
newlineOpts.nextNodeStartLine = ((_nextNode$loc = nextNode.loc) == null ? void 0 : _nextNode$loc.start.line) || 0;
|
||||
this._printNewline(true, newlineOpts);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (opts.indent) this.dedent();
|
||||
}
|
||||
printAndIndentOnComments(node, parent) {
|
||||
const indent = node.leadingComments && node.leadingComments.length > 0;
|
||||
if (indent) this.indent();
|
||||
this.print(node, parent);
|
||||
if (indent) this.dedent();
|
||||
}
|
||||
printBlock(parent) {
|
||||
const node = parent.body;
|
||||
if (node.type !== "EmptyStatement") {
|
||||
this.space();
|
||||
}
|
||||
this.print(node, parent);
|
||||
}
|
||||
_printTrailingComments(node, parent, lineOffset) {
|
||||
const {
|
||||
innerComments,
|
||||
trailingComments
|
||||
} = node;
|
||||
if (innerComments != null && innerComments.length) {
|
||||
this._printComments(2, innerComments, node, parent, lineOffset);
|
||||
}
|
||||
if (trailingComments != null && trailingComments.length) {
|
||||
this._printComments(2, trailingComments, node, parent, lineOffset);
|
||||
}
|
||||
}
|
||||
_printLeadingComments(node, parent) {
|
||||
const comments = node.leadingComments;
|
||||
if (!(comments != null && comments.length)) return;
|
||||
this._printComments(0, comments, node, parent);
|
||||
}
|
||||
_maybePrintInnerComments() {
|
||||
if (this._endsWithInnerRaw) this.printInnerComments();
|
||||
this._endsWithInnerRaw = true;
|
||||
this._indentInnerComments = true;
|
||||
}
|
||||
printInnerComments() {
|
||||
const node = this._printStack[this._printStack.length - 1];
|
||||
const comments = node.innerComments;
|
||||
if (!(comments != null && comments.length)) return;
|
||||
const hasSpace = this.endsWith(32);
|
||||
const indent = this._indentInnerComments;
|
||||
const printedCommentsCount = this._printedComments.size;
|
||||
if (indent) this.indent();
|
||||
this._printComments(1, comments, node);
|
||||
if (hasSpace && printedCommentsCount !== this._printedComments.size) {
|
||||
this.space();
|
||||
}
|
||||
if (indent) this.dedent();
|
||||
}
|
||||
noIndentInnerCommentsHere() {
|
||||
this._indentInnerComments = false;
|
||||
}
|
||||
printSequence(nodes, parent, opts = {}) {
|
||||
opts.statement = true;
|
||||
return this.printJoin(nodes, parent, opts);
|
||||
}
|
||||
printList(items, parent, opts = {}) {
|
||||
if (opts.separator == null) {
|
||||
opts.separator = commaSeparator;
|
||||
}
|
||||
return this.printJoin(items, parent, opts);
|
||||
}
|
||||
_printNewline(newLine, opts) {
|
||||
if (this.format.retainLines || this.format.compact) return;
|
||||
|
||||
if (this.format.concise) {
|
||||
this.space();
|
||||
return;
|
||||
}
|
||||
if (!newLine) {
|
||||
return;
|
||||
}
|
||||
const startLine = opts.nextNodeStartLine;
|
||||
const lastCommentLine = this._lastCommentLine;
|
||||
if (startLine > 0 && lastCommentLine > 0) {
|
||||
const offset = startLine - lastCommentLine;
|
||||
if (offset >= 0) {
|
||||
this.newline(offset || 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this._buf.hasContent()) {
|
||||
|
||||
this.newline(1);
|
||||
}
|
||||
}
|
||||
|
||||
_shouldPrintComment(comment) {
|
||||
if (comment.ignore) return 0;
|
||||
if (this._printedComments.has(comment)) return 0;
|
||||
if (this._noLineTerminator && (HAS_NEWLINE.test(comment.value) || HAS_BlOCK_COMMENT_END.test(comment.value))) {
|
||||
return 2;
|
||||
}
|
||||
this._printedComments.add(comment);
|
||||
if (!this.format.shouldPrintComment(comment.value)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
_printComment(comment, skipNewLines) {
|
||||
const noLineTerminator = this._noLineTerminator;
|
||||
const isBlockComment = comment.type === "CommentBlock";
|
||||
|
||||
const printNewLines = isBlockComment && skipNewLines !== 1 && !this._noLineTerminator;
|
||||
if (printNewLines && this._buf.hasContent() && skipNewLines !== 2) {
|
||||
this.newline(1);
|
||||
}
|
||||
const lastCharCode = this.getLastChar();
|
||||
if (lastCharCode !== 91 && lastCharCode !== 123) {
|
||||
this.space();
|
||||
}
|
||||
let val;
|
||||
if (isBlockComment) {
|
||||
val = `/*${comment.value}*/`;
|
||||
if (this.format.indent.adjustMultilineComment) {
|
||||
var _comment$loc;
|
||||
const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;
|
||||
if (offset) {
|
||||
const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
|
||||
val = val.replace(newlineRegex, "\n");
|
||||
}
|
||||
let indentSize = this.format.retainLines ? 0 : this._buf.getCurrentColumn();
|
||||
if (this._shouldIndent(47) || this.format.retainLines) {
|
||||
indentSize += this._getIndent();
|
||||
}
|
||||
val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`);
|
||||
}
|
||||
} else if (!noLineTerminator) {
|
||||
val = `//${comment.value}`;
|
||||
} else {
|
||||
val = `/*${comment.value}*/`;
|
||||
}
|
||||
|
||||
if (this.endsWith(47)) this._space();
|
||||
this.source("start", comment.loc);
|
||||
this._append(val, isBlockComment);
|
||||
if (!isBlockComment && !noLineTerminator) {
|
||||
this.newline(1, true);
|
||||
}
|
||||
if (printNewLines && skipNewLines !== 3) {
|
||||
this.newline(1);
|
||||
}
|
||||
}
|
||||
_printComments(type, comments, node, parent, lineOffset = 0) {
|
||||
const nodeLoc = node.loc;
|
||||
const len = comments.length;
|
||||
let hasLoc = !!nodeLoc;
|
||||
const nodeStartLine = hasLoc ? nodeLoc.start.line : 0;
|
||||
const nodeEndLine = hasLoc ? nodeLoc.end.line : 0;
|
||||
let lastLine = 0;
|
||||
let leadingCommentNewline = 0;
|
||||
const maybeNewline = this._noLineTerminator ? function () {} : this.newline.bind(this);
|
||||
for (let i = 0; i < len; i++) {
|
||||
const comment = comments[i];
|
||||
const shouldPrint = this._shouldPrintComment(comment);
|
||||
if (shouldPrint === 2) {
|
||||
hasLoc = false;
|
||||
break;
|
||||
}
|
||||
if (hasLoc && comment.loc && shouldPrint === 1) {
|
||||
const commentStartLine = comment.loc.start.line;
|
||||
const commentEndLine = comment.loc.end.line;
|
||||
if (type === 0) {
|
||||
let offset = 0;
|
||||
if (i === 0) {
|
||||
if (this._buf.hasContent() && (comment.type === "CommentLine" || commentStartLine != commentEndLine)) {
|
||||
offset = leadingCommentNewline = 1;
|
||||
}
|
||||
} else {
|
||||
offset = commentStartLine - lastLine;
|
||||
}
|
||||
lastLine = commentEndLine;
|
||||
maybeNewline(offset);
|
||||
this._printComment(comment, 1);
|
||||
if (i + 1 === len) {
|
||||
maybeNewline(Math.max(nodeStartLine - lastLine, leadingCommentNewline));
|
||||
lastLine = nodeStartLine;
|
||||
}
|
||||
} else if (type === 1) {
|
||||
const offset = commentStartLine - (i === 0 ? nodeStartLine : lastLine);
|
||||
lastLine = commentEndLine;
|
||||
maybeNewline(offset);
|
||||
this._printComment(comment, 1);
|
||||
if (i + 1 === len) {
|
||||
maybeNewline(Math.min(1, nodeEndLine - lastLine));
|
||||
lastLine = nodeEndLine;
|
||||
}
|
||||
} else {
|
||||
const offset = commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine);
|
||||
lastLine = commentEndLine;
|
||||
maybeNewline(offset);
|
||||
this._printComment(comment, 1);
|
||||
}
|
||||
} else {
|
||||
hasLoc = false;
|
||||
if (shouldPrint !== 1) {
|
||||
continue;
|
||||
}
|
||||
if (len === 1) {
|
||||
const singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value);
|
||||
const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent);
|
||||
if (type === 0) {
|
||||
this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction(parent, {
|
||||
body: node
|
||||
}) ? 1 : 0);
|
||||
} else if (shouldSkipNewline && type === 2) {
|
||||
this._printComment(comment, 1);
|
||||
} else {
|
||||
this._printComment(comment, 0);
|
||||
}
|
||||
} else if (type === 1 && !(node.type === "ObjectExpression" && node.properties.length > 1) && node.type !== "ClassBody" && node.type !== "TSInterfaceBody") {
|
||||
|
||||
this._printComment(comment, i === 0 ? 2 : i === len - 1 ? 3 : 0);
|
||||
} else {
|
||||
this._printComment(comment, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type === 2 && hasLoc && lastLine) {
|
||||
this._lastCommentLine = lastLine;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(Printer.prototype, generatorFunctions);
|
||||
{
|
||||
Printer.prototype.Noop = function Noop() {};
|
||||
}
|
||||
var _default = Printer;
|
||||
exports.default = _default;
|
||||
function commaSeparator() {
|
||||
this.tokenChar(44);
|
||||
this.space();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=printer.js.map
|
1
node_modules/@babel/generator/lib/printer.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/printer.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
58
node_modules/@babel/generator/lib/source-map.js
generated
vendored
Normal file
58
node_modules/@babel/generator/lib/source-map.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _genMapping = require("@jridgewell/gen-mapping");
|
||||
|
||||
class SourceMap {
|
||||
|
||||
constructor(opts, code) {
|
||||
var _opts$sourceFileName;
|
||||
this._map = void 0;
|
||||
this._rawMappings = void 0;
|
||||
this._sourceFileName = void 0;
|
||||
this._lastGenLine = 0;
|
||||
this._lastSourceLine = 0;
|
||||
this._lastSourceColumn = 0;
|
||||
const map = this._map = new _genMapping.GenMapping({
|
||||
sourceRoot: opts.sourceRoot
|
||||
});
|
||||
this._sourceFileName = (_opts$sourceFileName = opts.sourceFileName) == null ? void 0 : _opts$sourceFileName.replace(/\\/g, "/");
|
||||
this._rawMappings = undefined;
|
||||
if (typeof code === "string") {
|
||||
(0, _genMapping.setSourceContent)(map, this._sourceFileName, code);
|
||||
} else if (typeof code === "object") {
|
||||
Object.keys(code).forEach(sourceFileName => {
|
||||
(0, _genMapping.setSourceContent)(map, sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
get() {
|
||||
return (0, _genMapping.toEncodedMap)(this._map);
|
||||
}
|
||||
getDecoded() {
|
||||
return (0, _genMapping.toDecodedMap)(this._map);
|
||||
}
|
||||
getRawMappings() {
|
||||
return this._rawMappings || (this._rawMappings = (0, _genMapping.allMappings)(this._map));
|
||||
}
|
||||
|
||||
mark(generated, line, column, identifierName, filename) {
|
||||
this._rawMappings = undefined;
|
||||
(0, _genMapping.maybeAddMapping)(this._map, {
|
||||
name: identifierName,
|
||||
generated,
|
||||
source: line == null ? undefined : (filename == null ? void 0 : filename.replace(/\\/g, "/")) || this._sourceFileName,
|
||||
original: line == null ? undefined : {
|
||||
line: line,
|
||||
column: column
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.default = SourceMap;
|
||||
|
||||
//# sourceMappingURL=source-map.js.map
|
1
node_modules/@babel/generator/lib/source-map.js.map
generated
vendored
Normal file
1
node_modules/@babel/generator/lib/source-map.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["SourceMap","constructor","opts","code","_map","_rawMappings","_sourceFileName","_lastGenLine","_lastSourceLine","_lastSourceColumn","map","GenMapping","sourceRoot","sourceFileName","replace","undefined","setSourceContent","Object","keys","forEach","get","toEncodedMap","getDecoded","toDecodedMap","getRawMappings","allMappings","mark","generated","line","column","identifierName","filename","maybeAddMapping","name","source","original"],"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\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 ony check in unison with sourceLine, which\n // inits to an impossible value. So init to 0 is fine.\n private _lastSourceColumn = 0;\n\n constructor(\n opts: { sourceFileName?: string; sourceRoot?: string },\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 (typeof code === \"string\") {\n setSourceContent(map, this._sourceFileName, code);\n } else if (typeof code === \"object\") {\n Object.keys(code).forEach(sourceFileName => {\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 filename?: string | null,\n ) {\n this._rawMappings = undefined;\n\n maybeAddMapping(this._map, {\n name: identifierName,\n generated,\n source:\n line == null\n ? undefined\n : filename?.replace(/\\\\/g, \"/\") || this._sourceFileName,\n original:\n line == null\n ? undefined\n : {\n line: line,\n column: column,\n },\n });\n }\n}\n"],"mappings":";;;;;;AAAA;;AAmBe,MAAMA,SAAS,CAAC;;EAa7BC,WAAW,CACTC,IAAsD,EACtDC,IAAmD,EACnD;IAAA;IAAA,KAfMC,IAAI;IAAA,KACJC,YAAY;IAAA,KACZC,eAAe;IAAA,KAGfC,YAAY,GAAG,CAAC;IAAA,KAChBC,eAAe,GAAG,CAAC;IAAA,KAInBC,iBAAiB,GAAG,CAAC;IAM3B,MAAMC,GAAG,GAAI,IAAI,CAACN,IAAI,GAAG,IAAIO,sBAAU,CAAC;MAAEC,UAAU,EAAEV,IAAI,CAACU;IAAW,CAAC,CAAE;IACzE,IAAI,CAACN,eAAe,2BAAGJ,IAAI,CAACW,cAAc,qBAAnB,qBAAqBC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;IAC/D,IAAI,CAACT,YAAY,GAAGU,SAAS;IAE7B,IAAI,OAAOZ,IAAI,KAAK,QAAQ,EAAE;MAC5B,IAAAa,4BAAgB,EAACN,GAAG,EAAE,IAAI,CAACJ,eAAe,EAAEH,IAAI,CAAC;IACnD,CAAC,MAAM,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MACnCc,MAAM,CAACC,IAAI,CAACf,IAAI,CAAC,CAACgB,OAAO,CAACN,cAAc,IAAI;QAC1C,IAAAG,4BAAgB,EACdN,GAAG,EACHG,cAAc,CAACC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAClCX,IAAI,CAACU,cAAc,CAAC,CACrB;MACH,CAAC,CAAC;IACJ;EACF;;EAKAO,GAAG,GAAqB;IACtB,OAAO,IAAAC,wBAAY,EAAC,IAAI,CAACjB,IAAI,CAAC;EAChC;EAEAkB,UAAU,GAAqB;IAC7B,OAAO,IAAAC,wBAAY,EAAC,IAAI,CAACnB,IAAI,CAAC;EAChC;EAEAoB,cAAc,GAAc;IAC1B,OAAQ,IAAI,CAACnB,YAAY,KAAjB,IAAI,CAACA,YAAY,GAAK,IAAAoB,uBAAW,EAAC,IAAI,CAACrB,IAAI,CAAC;EACtD;;EAOAsB,IAAI,CACFC,SAA2C,EAC3CC,IAAY,EACZC,MAAc,EACdC,cAA8B,EAC9BC,QAAwB,EACxB;IACA,IAAI,CAAC1B,YAAY,GAAGU,SAAS;IAE7B,IAAAiB,2BAAe,EAAC,IAAI,CAAC5B,IAAI,EAAE;MACzB6B,IAAI,EAAEH,cAAc;MACpBH,SAAS;MACTO,MAAM,EACJN,IAAI,IAAI,IAAI,GACRb,SAAS,GACT,CAAAgB,QAAQ,oBAARA,QAAQ,CAAEjB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,KAAI,IAAI,CAACR,eAAe;MAC3D6B,QAAQ,EACNP,IAAI,IAAI,IAAI,GACRb,SAAS,GACT;QACEa,IAAI,EAAEA,IAAI;QACVC,MAAM,EAAEA;MACV;IACR,CAAC,CAAC;EACJ;AACF;AAAC"}
|
37
node_modules/@babel/generator/package.json
generated
vendored
Normal file
37
node_modules/@babel/generator/package.json
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@babel/generator",
|
||||
"version": "7.20.5",
|
||||
"description": "Turns an AST into code.",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-generator"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-generator",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen",
|
||||
"main": "./lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.20.5",
|
||||
"@jridgewell/gen-mapping": "^0.3.2",
|
||||
"jsesc": "^2.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "^7.19.4",
|
||||
"@babel/parser": "^7.20.5",
|
||||
"@jridgewell/trace-mapping": "^0.3.8",
|
||||
"@types/jsesc": "^2.5.0",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
22
node_modules/@babel/helper-string-parser/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/helper-string-parser/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/helper-string-parser/README.md
generated
vendored
Normal file
19
node_modules/@babel/helper-string-parser/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/helper-string-parser
|
||||
|
||||
> A utility package to parse strings
|
||||
|
||||
See our website [@babel/helper-string-parser](https://babeljs.io/docs/en/babel-helper-string-parser) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-string-parser
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-string-parser
|
||||
```
|
347
node_modules/@babel/helper-string-parser/lib/index.js
generated
vendored
Normal file
347
node_modules/@babel/helper-string-parser/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,347 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.readCodePoint = readCodePoint;
|
||||
exports.readInt = readInt;
|
||||
exports.readStringContents = readStringContents;
|
||||
|
||||
var _isDigit = function isDigit(code) {
|
||||
return code >= 48 && code <= 57;
|
||||
};
|
||||
|
||||
const forbiddenNumericSeparatorSiblings = {
|
||||
decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]),
|
||||
hex: new Set([46, 88, 95, 120])
|
||||
};
|
||||
const isAllowedNumericSeparatorSibling = {
|
||||
bin: ch => ch === 48 || ch === 49,
|
||||
oct: ch => ch >= 48 && ch <= 55,
|
||||
dec: ch => ch >= 48 && ch <= 57,
|
||||
hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
|
||||
};
|
||||
|
||||
function readStringContents(type, input, pos, lineStart, curLine, errors) {
|
||||
const initialPos = pos;
|
||||
const initialLineStart = lineStart;
|
||||
const initialCurLine = curLine;
|
||||
let out = "";
|
||||
let firstInvalidLoc = null;
|
||||
let chunkStart = pos;
|
||||
const {
|
||||
length
|
||||
} = input;
|
||||
|
||||
for (;;) {
|
||||
if (pos >= length) {
|
||||
errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
||||
out += input.slice(chunkStart, pos);
|
||||
break;
|
||||
}
|
||||
|
||||
const ch = input.charCodeAt(pos);
|
||||
|
||||
if (isStringEnd(type, ch, input, pos)) {
|
||||
out += input.slice(chunkStart, pos);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ch === 92) {
|
||||
out += input.slice(chunkStart, pos);
|
||||
const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors);
|
||||
|
||||
if (res.ch === null && !firstInvalidLoc) {
|
||||
firstInvalidLoc = {
|
||||
pos,
|
||||
lineStart,
|
||||
curLine
|
||||
};
|
||||
} else {
|
||||
out += res.ch;
|
||||
}
|
||||
|
||||
({
|
||||
pos,
|
||||
lineStart,
|
||||
curLine
|
||||
} = res);
|
||||
chunkStart = pos;
|
||||
} else if (ch === 8232 || ch === 8233) {
|
||||
++pos;
|
||||
++curLine;
|
||||
lineStart = pos;
|
||||
} else if (ch === 10 || ch === 13) {
|
||||
if (type === "template") {
|
||||
out += input.slice(chunkStart, pos) + "\n";
|
||||
++pos;
|
||||
|
||||
if (ch === 13 && input.charCodeAt(pos) === 10) {
|
||||
++pos;
|
||||
}
|
||||
|
||||
++curLine;
|
||||
chunkStart = lineStart = pos;
|
||||
} else {
|
||||
errors.unterminated(initialPos, initialLineStart, initialCurLine);
|
||||
}
|
||||
} else {
|
||||
++pos;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
pos,
|
||||
str: out,
|
||||
firstInvalidLoc,
|
||||
lineStart,
|
||||
curLine,
|
||||
containsInvalid: !!firstInvalidLoc
|
||||
};
|
||||
}
|
||||
|
||||
function isStringEnd(type, ch, input, pos) {
|
||||
if (type === "template") {
|
||||
return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123;
|
||||
}
|
||||
|
||||
return ch === (type === "double" ? 34 : 39);
|
||||
}
|
||||
|
||||
function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
|
||||
const throwOnInvalid = !inTemplate;
|
||||
pos++;
|
||||
|
||||
const res = ch => ({
|
||||
pos,
|
||||
ch,
|
||||
lineStart,
|
||||
curLine
|
||||
});
|
||||
|
||||
const ch = input.charCodeAt(pos++);
|
||||
|
||||
switch (ch) {
|
||||
case 110:
|
||||
return res("\n");
|
||||
|
||||
case 114:
|
||||
return res("\r");
|
||||
|
||||
case 120:
|
||||
{
|
||||
let code;
|
||||
({
|
||||
code,
|
||||
pos
|
||||
} = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors));
|
||||
return res(code === null ? null : String.fromCharCode(code));
|
||||
}
|
||||
|
||||
case 117:
|
||||
{
|
||||
let code;
|
||||
({
|
||||
code,
|
||||
pos
|
||||
} = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors));
|
||||
return res(code === null ? null : String.fromCodePoint(code));
|
||||
}
|
||||
|
||||
case 116:
|
||||
return res("\t");
|
||||
|
||||
case 98:
|
||||
return res("\b");
|
||||
|
||||
case 118:
|
||||
return res("\u000b");
|
||||
|
||||
case 102:
|
||||
return res("\f");
|
||||
|
||||
case 13:
|
||||
if (input.charCodeAt(pos) === 10) {
|
||||
++pos;
|
||||
}
|
||||
|
||||
case 10:
|
||||
lineStart = pos;
|
||||
++curLine;
|
||||
|
||||
case 8232:
|
||||
case 8233:
|
||||
return res("");
|
||||
|
||||
case 56:
|
||||
case 57:
|
||||
if (inTemplate) {
|
||||
return res(null);
|
||||
} else {
|
||||
errors.strictNumericEscape(pos - 1, lineStart, curLine);
|
||||
}
|
||||
|
||||
default:
|
||||
if (ch >= 48 && ch <= 55) {
|
||||
const startPos = pos - 1;
|
||||
const match = input.slice(startPos, pos + 2).match(/^[0-7]+/);
|
||||
let octalStr = match[0];
|
||||
let octal = parseInt(octalStr, 8);
|
||||
|
||||
if (octal > 255) {
|
||||
octalStr = octalStr.slice(0, -1);
|
||||
octal = parseInt(octalStr, 8);
|
||||
}
|
||||
|
||||
pos += octalStr.length - 1;
|
||||
const next = input.charCodeAt(pos);
|
||||
|
||||
if (octalStr !== "0" || next === 56 || next === 57) {
|
||||
if (inTemplate) {
|
||||
return res(null);
|
||||
} else {
|
||||
errors.strictNumericEscape(startPos, lineStart, curLine);
|
||||
}
|
||||
}
|
||||
|
||||
return res(String.fromCharCode(octal));
|
||||
}
|
||||
|
||||
return res(String.fromCharCode(ch));
|
||||
}
|
||||
}
|
||||
|
||||
function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) {
|
||||
const initialPos = pos;
|
||||
let n;
|
||||
({
|
||||
n,
|
||||
pos
|
||||
} = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid));
|
||||
|
||||
if (n === null) {
|
||||
if (throwOnInvalid) {
|
||||
errors.invalidEscapeSequence(initialPos, lineStart, curLine);
|
||||
} else {
|
||||
pos = initialPos - 1;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
code: n,
|
||||
pos
|
||||
};
|
||||
}
|
||||
|
||||
function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) {
|
||||
const start = pos;
|
||||
const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
|
||||
const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
|
||||
let invalid = false;
|
||||
let total = 0;
|
||||
|
||||
for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
|
||||
const code = input.charCodeAt(pos);
|
||||
let val;
|
||||
|
||||
if (code === 95 && allowNumSeparator !== "bail") {
|
||||
const prev = input.charCodeAt(pos - 1);
|
||||
const next = input.charCodeAt(pos + 1);
|
||||
|
||||
if (!allowNumSeparator) {
|
||||
if (bailOnError) return {
|
||||
n: null,
|
||||
pos
|
||||
};
|
||||
errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);
|
||||
} else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) {
|
||||
if (bailOnError) return {
|
||||
n: null,
|
||||
pos
|
||||
};
|
||||
errors.unexpectedNumericSeparator(pos, lineStart, curLine);
|
||||
}
|
||||
|
||||
++pos;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (code >= 97) {
|
||||
val = code - 97 + 10;
|
||||
} else if (code >= 65) {
|
||||
val = code - 65 + 10;
|
||||
} else if (_isDigit(code)) {
|
||||
val = code - 48;
|
||||
} else {
|
||||
val = Infinity;
|
||||
}
|
||||
|
||||
if (val >= radix) {
|
||||
if (val <= 9 && bailOnError) {
|
||||
return {
|
||||
n: null,
|
||||
pos
|
||||
};
|
||||
} else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) {
|
||||
val = 0;
|
||||
} else if (forceLen) {
|
||||
val = 0;
|
||||
invalid = true;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
++pos;
|
||||
total = total * radix + val;
|
||||
}
|
||||
|
||||
if (pos === start || len != null && pos - start !== len || invalid) {
|
||||
return {
|
||||
n: null,
|
||||
pos
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
n: total,
|
||||
pos
|
||||
};
|
||||
}
|
||||
|
||||
function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
|
||||
const ch = input.charCodeAt(pos);
|
||||
let code;
|
||||
|
||||
if (ch === 123) {
|
||||
++pos;
|
||||
({
|
||||
code,
|
||||
pos
|
||||
} = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors));
|
||||
++pos;
|
||||
|
||||
if (code !== null && code > 0x10ffff) {
|
||||
if (throwOnInvalid) {
|
||||
errors.invalidCodePoint(pos, lineStart, curLine);
|
||||
} else {
|
||||
return {
|
||||
code: null,
|
||||
pos
|
||||
};
|
||||
}
|
||||
}
|
||||
} else {
|
||||
({
|
||||
code,
|
||||
pos
|
||||
} = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors));
|
||||
}
|
||||
|
||||
return {
|
||||
code,
|
||||
pos
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@babel/helper-string-parser/lib/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/helper-string-parser/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
28
node_modules/@babel/helper-string-parser/package.json
generated
vendored
Normal file
28
node_modules/@babel/helper-string-parser/package.json
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@babel/helper-string-parser",
|
||||
"version": "7.19.4",
|
||||
"description": "A utility package to parse strings",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-string-parser"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helper-string-parser",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"devDependencies": {
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"exports": {
|
||||
".": "./lib/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
22
node_modules/@babel/helper-validator-identifier/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/helper-validator-identifier/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/helper-validator-identifier/README.md
generated
vendored
Normal file
19
node_modules/@babel/helper-validator-identifier/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/helper-validator-identifier
|
||||
|
||||
> Validate identifier/keywords name
|
||||
|
||||
See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-validator-identifier
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-validator-identifier
|
||||
```
|
86
node_modules/@babel/helper-validator-identifier/lib/identifier.js
generated
vendored
Normal file
86
node_modules/@babel/helper-validator-identifier/lib/identifier.js
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isIdentifierChar = isIdentifierChar;
|
||||
exports.isIdentifierName = isIdentifierName;
|
||||
exports.isIdentifierStart = isIdentifierStart;
|
||||
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
||||
let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
|
||||
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
||||
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
||||
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
||||
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191];
|
||||
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
||||
|
||||
function isInAstralSet(code, set) {
|
||||
let pos = 0x10000;
|
||||
|
||||
for (let i = 0, length = set.length; i < length; i += 2) {
|
||||
pos += set[i];
|
||||
if (pos > code) return false;
|
||||
pos += set[i + 1];
|
||||
if (pos >= code) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isIdentifierStart(code) {
|
||||
if (code < 65) return code === 36;
|
||||
if (code <= 90) return true;
|
||||
if (code < 97) return code === 95;
|
||||
if (code <= 122) return true;
|
||||
|
||||
if (code <= 0xffff) {
|
||||
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
|
||||
}
|
||||
|
||||
return isInAstralSet(code, astralIdentifierStartCodes);
|
||||
}
|
||||
|
||||
function isIdentifierChar(code) {
|
||||
if (code < 48) return code === 36;
|
||||
if (code < 58) return true;
|
||||
if (code < 65) return false;
|
||||
if (code <= 90) return true;
|
||||
if (code < 97) return code === 95;
|
||||
if (code <= 122) return true;
|
||||
|
||||
if (code <= 0xffff) {
|
||||
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
|
||||
}
|
||||
|
||||
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
|
||||
}
|
||||
|
||||
function isIdentifierName(name) {
|
||||
let isFirst = true;
|
||||
|
||||
for (let i = 0; i < name.length; i++) {
|
||||
let cp = name.charCodeAt(i);
|
||||
|
||||
if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
|
||||
const trail = name.charCodeAt(++i);
|
||||
|
||||
if ((trail & 0xfc00) === 0xdc00) {
|
||||
cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
|
||||
}
|
||||
}
|
||||
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
|
||||
if (!isIdentifierStart(cp)) {
|
||||
return false;
|
||||
}
|
||||
} else if (!isIdentifierChar(cp)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return !isFirst;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=identifier.js.map
|
1
node_modules/@babel/helper-validator-identifier/lib/identifier.js.map
generated
vendored
Normal file
1
node_modules/@babel/helper-validator-identifier/lib/identifier.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
59
node_modules/@babel/helper-validator-identifier/lib/index.js
generated
vendored
Normal file
59
node_modules/@babel/helper-validator-identifier/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "isIdentifierChar", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _identifier.isIdentifierChar;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isIdentifierName", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _identifier.isIdentifierName;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isIdentifierStart", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _identifier.isIdentifierStart;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isKeyword", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isKeyword;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isStrictBindOnlyReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictBindReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isStrictBindReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _keyword.isStrictReservedWord;
|
||||
}
|
||||
});
|
||||
|
||||
var _identifier = require("./identifier");
|
||||
|
||||
var _keyword = require("./keyword");
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@babel/helper-validator-identifier/lib/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/helper-validator-identifier/lib/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":[],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAKA"}
|
40
node_modules/@babel/helper-validator-identifier/lib/keyword.js
generated
vendored
Normal file
40
node_modules/@babel/helper-validator-identifier/lib/keyword.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isKeyword = isKeyword;
|
||||
exports.isReservedWord = isReservedWord;
|
||||
exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
|
||||
exports.isStrictBindReservedWord = isStrictBindReservedWord;
|
||||
exports.isStrictReservedWord = isStrictReservedWord;
|
||||
const reservedWords = {
|
||||
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
|
||||
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
||||
strictBind: ["eval", "arguments"]
|
||||
};
|
||||
const keywords = new Set(reservedWords.keyword);
|
||||
const reservedWordsStrictSet = new Set(reservedWords.strict);
|
||||
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
||||
|
||||
function isReservedWord(word, inModule) {
|
||||
return inModule && word === "await" || word === "enum";
|
||||
}
|
||||
|
||||
function isStrictReservedWord(word, inModule) {
|
||||
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
||||
}
|
||||
|
||||
function isStrictBindOnlyReservedWord(word) {
|
||||
return reservedWordsStrictBindSet.has(word);
|
||||
}
|
||||
|
||||
function isStrictBindReservedWord(word, inModule) {
|
||||
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
||||
}
|
||||
|
||||
function isKeyword(word) {
|
||||
return keywords.has(word);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=keyword.js.map
|
1
node_modules/@babel/helper-validator-identifier/lib/keyword.js.map
generated
vendored
Normal file
1
node_modules/@babel/helper-validator-identifier/lib/keyword.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["reservedWords","keyword","strict","strictBind","keywords","Set","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword"],"sources":["../src/keyword.ts"],"sourcesContent":["const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,aAAa,GAAG;EACpBC,OAAO,EAAE,CACP,OADO,EAEP,MAFO,EAGP,OAHO,EAIP,UAJO,EAKP,UALO,EAMP,SANO,EAOP,IAPO,EAQP,MARO,EASP,SATO,EAUP,KAVO,EAWP,UAXO,EAYP,IAZO,EAaP,QAbO,EAcP,QAdO,EAeP,OAfO,EAgBP,KAhBO,EAiBP,KAjBO,EAkBP,OAlBO,EAmBP,OAnBO,EAoBP,MApBO,EAqBP,KArBO,EAsBP,MAtBO,EAuBP,OAvBO,EAwBP,OAxBO,EAyBP,SAzBO,EA0BP,QA1BO,EA2BP,QA3BO,EA4BP,MA5BO,EA6BP,MA7BO,EA8BP,OA9BO,EA+BP,IA/BO,EAgCP,YAhCO,EAiCP,QAjCO,EAkCP,MAlCO,EAmCP,QAnCO,CADW;EAsCpBC,MAAM,EAAE,CACN,YADM,EAEN,WAFM,EAGN,KAHM,EAIN,SAJM,EAKN,SALM,EAMN,WANM,EAON,QAPM,EAQN,QARM,EASN,OATM,CAtCY;EAiDpBC,UAAU,EAAE,CAAC,MAAD,EAAS,WAAT;AAjDQ,CAAtB;AAmDA,MAAMC,QAAQ,GAAG,IAAIC,GAAJ,CAAQL,aAAa,CAACC,OAAtB,CAAjB;AACA,MAAMK,sBAAsB,GAAG,IAAID,GAAJ,CAAQL,aAAa,CAACE,MAAtB,CAA/B;AACA,MAAMK,0BAA0B,GAAG,IAAIF,GAAJ,CAAQL,aAAa,CAACG,UAAtB,CAAnC;;AAKO,SAASK,cAAT,CAAwBC,IAAxB,EAAsCC,QAAtC,EAAkE;EACvE,OAAQA,QAAQ,IAAID,IAAI,KAAK,OAAtB,IAAkCA,IAAI,KAAK,MAAlD;AACD;;AAOM,SAASE,oBAAT,CAA8BF,IAA9B,EAA4CC,QAA5C,EAAwE;EAC7E,OAAOF,cAAc,CAACC,IAAD,EAAOC,QAAP,CAAd,IAAkCJ,sBAAsB,CAACM,GAAvB,CAA2BH,IAA3B,CAAzC;AACD;;AAMM,SAASI,4BAAT,CAAsCJ,IAAtC,EAA6D;EAClE,OAAOF,0BAA0B,CAACK,GAA3B,CAA+BH,IAA/B,CAAP;AACD;;AAOM,SAASK,wBAAT,CACLL,IADK,EAELC,QAFK,EAGI;EACT,OACEC,oBAAoB,CAACF,IAAD,EAAOC,QAAP,CAApB,IAAwCG,4BAA4B,CAACJ,IAAD,CADtE;AAGD;;AAEM,SAASM,SAAT,CAAmBN,IAAnB,EAA0C;EAC/C,OAAOL,QAAQ,CAACQ,GAAT,CAAaH,IAAb,CAAP;AACD"}
|
28
node_modules/@babel/helper-validator-identifier/package.json
generated
vendored
Normal file
28
node_modules/@babel/helper-validator-identifier/package.json
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@babel/helper-validator-identifier",
|
||||
"version": "7.19.1",
|
||||
"description": "Validate identifier/keywords name",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-validator-identifier"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"exports": {
|
||||
".": "./lib/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@unicode/unicode-15.0.0": "^1.3.1",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"type": "commonjs"
|
||||
}
|
75
node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js
generated
vendored
Normal file
75
node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
|
||||
// Always use the latest available version of Unicode!
|
||||
// https://tc39.github.io/ecma262/#sec-conformance
|
||||
const version = "15.0.0";
|
||||
|
||||
const start = require("@unicode/unicode-" +
|
||||
version +
|
||||
"/Binary_Property/ID_Start/code-points.js").filter(function (ch) {
|
||||
return ch > 0x7f;
|
||||
});
|
||||
let last = -1;
|
||||
const cont = [0x200c, 0x200d].concat(
|
||||
require("@unicode/unicode-" +
|
||||
version +
|
||||
"/Binary_Property/ID_Continue/code-points.js").filter(function (ch) {
|
||||
return ch > 0x7f && search(start, ch, last + 1) == -1;
|
||||
})
|
||||
);
|
||||
|
||||
function search(arr, ch, starting) {
|
||||
for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) {
|
||||
if (arr[i] === ch) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function pad(str, width) {
|
||||
while (str.length < width) str = "0" + str;
|
||||
return str;
|
||||
}
|
||||
|
||||
function esc(code) {
|
||||
const hex = code.toString(16);
|
||||
if (hex.length <= 2) return "\\x" + pad(hex, 2);
|
||||
else return "\\u" + pad(hex, 4);
|
||||
}
|
||||
|
||||
function generate(chars) {
|
||||
const astral = [];
|
||||
let re = "";
|
||||
for (let i = 0, at = 0x10000; i < chars.length; i++) {
|
||||
const from = chars[i];
|
||||
let to = from;
|
||||
while (i < chars.length - 1 && chars[i + 1] == to + 1) {
|
||||
i++;
|
||||
to++;
|
||||
}
|
||||
if (to <= 0xffff) {
|
||||
if (from == to) re += esc(from);
|
||||
else if (from + 1 == to) re += esc(from) + esc(to);
|
||||
else re += esc(from) + "-" + esc(to);
|
||||
} else {
|
||||
astral.push(from - at, to - from);
|
||||
at = to;
|
||||
}
|
||||
}
|
||||
return { nonASCII: re, astral: astral };
|
||||
}
|
||||
|
||||
const startData = generate(start);
|
||||
const contData = generate(cont);
|
||||
|
||||
console.log("/* prettier-ignore */");
|
||||
console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";');
|
||||
console.log("/* prettier-ignore */");
|
||||
console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";');
|
||||
console.log("/* prettier-ignore */");
|
||||
console.log(
|
||||
"const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"
|
||||
);
|
||||
console.log("/* prettier-ignore */");
|
||||
console.log(
|
||||
"const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"
|
||||
);
|
1073
node_modules/@babel/parser/CHANGELOG.md
generated
vendored
Normal file
1073
node_modules/@babel/parser/CHANGELOG.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
19
node_modules/@babel/parser/LICENSE
generated
vendored
Normal file
19
node_modules/@babel/parser/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (C) 2012-2014 by various contributors (see AUTHORS)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
19
node_modules/@babel/parser/README.md
generated
vendored
Normal file
19
node_modules/@babel/parser/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/parser
|
||||
|
||||
> A JavaScript parser
|
||||
|
||||
See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/parser
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/parser --dev
|
||||
```
|
15
node_modules/@babel/parser/bin/babel-parser.js
generated
vendored
Normal file
15
node_modules/@babel/parser/bin/babel-parser.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint no-var: 0 */
|
||||
|
||||
var parser = require("..");
|
||||
var fs = require("fs");
|
||||
|
||||
var filename = process.argv[2];
|
||||
if (!filename) {
|
||||
console.error("no filename specified");
|
||||
} else {
|
||||
var file = fs.readFileSync(filename, "utf8");
|
||||
var ast = parser.parse(file);
|
||||
|
||||
console.log(JSON.stringify(ast, null, " "));
|
||||
}
|
5
node_modules/@babel/parser/index.cjs
generated
vendored
Normal file
5
node_modules/@babel/parser/index.cjs
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
try {
|
||||
module.exports = require("./lib/index.cjs");
|
||||
} catch {
|
||||
module.exports = require("./lib/index.js");
|
||||
}
|
14827
node_modules/@babel/parser/lib/index.js
generated
vendored
Normal file
14827
node_modules/@babel/parser/lib/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@babel/parser/lib/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/parser/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
node_modules/@babel/parser/package.json
generated
vendored
Normal file
46
node_modules/@babel/parser/package.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.20.5",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-parser",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
"javascript",
|
||||
"parser",
|
||||
"tc39",
|
||||
"ecmascript",
|
||||
"@babel/parser"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-parser"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"types": "./typings/babel-parser.d.ts",
|
||||
"files": [
|
||||
"bin",
|
||||
"lib",
|
||||
"typings/babel-parser.d.ts",
|
||||
"index.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.18.6",
|
||||
"@babel/helper-check-duplicate-nodes": "^7.18.6",
|
||||
"@babel/helper-fixtures": "^7.19.4",
|
||||
"@babel/helper-string-parser": "^7.19.4",
|
||||
"@babel/helper-validator-identifier": "^7.19.1",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"bin": "./bin/babel-parser.js",
|
||||
"type": "commonjs"
|
||||
}
|
227
node_modules/@babel/parser/typings/babel-parser.d.ts
generated
vendored
Normal file
227
node_modules/@babel/parser/typings/babel-parser.d.ts
generated
vendored
Normal file
@ -0,0 +1,227 @@
|
||||
// This file is auto-generated! Do not modify it directly.
|
||||
/* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */
|
||||
import * as _babel_types from '@babel/types';
|
||||
|
||||
type Plugin =
|
||||
| "asyncDoExpressions"
|
||||
| "asyncGenerators"
|
||||
| "bigInt"
|
||||
| "classPrivateMethods"
|
||||
| "classPrivateProperties"
|
||||
| "classProperties"
|
||||
| "classStaticBlock" // Enabled by default
|
||||
| "decimal"
|
||||
| "decorators-legacy"
|
||||
| "decoratorAutoAccessors"
|
||||
| "destructuringPrivate"
|
||||
| "doExpressions"
|
||||
| "dynamicImport"
|
||||
| "explicitResourceManagement"
|
||||
| "exportDefaultFrom"
|
||||
| "exportNamespaceFrom" // deprecated
|
||||
| "flow"
|
||||
| "flowComments"
|
||||
| "functionBind"
|
||||
| "functionSent"
|
||||
| "importMeta"
|
||||
| "jsx"
|
||||
| "logicalAssignment"
|
||||
| "importAssertions"
|
||||
| "importReflection"
|
||||
| "moduleBlocks"
|
||||
| "moduleStringNames"
|
||||
| "nullishCoalescingOperator"
|
||||
| "numericSeparator"
|
||||
| "objectRestSpread"
|
||||
| "optionalCatchBinding"
|
||||
| "optionalChaining"
|
||||
| "partialApplication"
|
||||
| "placeholders"
|
||||
| "privateIn" // Enabled by default
|
||||
| "regexpUnicodeSets"
|
||||
| "throwExpressions"
|
||||
| "topLevelAwait"
|
||||
| "v8intrinsic"
|
||||
| ParserPluginWithOptions[0];
|
||||
|
||||
type ParserPluginWithOptions =
|
||||
| ["decorators", DecoratorsPluginOptions]
|
||||
| ["estree", { classFeatures?: boolean }]
|
||||
// @deprecated
|
||||
| ["moduleAttributes", { version: "may-2020" }]
|
||||
| ["pipelineOperator", PipelineOperatorPluginOptions]
|
||||
| ["recordAndTuple", RecordAndTuplePluginOptions]
|
||||
| ["flow", FlowPluginOptions]
|
||||
| ["typescript", TypeScriptPluginOptions];
|
||||
|
||||
type PluginConfig = Plugin | ParserPluginWithOptions;
|
||||
|
||||
interface DecoratorsPluginOptions {
|
||||
decoratorsBeforeExport?: boolean;
|
||||
allowCallParenthesized?: boolean;
|
||||
}
|
||||
|
||||
interface PipelineOperatorPluginOptions {
|
||||
proposal: "minimal" | "fsharp" | "hack" | "smart";
|
||||
topicToken?: "%" | "#" | "@@" | "^^" | "^";
|
||||
}
|
||||
|
||||
interface RecordAndTuplePluginOptions {
|
||||
syntaxType: "bar" | "hash";
|
||||
}
|
||||
|
||||
interface FlowPluginOptions {
|
||||
all?: boolean;
|
||||
enums?: boolean;
|
||||
}
|
||||
|
||||
interface TypeScriptPluginOptions {
|
||||
dts?: boolean;
|
||||
disallowAmbiguousJSXLike?: boolean;
|
||||
}
|
||||
|
||||
// Type definitions for @babel/parser
|
||||
// Project: https://github.com/babel/babel/tree/main/packages/babel-parser
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Avi Vahl <https://github.com/AviVahl>
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
/**
|
||||
* Parse the provided code as an entire ECMAScript program.
|
||||
*/
|
||||
declare function parse(
|
||||
input: string,
|
||||
options?: ParserOptions
|
||||
): ParseResult<_babel_types.File>;
|
||||
|
||||
/**
|
||||
* Parse the provided code as a single expression.
|
||||
*/
|
||||
declare function parseExpression(
|
||||
input: string,
|
||||
options?: ParserOptions
|
||||
): ParseResult<_babel_types.Expression>;
|
||||
|
||||
interface ParserOptions {
|
||||
/**
|
||||
* By default, import and export declarations can only appear at a program's top level.
|
||||
* Setting this option to true allows them anywhere where a statement is allowed.
|
||||
*/
|
||||
allowImportExportEverywhere?: boolean;
|
||||
|
||||
/**
|
||||
* By default, await use is not allowed outside of an async function.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowAwaitOutsideFunction?: boolean;
|
||||
|
||||
/**
|
||||
* By default, a return statement at the top level raises an error.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowReturnOutsideFunction?: boolean;
|
||||
|
||||
allowSuperOutsideMethod?: boolean;
|
||||
|
||||
/**
|
||||
* By default, exported identifiers must refer to a declared variable.
|
||||
* Set this to true to allow export statements to reference undeclared variables.
|
||||
*/
|
||||
allowUndeclaredExports?: boolean;
|
||||
|
||||
/**
|
||||
* By default, Babel attaches comments to adjacent AST nodes.
|
||||
* When this option is set to false, comments are not attached.
|
||||
* It can provide up to 30% performance improvement when the input code has many comments.
|
||||
* @babel/eslint-parser will set it for you.
|
||||
* It is not recommended to use attachComment: false with Babel transform,
|
||||
* as doing so removes all the comments in output code, and renders annotations such as
|
||||
* /* istanbul ignore next *\/ nonfunctional.
|
||||
*/
|
||||
attachComment?: boolean;
|
||||
|
||||
/**
|
||||
* By default, Babel always throws an error when it finds some invalid code.
|
||||
* When this option is set to true, it will store the parsing error and
|
||||
* try to continue parsing the invalid input file.
|
||||
*/
|
||||
errorRecovery?: boolean;
|
||||
|
||||
/**
|
||||
* Indicate the mode the code should be parsed in.
|
||||
* Can be one of "script", "module", or "unambiguous". Defaults to "script".
|
||||
* "unambiguous" will make @babel/parser attempt to guess, based on the presence
|
||||
* of ES6 import or export statements.
|
||||
* Files with ES6 imports and exports are considered "module" and are otherwise "script".
|
||||
*/
|
||||
sourceType?: "script" | "module" | "unambiguous";
|
||||
|
||||
/**
|
||||
* Correlate output AST nodes with their source filename.
|
||||
* Useful when generating code and source maps from the ASTs of multiple input files.
|
||||
*/
|
||||
sourceFilename?: string;
|
||||
|
||||
/**
|
||||
* By default, the first line of code parsed is treated as line 1.
|
||||
* You can provide a line number to alternatively start with.
|
||||
* Useful for integration with other source tools.
|
||||
*/
|
||||
startLine?: number;
|
||||
|
||||
/**
|
||||
* By default, the parsed code is treated as if it starts from line 1, column 0.
|
||||
* You can provide a column number to alternatively start with.
|
||||
* Useful for integration with other source tools.
|
||||
*/
|
||||
startColumn?: number;
|
||||
|
||||
/**
|
||||
* Array containing the plugins that you want to enable.
|
||||
*/
|
||||
plugins?: ParserPlugin[];
|
||||
|
||||
/**
|
||||
* Should the parser work in strict mode.
|
||||
* Defaults to true if sourceType === 'module'. Otherwise, false.
|
||||
*/
|
||||
strictMode?: boolean;
|
||||
|
||||
/**
|
||||
* Adds a ranges property to each node: [node.start, node.end]
|
||||
*/
|
||||
ranges?: boolean;
|
||||
|
||||
/**
|
||||
* Adds all parsed tokens to a tokens property on the File node.
|
||||
*/
|
||||
tokens?: boolean;
|
||||
|
||||
/**
|
||||
* By default, the parser adds information about parentheses by setting
|
||||
* `extra.parenthesized` to `true` as needed.
|
||||
* When this option is `true` the parser creates `ParenthesizedExpression`
|
||||
* AST nodes instead of using the `extra` property.
|
||||
*/
|
||||
createParenthesizedExpressions?: boolean;
|
||||
}
|
||||
|
||||
type ParserPlugin = PluginConfig;
|
||||
|
||||
|
||||
declare const tokTypes: {
|
||||
// todo(flow->ts) real token type
|
||||
[name: string]: any;
|
||||
};
|
||||
|
||||
interface ParseError {
|
||||
code: string;
|
||||
reasonCode: string;
|
||||
}
|
||||
|
||||
type ParseResult<Result> = Result & {
|
||||
errors: ParseError[];
|
||||
};
|
||||
|
||||
export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };
|
22
node_modules/@babel/types/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/types/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/types/README.md
generated
vendored
Normal file
19
node_modules/@babel/types/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/types
|
||||
|
||||
> Babel Types is a Lodash-esque utility library for AST nodes
|
||||
|
||||
See our website [@babel/types](https://babeljs.io/docs/en/babel-types) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/types
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/types --dev
|
||||
```
|
16
node_modules/@babel/types/lib/asserts/assertNode.js
generated
vendored
Normal file
16
node_modules/@babel/types/lib/asserts/assertNode.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = assertNode;
|
||||
var _isNode = require("../validators/isNode");
|
||||
function assertNode(node) {
|
||||
if (!(0, _isNode.default)(node)) {
|
||||
var _node$type;
|
||||
const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
|
||||
throw new TypeError(`Not a valid node of type "${type}"`);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=assertNode.js.map
|
1
node_modules/@babel/types/lib/asserts/assertNode.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/asserts/assertNode.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["assertNode","node","isNode","type","JSON","stringify","TypeError"],"sources":["../../src/asserts/assertNode.ts"],"sourcesContent":["import isNode from \"../validators/isNode\";\nimport type * as t from \"..\";\n\nexport default function assertNode(node?: any): asserts node is t.Node {\n if (!isNode(node)) {\n const type = node?.type ?? JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${type as any}\"`);\n }\n}\n"],"mappings":";;;;;;AAAA;AAGe,SAASA,UAAU,CAACC,IAAU,EAA0B;EACrE,IAAI,CAAC,IAAAC,eAAM,EAACD,IAAI,CAAC,EAAE;IAAA;IACjB,MAAME,IAAI,iBAAGF,IAAI,oBAAJA,IAAI,CAAEE,IAAI,yBAAIC,IAAI,CAACC,SAAS,CAACJ,IAAI,CAAC;IAC/C,MAAM,IAAIK,SAAS,CAAE,6BAA4BH,IAAY,GAAE,CAAC;EAClE;AACF"}
|
1226
node_modules/@babel/types/lib/asserts/generated/index.js
generated
vendored
Normal file
1226
node_modules/@babel/types/lib/asserts/generated/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@babel/types/lib/asserts/generated/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/asserts/generated/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/@babel/types/lib/ast-types/generated/index.js
generated
vendored
Normal file
3
node_modules/@babel/types/lib/ast-types/generated/index.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@babel/types/lib/ast-types/generated/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/ast-types/generated/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
18
node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
generated
vendored
Normal file
18
node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createFlowUnionType;
|
||||
var _generated = require("../generated");
|
||||
var _removeTypeDuplicates = require("../../modifications/flow/removeTypeDuplicates");
|
||||
function createFlowUnionType(types) {
|
||||
const flattened = (0, _removeTypeDuplicates.default)(types);
|
||||
if (flattened.length === 1) {
|
||||
return flattened[0];
|
||||
} else {
|
||||
return (0, _generated.unionTypeAnnotation)(flattened);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=createFlowUnionType.js.map
|
1
node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["createFlowUnionType","types","flattened","removeTypeDuplicates","length","unionTypeAnnotation"],"sources":["../../../src/builders/flow/createFlowUnionType.ts"],"sourcesContent":["import { unionTypeAnnotation } from \"../generated\";\nimport removeTypeDuplicates from \"../../modifications/flow/removeTypeDuplicates\";\nimport type * as t from \"../..\";\n\n/**\n * Takes an array of `types` and flattens them, removing duplicates and\n * returns a `UnionTypeAnnotation` node containing them.\n */\nexport default function createFlowUnionType<T extends t.FlowType>(\n types: [T] | Array<T>,\n): T | t.UnionTypeAnnotation {\n const flattened = removeTypeDuplicates(types);\n\n if (flattened.length === 1) {\n return flattened[0] as T;\n } else {\n return unionTypeAnnotation(flattened);\n }\n}\n"],"mappings":";;;;;;AAAA;AACA;AAOe,SAASA,mBAAmB,CACzCC,KAAqB,EACM;EAC3B,MAAMC,SAAS,GAAG,IAAAC,6BAAoB,EAACF,KAAK,CAAC;EAE7C,IAAIC,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAOF,SAAS,CAAC,CAAC,CAAC;EACrB,CAAC,MAAM;IACL,OAAO,IAAAG,8BAAmB,EAACH,SAAS,CAAC;EACvC;AACF"}
|
32
node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
generated
vendored
Normal file
32
node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _generated = require("../generated");
|
||||
var _default = createTypeAnnotationBasedOnTypeof;
|
||||
exports.default = _default;
|
||||
function createTypeAnnotationBasedOnTypeof(type) {
|
||||
switch (type) {
|
||||
case "string":
|
||||
return (0, _generated.stringTypeAnnotation)();
|
||||
case "number":
|
||||
return (0, _generated.numberTypeAnnotation)();
|
||||
case "undefined":
|
||||
return (0, _generated.voidTypeAnnotation)();
|
||||
case "boolean":
|
||||
return (0, _generated.booleanTypeAnnotation)();
|
||||
case "function":
|
||||
return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Function"));
|
||||
case "object":
|
||||
return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Object"));
|
||||
case "symbol":
|
||||
return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Symbol"));
|
||||
case "bigint":
|
||||
return (0, _generated.anyTypeAnnotation)();
|
||||
}
|
||||
throw new Error("Invalid typeof value: " + type);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=createTypeAnnotationBasedOnTypeof.js.map
|
1
node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["createTypeAnnotationBasedOnTypeof","type","stringTypeAnnotation","numberTypeAnnotation","voidTypeAnnotation","booleanTypeAnnotation","genericTypeAnnotation","identifier","anyTypeAnnotation","Error"],"sources":["../../../src/builders/flow/createTypeAnnotationBasedOnTypeof.ts"],"sourcesContent":["import {\n anyTypeAnnotation,\n stringTypeAnnotation,\n numberTypeAnnotation,\n voidTypeAnnotation,\n booleanTypeAnnotation,\n genericTypeAnnotation,\n identifier,\n} from \"../generated\";\nimport type * as t from \"../..\";\n\nexport default createTypeAnnotationBasedOnTypeof as {\n (type: \"string\"): t.StringTypeAnnotation;\n (type: \"number\"): t.NumberTypeAnnotation;\n (type: \"undefined\"): t.VoidTypeAnnotation;\n (type: \"boolean\"): t.BooleanTypeAnnotation;\n (type: \"function\"): t.GenericTypeAnnotation;\n (type: \"object\"): t.GenericTypeAnnotation;\n (type: \"symbol\"): t.GenericTypeAnnotation;\n (type: \"bigint\"): t.AnyTypeAnnotation;\n};\n\n/**\n * Create a type annotation based on typeof expression.\n */\nfunction createTypeAnnotationBasedOnTypeof(type: string): t.FlowType {\n switch (type) {\n case \"string\":\n return stringTypeAnnotation();\n case \"number\":\n return numberTypeAnnotation();\n case \"undefined\":\n return voidTypeAnnotation();\n case \"boolean\":\n return booleanTypeAnnotation();\n case \"function\":\n return genericTypeAnnotation(identifier(\"Function\"));\n case \"object\":\n return genericTypeAnnotation(identifier(\"Object\"));\n case \"symbol\":\n return genericTypeAnnotation(identifier(\"Symbol\"));\n case \"bigint\":\n // todo: use BigInt annotation when Flow supports BigInt\n // https://github.com/facebook/flow/issues/6639\n return anyTypeAnnotation();\n }\n throw new Error(\"Invalid typeof value: \" + type);\n}\n"],"mappings":";;;;;;AAAA;AAQsB,eAGPA,iCAAiC;AAAA;AAchD,SAASA,iCAAiC,CAACC,IAAY,EAAc;EACnE,QAAQA,IAAI;IACV,KAAK,QAAQ;MACX,OAAO,IAAAC,+BAAoB,GAAE;IAC/B,KAAK,QAAQ;MACX,OAAO,IAAAC,+BAAoB,GAAE;IAC/B,KAAK,WAAW;MACd,OAAO,IAAAC,6BAAkB,GAAE;IAC7B,KAAK,SAAS;MACZ,OAAO,IAAAC,gCAAqB,GAAE;IAChC,KAAK,UAAU;MACb,OAAO,IAAAC,gCAAqB,EAAC,IAAAC,qBAAU,EAAC,UAAU,CAAC,CAAC;IACtD,KAAK,QAAQ;MACX,OAAO,IAAAD,gCAAqB,EAAC,IAAAC,qBAAU,EAAC,QAAQ,CAAC,CAAC;IACpD,KAAK,QAAQ;MACX,OAAO,IAAAD,gCAAqB,EAAC,IAAAC,qBAAU,EAAC,QAAQ,CAAC,CAAC;IACpD,KAAK,QAAQ;MAGX,OAAO,IAAAC,4BAAiB,GAAE;EAAC;EAE/B,MAAM,IAAIC,KAAK,CAAC,wBAAwB,GAAGR,IAAI,CAAC;AAClD"}
|
1985
node_modules/@babel/types/lib/builders/generated/index.js
generated
vendored
Normal file
1985
node_modules/@babel/types/lib/builders/generated/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@babel/types/lib/builders/generated/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/builders/generated/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1526
node_modules/@babel/types/lib/builders/generated/uppercase.js
generated
vendored
Normal file
1526
node_modules/@babel/types/lib/builders/generated/uppercase.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@babel/types/lib/builders/generated/uppercase.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/builders/generated/uppercase.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
24
node_modules/@babel/types/lib/builders/react/buildChildren.js
generated
vendored
Normal file
24
node_modules/@babel/types/lib/builders/react/buildChildren.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = buildChildren;
|
||||
var _generated = require("../../validators/generated");
|
||||
var _cleanJSXElementLiteralChild = require("../../utils/react/cleanJSXElementLiteralChild");
|
||||
function buildChildren(node) {
|
||||
const elements = [];
|
||||
for (let i = 0; i < node.children.length; i++) {
|
||||
let child = node.children[i];
|
||||
if ((0, _generated.isJSXText)(child)) {
|
||||
(0, _cleanJSXElementLiteralChild.default)(child, elements);
|
||||
continue;
|
||||
}
|
||||
if ((0, _generated.isJSXExpressionContainer)(child)) child = child.expression;
|
||||
if ((0, _generated.isJSXEmptyExpression)(child)) continue;
|
||||
elements.push(child);
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=buildChildren.js.map
|
1
node_modules/@babel/types/lib/builders/react/buildChildren.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/builders/react/buildChildren.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["buildChildren","node","elements","i","children","length","child","isJSXText","cleanJSXElementLiteralChild","isJSXExpressionContainer","expression","isJSXEmptyExpression","push"],"sources":["../../../src/builders/react/buildChildren.ts"],"sourcesContent":["import {\n isJSXText,\n isJSXExpressionContainer,\n isJSXEmptyExpression,\n} from \"../../validators/generated\";\nimport cleanJSXElementLiteralChild from \"../../utils/react/cleanJSXElementLiteralChild\";\nimport type * as t from \"../..\";\n\ntype ReturnedChild =\n | t.JSXSpreadChild\n | t.JSXElement\n | t.JSXFragment\n | t.Expression;\n\nexport default function buildChildren(\n node: t.JSXElement | t.JSXFragment,\n): ReturnedChild[] {\n const elements = [];\n\n for (let i = 0; i < node.children.length; i++) {\n let child: any = node.children[i];\n\n if (isJSXText(child)) {\n cleanJSXElementLiteralChild(child, elements);\n continue;\n }\n\n if (isJSXExpressionContainer(child)) child = child.expression;\n if (isJSXEmptyExpression(child)) continue;\n\n elements.push(child);\n }\n\n return elements;\n}\n"],"mappings":";;;;;;AAAA;AAKA;AASe,SAASA,aAAa,CACnCC,IAAkC,EACjB;EACjB,MAAMC,QAAQ,GAAG,EAAE;EAEnB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,IAAI,CAACG,QAAQ,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;IAC7C,IAAIG,KAAU,GAAGL,IAAI,CAACG,QAAQ,CAACD,CAAC,CAAC;IAEjC,IAAI,IAAAI,oBAAS,EAACD,KAAK,CAAC,EAAE;MACpB,IAAAE,oCAA2B,EAACF,KAAK,EAAEJ,QAAQ,CAAC;MAC5C;IACF;IAEA,IAAI,IAAAO,mCAAwB,EAACH,KAAK,CAAC,EAAEA,KAAK,GAAGA,KAAK,CAACI,UAAU;IAC7D,IAAI,IAAAC,+BAAoB,EAACL,KAAK,CAAC,EAAE;IAEjCJ,QAAQ,CAACU,IAAI,CAACN,KAAK,CAAC;EACtB;EAEA,OAAOJ,QAAQ;AACjB"}
|
22
node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js
generated
vendored
Normal file
22
node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createTSUnionType;
|
||||
var _generated = require("../generated");
|
||||
var _removeTypeDuplicates = require("../../modifications/typescript/removeTypeDuplicates");
|
||||
var _index = require("../../validators/generated/index");
|
||||
function createTSUnionType(typeAnnotations) {
|
||||
const types = typeAnnotations.map(type => {
|
||||
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
||||
});
|
||||
const flattened = (0, _removeTypeDuplicates.default)(types);
|
||||
if (flattened.length === 1) {
|
||||
return flattened[0];
|
||||
} else {
|
||||
return (0, _generated.tsUnionType)(flattened);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=createTSUnionType.js.map
|
1
node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["createTSUnionType","typeAnnotations","types","map","type","isTSTypeAnnotation","typeAnnotation","flattened","removeTypeDuplicates","length","tsUnionType"],"sources":["../../../src/builders/typescript/createTSUnionType.ts"],"sourcesContent":["import { tsUnionType } from \"../generated\";\nimport removeTypeDuplicates from \"../../modifications/typescript/removeTypeDuplicates\";\nimport { isTSTypeAnnotation } from \"../../validators/generated/index\";\nimport type * as t from \"../..\";\n\n/**\n * Takes an array of `types` and flattens them, removing duplicates and\n * returns a `UnionTypeAnnotation` node containing them.\n */\nexport default function createTSUnionType(\n typeAnnotations: Array<t.TSTypeAnnotation | t.TSType>,\n): t.TSType {\n const types = typeAnnotations.map(type => {\n return isTSTypeAnnotation(type) ? type.typeAnnotation : type;\n });\n const flattened = removeTypeDuplicates(types);\n\n if (flattened.length === 1) {\n return flattened[0];\n } else {\n return tsUnionType(flattened);\n }\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAOe,SAASA,iBAAiB,CACvCC,eAAqD,EAC3C;EACV,MAAMC,KAAK,GAAGD,eAAe,CAACE,GAAG,CAACC,IAAI,IAAI;IACxC,OAAO,IAAAC,yBAAkB,EAACD,IAAI,CAAC,GAAGA,IAAI,CAACE,cAAc,GAAGF,IAAI;EAC9D,CAAC,CAAC;EACF,MAAMG,SAAS,GAAG,IAAAC,6BAAoB,EAACN,KAAK,CAAC;EAE7C,IAAIK,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAOF,SAAS,CAAC,CAAC,CAAC;EACrB,CAAC,MAAM;IACL,OAAO,IAAAG,sBAAW,EAACH,SAAS,CAAC;EAC/B;AACF"}
|
17
node_modules/@babel/types/lib/builders/validateNode.js
generated
vendored
Normal file
17
node_modules/@babel/types/lib/builders/validateNode.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = validateNode;
|
||||
var _validate = require("../validators/validate");
|
||||
var _ = require("..");
|
||||
function validateNode(node) {
|
||||
const keys = _.BUILDER_KEYS[node.type];
|
||||
for (const key of keys) {
|
||||
(0, _validate.default)(node, key, node[key]);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=validateNode.js.map
|
1
node_modules/@babel/types/lib/builders/validateNode.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/builders/validateNode.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["validateNode","node","keys","BUILDER_KEYS","type","key","validate"],"sources":["../../src/builders/validateNode.ts"],"sourcesContent":["import validate from \"../validators/validate\";\nimport type * as t from \"..\";\nimport { BUILDER_KEYS } from \"..\";\n\nexport default function validateNode<N extends t.Node>(node: N) {\n // todo: because keys not in BUILDER_KEYS are not validated - this actually allows invalid nodes in some cases\n const keys = BUILDER_KEYS[node.type] as (keyof N & string)[];\n for (const key of keys) {\n validate(node, key, node[key]);\n }\n return node;\n}\n"],"mappings":";;;;;;AAAA;AAEA;AAEe,SAASA,YAAY,CAAmBC,IAAO,EAAE;EAE9D,MAAMC,IAAI,GAAGC,cAAY,CAACF,IAAI,CAACG,IAAI,CAAyB;EAC5D,KAAK,MAAMC,GAAG,IAAIH,IAAI,EAAE;IACtB,IAAAI,iBAAQ,EAACL,IAAI,EAAEI,GAAG,EAAEJ,IAAI,CAACI,GAAG,CAAC,CAAC;EAChC;EACA,OAAOJ,IAAI;AACb"}
|
12
node_modules/@babel/types/lib/clone/clone.js
generated
vendored
Normal file
12
node_modules/@babel/types/lib/clone/clone.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = clone;
|
||||
var _cloneNode = require("./cloneNode");
|
||||
function clone(node) {
|
||||
return (0, _cloneNode.default)(node, false);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=clone.js.map
|
1
node_modules/@babel/types/lib/clone/clone.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/clone/clone.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["clone","node","cloneNode"],"sources":["../../src/clone/clone.ts"],"sourcesContent":["import cloneNode from \"./cloneNode\";\nimport type * as t from \"..\";\n\n/**\n * Create a shallow clone of a `node`, including only\n * properties belonging to the node.\n * @deprecated Use t.cloneNode instead.\n */\nexport default function clone<T extends t.Node>(node: T): T {\n return cloneNode(node, /* deep */ false);\n}\n"],"mappings":";;;;;;AAAA;AAQe,SAASA,KAAK,CAAmBC,IAAO,EAAK;EAC1D,OAAO,IAAAC,kBAAS,EAACD,IAAI,EAAa,KAAK,CAAC;AAC1C"}
|
12
node_modules/@babel/types/lib/clone/cloneDeep.js
generated
vendored
Normal file
12
node_modules/@babel/types/lib/clone/cloneDeep.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cloneDeep;
|
||||
var _cloneNode = require("./cloneNode");
|
||||
function cloneDeep(node) {
|
||||
return (0, _cloneNode.default)(node);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=cloneDeep.js.map
|
1
node_modules/@babel/types/lib/clone/cloneDeep.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/clone/cloneDeep.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["cloneDeep","node","cloneNode"],"sources":["../../src/clone/cloneDeep.ts"],"sourcesContent":["import cloneNode from \"./cloneNode\";\nimport type * as t from \"..\";\n\n/**\n * Create a deep clone of a `node` and all of it's child nodes\n * including only properties belonging to the node.\n * @deprecated Use t.cloneNode instead.\n */\nexport default function cloneDeep<T extends t.Node>(node: T): T {\n return cloneNode(node);\n}\n"],"mappings":";;;;;;AAAA;AAQe,SAASA,SAAS,CAAmBC,IAAO,EAAK;EAC9D,OAAO,IAAAC,kBAAS,EAACD,IAAI,CAAC;AACxB"}
|
12
node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js
generated
vendored
Normal file
12
node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cloneDeepWithoutLoc;
|
||||
var _cloneNode = require("./cloneNode");
|
||||
function cloneDeepWithoutLoc(node) {
|
||||
return (0, _cloneNode.default)(node, true, true);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=cloneDeepWithoutLoc.js.map
|
1
node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map
generated
vendored
Normal file
1
node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["cloneDeepWithoutLoc","node","cloneNode"],"sources":["../../src/clone/cloneDeepWithoutLoc.ts"],"sourcesContent":["import cloneNode from \"./cloneNode\";\nimport type * as t from \"..\";\n/**\n * Create a deep clone of a `node` and all of it's child nodes\n * including only properties belonging to the node.\n * excluding `_private` and location properties.\n */\nexport default function cloneDeepWithoutLoc<T extends t.Node>(node: T): T {\n return cloneNode(node, /* deep */ true, /* withoutLoc */ true);\n}\n"],"mappings":";;;;;;AAAA;AAOe,SAASA,mBAAmB,CAAmBC,IAAO,EAAK;EACxE,OAAO,IAAAC,kBAAS,EAACD,IAAI,EAAa,IAAI,EAAmB,IAAI,CAAC;AAChE"}
|
104
node_modules/@babel/types/lib/clone/cloneNode.js
generated
vendored
Normal file
104
node_modules/@babel/types/lib/clone/cloneNode.js
generated
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cloneNode;
|
||||
var _definitions = require("../definitions");
|
||||
var _generated = require("../validators/generated");
|
||||
const has = Function.call.bind(Object.prototype.hasOwnProperty);
|
||||
function cloneIfNode(obj, deep, withoutLoc, commentsCache) {
|
||||
if (obj && typeof obj.type === "string") {
|
||||
return cloneNodeInternal(obj, deep, withoutLoc, commentsCache);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
function cloneIfNodeOrArray(obj, deep, withoutLoc, commentsCache) {
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.map(node => cloneIfNode(node, deep, withoutLoc, commentsCache));
|
||||
}
|
||||
return cloneIfNode(obj, deep, withoutLoc, commentsCache);
|
||||
}
|
||||
|
||||
function cloneNode(node, deep = true, withoutLoc = false) {
|
||||
return cloneNodeInternal(node, deep, withoutLoc, new Map());
|
||||
}
|
||||
function cloneNodeInternal(node, deep = true, withoutLoc = false, commentsCache) {
|
||||
if (!node) return node;
|
||||
const {
|
||||
type
|
||||
} = node;
|
||||
const newNode = {
|
||||
type: node.type
|
||||
};
|
||||
|
||||
if ((0, _generated.isIdentifier)(node)) {
|
||||
newNode.name = node.name;
|
||||
if (has(node, "optional") && typeof node.optional === "boolean") {
|
||||
newNode.optional = node.optional;
|
||||
}
|
||||
if (has(node, "typeAnnotation")) {
|
||||
newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc, commentsCache) : node.typeAnnotation;
|
||||
}
|
||||
} else if (!has(_definitions.NODE_FIELDS, type)) {
|
||||
throw new Error(`Unknown node type: "${type}"`);
|
||||
} else {
|
||||
for (const field of Object.keys(_definitions.NODE_FIELDS[type])) {
|
||||
if (has(node, field)) {
|
||||
if (deep) {
|
||||
newNode[field] = (0, _generated.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc, commentsCache) : cloneIfNodeOrArray(
|
||||
node[field], true, withoutLoc, commentsCache);
|
||||
} else {
|
||||
newNode[field] =
|
||||
node[field];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (has(node, "loc")) {
|
||||
if (withoutLoc) {
|
||||
newNode.loc = null;
|
||||
} else {
|
||||
newNode.loc = node.loc;
|
||||
}
|
||||
}
|
||||
if (has(node, "leadingComments")) {
|
||||
newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc, commentsCache);
|
||||
}
|
||||
if (has(node, "innerComments")) {
|
||||
newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc, commentsCache);
|
||||
}
|
||||
if (has(node, "trailingComments")) {
|
||||
newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc, commentsCache);
|
||||
}
|
||||
if (has(node, "extra")) {
|
||||
newNode.extra = Object.assign({}, node.extra);
|
||||
}
|
||||
return newNode;
|
||||
}
|
||||
function maybeCloneComments(comments, deep, withoutLoc, commentsCache) {
|
||||
if (!comments || !deep) {
|
||||
return comments;
|
||||
}
|
||||
return comments.map(comment => {
|
||||
const cache = commentsCache.get(comment);
|
||||
if (cache) return cache;
|
||||
const {
|
||||
type,
|
||||
value,
|
||||
loc
|
||||
} = comment;
|
||||
const ret = {
|
||||
type,
|
||||
value,
|
||||
loc
|
||||
};
|
||||
if (withoutLoc) {
|
||||
ret.loc = null;
|
||||
}
|
||||
commentsCache.set(comment, ret);
|
||||
return ret;
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=cloneNode.js.map
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user