mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-30 09:45:10 +01:00
Moved over to lsio base image
This commit is contained in:
1
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/.bin/parser
generated
vendored
Symbolic link
1
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/.bin/parser
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../@babel/parser/bin/babel-parser.js
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/code-frame/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/code-frame/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/code-frame/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/code-frame/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/code-frame
|
||||
|
||||
> Generate errors that contain a code frame that point to source locations.
|
||||
|
||||
See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/code-frame
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/code-frame --dev
|
||||
```
|
||||
167
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/code-frame/lib/index.js
generated
vendored
Normal file
167
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/code-frame/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.codeFrameColumns = codeFrameColumns;
|
||||
exports.default = _default;
|
||||
|
||||
var _highlight = _interopRequireWildcard(require("@babel/highlight"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
let deprecationWarningShown = false;
|
||||
|
||||
function getDefs(chalk) {
|
||||
return {
|
||||
gutter: chalk.grey,
|
||||
marker: chalk.red.bold,
|
||||
message: chalk.red.bold
|
||||
};
|
||||
}
|
||||
|
||||
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||
|
||||
function getMarkerLines(loc, source, opts) {
|
||||
const startLoc = Object.assign({
|
||||
column: 0,
|
||||
line: -1
|
||||
}, loc.start);
|
||||
const endLoc = Object.assign(Object.assign({}, startLoc), loc.end);
|
||||
const {
|
||||
linesAbove = 2,
|
||||
linesBelow = 3
|
||||
} = opts || {};
|
||||
const startLine = startLoc.line;
|
||||
const startColumn = startLoc.column;
|
||||
const endLine = endLoc.line;
|
||||
const endColumn = endLoc.column;
|
||||
let start = Math.max(startLine - (linesAbove + 1), 0);
|
||||
let end = Math.min(source.length, endLine + linesBelow);
|
||||
|
||||
if (startLine === -1) {
|
||||
start = 0;
|
||||
}
|
||||
|
||||
if (endLine === -1) {
|
||||
end = source.length;
|
||||
}
|
||||
|
||||
const lineDiff = endLine - startLine;
|
||||
const markerLines = {};
|
||||
|
||||
if (lineDiff) {
|
||||
for (let i = 0; i <= lineDiff; i++) {
|
||||
const lineNumber = i + startLine;
|
||||
|
||||
if (!startColumn) {
|
||||
markerLines[lineNumber] = true;
|
||||
} else if (i === 0) {
|
||||
const sourceLength = source[lineNumber - 1].length;
|
||||
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
||||
} else if (i === lineDiff) {
|
||||
markerLines[lineNumber] = [0, endColumn];
|
||||
} else {
|
||||
const sourceLength = source[lineNumber - i].length;
|
||||
markerLines[lineNumber] = [0, sourceLength];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (startColumn === endColumn) {
|
||||
if (startColumn) {
|
||||
markerLines[startLine] = [startColumn, 0];
|
||||
} else {
|
||||
markerLines[startLine] = true;
|
||||
}
|
||||
} else {
|
||||
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
};
|
||||
}
|
||||
|
||||
function codeFrameColumns(rawLines, loc, opts = {}) {
|
||||
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
||||
const chalk = (0, _highlight.getChalk)(opts);
|
||||
const defs = getDefs(chalk);
|
||||
|
||||
const maybeHighlight = (chalkFn, string) => {
|
||||
return highlighted ? chalkFn(string) : string;
|
||||
};
|
||||
|
||||
const lines = rawLines.split(NEWLINE);
|
||||
const {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
} = getMarkerLines(loc, lines, opts);
|
||||
const hasColumns = loc.start && typeof loc.start.column === "number";
|
||||
const numberMaxWidth = String(end).length;
|
||||
const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
|
||||
let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
|
||||
const number = start + 1 + index;
|
||||
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
||||
const gutter = ` ${paddedNumber} | `;
|
||||
const hasMarker = markerLines[number];
|
||||
const lastMarkerLine = !markerLines[number + 1];
|
||||
|
||||
if (hasMarker) {
|
||||
let markerLine = "";
|
||||
|
||||
if (Array.isArray(hasMarker)) {
|
||||
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
||||
const numberOfMarkers = hasMarker[1] || 1;
|
||||
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
|
||||
|
||||
if (lastMarkerLine && opts.message) {
|
||||
markerLine += " " + maybeHighlight(defs.message, opts.message);
|
||||
}
|
||||
}
|
||||
|
||||
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
|
||||
} else {
|
||||
return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;
|
||||
}
|
||||
}).join("\n");
|
||||
|
||||
if (opts.message && !hasColumns) {
|
||||
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
||||
}
|
||||
|
||||
if (highlighted) {
|
||||
return chalk.reset(frame);
|
||||
} else {
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
|
||||
function _default(rawLines, lineNumber, colNumber, opts = {}) {
|
||||
if (!deprecationWarningShown) {
|
||||
deprecationWarningShown = true;
|
||||
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
||||
|
||||
if (process.emitWarning) {
|
||||
process.emitWarning(message, "DeprecationWarning");
|
||||
} else {
|
||||
const deprecationError = new Error(message);
|
||||
deprecationError.name = "DeprecationWarning";
|
||||
console.warn(new Error(message));
|
||||
}
|
||||
}
|
||||
|
||||
colNumber = Math.max(colNumber, 0);
|
||||
const location = {
|
||||
start: {
|
||||
column: colNumber,
|
||||
line: lineNumber
|
||||
}
|
||||
};
|
||||
return codeFrameColumns(rawLines, location, opts);
|
||||
}
|
||||
61
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/code-frame/package.json
generated
vendored
Normal file
61
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/code-frame/package.json
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/code-frame@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/code-frame@7.10.1",
|
||||
"_id": "@babel/code-frame@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/code-frame",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/code-frame@7.10.1",
|
||||
"name": "@babel/code-frame",
|
||||
"escapedName": "@babel%2fcode-frame",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin/@babel/template",
|
||||
"/@babel/helper-create-class-features-plugin/@babel/traverse"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"author": {
|
||||
"name": "Sebastian McKenzie",
|
||||
"email": "sebmck@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/highlight": "^7.10.1"
|
||||
},
|
||||
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||
"devDependencies": {
|
||||
"chalk": "^2.0.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
},
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/code-frame",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-code-frame"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/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/next/babel-generator.html) 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
|
||||
```
|
||||
244
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/buffer.js
generated
vendored
Normal file
244
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/buffer.js
generated
vendored
Normal file
@@ -0,0 +1,244 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
const SPACES_RE = /^[ \t]+$/;
|
||||
|
||||
class Buffer {
|
||||
constructor(map) {
|
||||
this._map = null;
|
||||
this._buf = [];
|
||||
this._last = "";
|
||||
this._queue = [];
|
||||
this._position = {
|
||||
line: 1,
|
||||
column: 0
|
||||
};
|
||||
this._sourcePosition = {
|
||||
identifierName: null,
|
||||
line: null,
|
||||
column: null,
|
||||
filename: null
|
||||
};
|
||||
this._disallowedPop = null;
|
||||
this._map = map;
|
||||
}
|
||||
|
||||
get() {
|
||||
this._flush();
|
||||
|
||||
const map = this._map;
|
||||
const result = {
|
||||
code: this._buf.join("").trimRight(),
|
||||
map: null,
|
||||
rawMappings: map == null ? void 0 : map.getRawMappings()
|
||||
};
|
||||
|
||||
if (map) {
|
||||
Object.defineProperty(result, "map", {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
|
||||
get() {
|
||||
return this.map = map.get();
|
||||
},
|
||||
|
||||
set(value) {
|
||||
Object.defineProperty(this, "map", {
|
||||
value,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
append(str) {
|
||||
this._flush();
|
||||
|
||||
const {
|
||||
line,
|
||||
column,
|
||||
filename,
|
||||
identifierName,
|
||||
force
|
||||
} = this._sourcePosition;
|
||||
|
||||
this._append(str, line, column, identifierName, filename, force);
|
||||
}
|
||||
|
||||
queue(str) {
|
||||
if (str === "\n") {
|
||||
while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {
|
||||
this._queue.shift();
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
line,
|
||||
column,
|
||||
filename,
|
||||
identifierName,
|
||||
force
|
||||
} = this._sourcePosition;
|
||||
|
||||
this._queue.unshift([str, line, column, identifierName, filename, force]);
|
||||
}
|
||||
|
||||
_flush() {
|
||||
let item;
|
||||
|
||||
while (item = this._queue.pop()) this._append(...item);
|
||||
}
|
||||
|
||||
_append(str, line, column, identifierName, filename, force) {
|
||||
if (this._map && str[0] !== "\n") {
|
||||
this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force);
|
||||
}
|
||||
|
||||
this._buf.push(str);
|
||||
|
||||
this._last = str[str.length - 1];
|
||||
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
if (str[i] === "\n") {
|
||||
this._position.line++;
|
||||
this._position.column = 0;
|
||||
} else {
|
||||
this._position.column++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
removeTrailingNewline() {
|
||||
if (this._queue.length > 0 && this._queue[0][0] === "\n") {
|
||||
this._queue.shift();
|
||||
}
|
||||
}
|
||||
|
||||
removeLastSemicolon() {
|
||||
if (this._queue.length > 0 && this._queue[0][0] === ";") {
|
||||
this._queue.shift();
|
||||
}
|
||||
}
|
||||
|
||||
endsWith(suffix) {
|
||||
if (suffix.length === 1) {
|
||||
let last;
|
||||
|
||||
if (this._queue.length > 0) {
|
||||
const str = this._queue[0][0];
|
||||
last = str[str.length - 1];
|
||||
} else {
|
||||
last = this._last;
|
||||
}
|
||||
|
||||
return last === suffix;
|
||||
}
|
||||
|
||||
const end = this._last + this._queue.reduce((acc, item) => item[0] + acc, "");
|
||||
|
||||
if (suffix.length <= end.length) {
|
||||
return end.slice(-suffix.length) === suffix;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
hasContent() {
|
||||
return this._queue.length > 0 || !!this._last;
|
||||
}
|
||||
|
||||
exactSource(loc, cb) {
|
||||
this.source("start", loc, true);
|
||||
cb();
|
||||
this.source("end", loc);
|
||||
|
||||
this._disallowPop("start", loc);
|
||||
}
|
||||
|
||||
source(prop, loc, force) {
|
||||
if (prop && !loc) return;
|
||||
|
||||
this._normalizePosition(prop, loc, this._sourcePosition, force);
|
||||
}
|
||||
|
||||
withSource(prop, loc, cb) {
|
||||
if (!this._map) return cb();
|
||||
const originalLine = this._sourcePosition.line;
|
||||
const originalColumn = this._sourcePosition.column;
|
||||
const originalFilename = this._sourcePosition.filename;
|
||||
const originalIdentifierName = this._sourcePosition.identifierName;
|
||||
this.source(prop, loc);
|
||||
cb();
|
||||
|
||||
if ((!this._sourcePosition.force || this._sourcePosition.line !== originalLine || this._sourcePosition.column !== originalColumn || this._sourcePosition.filename !== originalFilename) && (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename)) {
|
||||
this._sourcePosition.line = originalLine;
|
||||
this._sourcePosition.column = originalColumn;
|
||||
this._sourcePosition.filename = originalFilename;
|
||||
this._sourcePosition.identifierName = originalIdentifierName;
|
||||
this._sourcePosition.force = false;
|
||||
this._disallowedPop = null;
|
||||
}
|
||||
}
|
||||
|
||||
_disallowPop(prop, loc) {
|
||||
if (prop && !loc) return;
|
||||
this._disallowedPop = this._normalizePosition(prop, loc);
|
||||
}
|
||||
|
||||
_normalizePosition(prop, loc, targetObj, force) {
|
||||
const pos = loc ? loc[prop] : null;
|
||||
|
||||
if (targetObj === undefined) {
|
||||
targetObj = {
|
||||
identifierName: null,
|
||||
line: null,
|
||||
column: null,
|
||||
filename: null,
|
||||
force: false
|
||||
};
|
||||
}
|
||||
|
||||
const origLine = targetObj.line;
|
||||
const origColumn = targetObj.column;
|
||||
const origFilename = targetObj.filename;
|
||||
targetObj.identifierName = prop === "start" && (loc == null ? void 0 : loc.identifierName) || null;
|
||||
targetObj.line = pos == null ? void 0 : pos.line;
|
||||
targetObj.column = pos == null ? void 0 : pos.column;
|
||||
targetObj.filename = loc == null ? void 0 : loc.filename;
|
||||
|
||||
if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) {
|
||||
targetObj.force = force;
|
||||
}
|
||||
|
||||
return targetObj;
|
||||
}
|
||||
|
||||
getCurrentColumn() {
|
||||
const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
|
||||
|
||||
const lastIndex = extra.lastIndexOf("\n");
|
||||
return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;
|
||||
}
|
||||
|
||||
getCurrentLine() {
|
||||
const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
|
||||
|
||||
let count = 0;
|
||||
|
||||
for (let i = 0; i < extra.length; i++) {
|
||||
if (extra[i] === "\n") count++;
|
||||
}
|
||||
|
||||
return this._position.line + count;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = Buffer;
|
||||
99
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/base.js
generated
vendored
Normal file
99
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/base.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.File = File;
|
||||
exports.Program = Program;
|
||||
exports.BlockStatement = BlockStatement;
|
||||
exports.Noop = Noop;
|
||||
exports.Directive = Directive;
|
||||
exports.DirectiveLiteral = DirectiveLiteral;
|
||||
exports.InterpreterDirective = InterpreterDirective;
|
||||
exports.Placeholder = Placeholder;
|
||||
|
||||
function File(node) {
|
||||
if (node.program) {
|
||||
this.print(node.program.interpreter, node);
|
||||
}
|
||||
|
||||
this.print(node.program, node);
|
||||
}
|
||||
|
||||
function Program(node) {
|
||||
this.printInnerComments(node, false);
|
||||
this.printSequence(node.directives, node);
|
||||
if (node.directives && node.directives.length) this.newline();
|
||||
this.printSequence(node.body, node);
|
||||
}
|
||||
|
||||
function BlockStatement(node) {
|
||||
var _node$directives;
|
||||
|
||||
this.token("{");
|
||||
this.printInnerComments(node);
|
||||
const hasDirectives = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
|
||||
|
||||
if (node.body.length || hasDirectives) {
|
||||
this.newline();
|
||||
this.printSequence(node.directives, node, {
|
||||
indent: true
|
||||
});
|
||||
if (hasDirectives) this.newline();
|
||||
this.printSequence(node.body, node, {
|
||||
indent: true
|
||||
});
|
||||
this.removeTrailingNewline();
|
||||
this.source("end", node.loc);
|
||||
if (!this.endsWith("\n")) this.newline();
|
||||
this.rightBrace();
|
||||
} else {
|
||||
this.source("end", node.loc);
|
||||
this.token("}");
|
||||
}
|
||||
}
|
||||
|
||||
function Noop() {}
|
||||
|
||||
function Directive(node) {
|
||||
this.print(node.value, node);
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
|
||||
const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
|
||||
|
||||
function DirectiveLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (raw != null) {
|
||||
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}\n`);
|
||||
}
|
||||
|
||||
function Placeholder(node) {
|
||||
this.token("%%");
|
||||
this.print(node.name);
|
||||
this.token("%%");
|
||||
|
||||
if (node.expectedNode === "Statement") {
|
||||
this.semicolon();
|
||||
}
|
||||
}
|
||||
151
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/classes.js
generated
vendored
Normal file
151
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/classes.js
generated
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration;
|
||||
exports.ClassBody = ClassBody;
|
||||
exports.ClassProperty = ClassProperty;
|
||||
exports.ClassPrivateProperty = ClassPrivateProperty;
|
||||
exports.ClassMethod = ClassMethod;
|
||||
exports.ClassPrivateMethod = ClassPrivateMethod;
|
||||
exports._classMethodHead = _classMethodHead;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function ClassDeclaration(node, parent) {
|
||||
if (!this.format.decoratorsBeforeExport || !t.isExportDefaultDeclaration(parent) && !t.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.token("{");
|
||||
this.printInnerComments(node);
|
||||
|
||||
if (node.body.length === 0) {
|
||||
this.token("}");
|
||||
} else {
|
||||
this.newline();
|
||||
this.indent();
|
||||
this.printSequence(node.body, node);
|
||||
this.dedent();
|
||||
if (!this.endsWith("\n")) this.newline();
|
||||
this.rightBrace();
|
||||
}
|
||||
}
|
||||
|
||||
function ClassProperty(node) {
|
||||
this.printJoin(node.decorators, node);
|
||||
this.tsPrintClassMemberModifiers(node, true);
|
||||
|
||||
if (node.computed) {
|
||||
this.token("[");
|
||||
this.print(node.key, node);
|
||||
this.token("]");
|
||||
} else {
|
||||
this._variance(node);
|
||||
|
||||
this.print(node.key, node);
|
||||
}
|
||||
|
||||
if (node.optional) {
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
if (node.definite) {
|
||||
this.token("!");
|
||||
}
|
||||
|
||||
this.print(node.typeAnnotation, node);
|
||||
|
||||
if (node.value) {
|
||||
this.space();
|
||||
this.token("=");
|
||||
this.space();
|
||||
this.print(node.value, node);
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function ClassPrivateProperty(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.token("=");
|
||||
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) {
|
||||
this.printJoin(node.decorators, node);
|
||||
this.tsPrintClassMemberModifiers(node, false);
|
||||
|
||||
this._methodHead(node);
|
||||
}
|
||||
292
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/expressions.js
generated
vendored
Normal file
292
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/expressions.js
generated
vendored
Normal file
@@ -0,0 +1,292 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.UnaryExpression = UnaryExpression;
|
||||
exports.DoExpression = DoExpression;
|
||||
exports.ParenthesizedExpression = ParenthesizedExpression;
|
||||
exports.UpdateExpression = UpdateExpression;
|
||||
exports.ConditionalExpression = ConditionalExpression;
|
||||
exports.NewExpression = NewExpression;
|
||||
exports.SequenceExpression = SequenceExpression;
|
||||
exports.ThisExpression = ThisExpression;
|
||||
exports.Super = Super;
|
||||
exports.Decorator = Decorator;
|
||||
exports.OptionalMemberExpression = OptionalMemberExpression;
|
||||
exports.OptionalCallExpression = OptionalCallExpression;
|
||||
exports.CallExpression = CallExpression;
|
||||
exports.Import = Import;
|
||||
exports.EmptyStatement = EmptyStatement;
|
||||
exports.ExpressionStatement = ExpressionStatement;
|
||||
exports.AssignmentPattern = AssignmentPattern;
|
||||
exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression;
|
||||
exports.BindExpression = BindExpression;
|
||||
exports.MemberExpression = MemberExpression;
|
||||
exports.MetaProperty = MetaProperty;
|
||||
exports.PrivateName = PrivateName;
|
||||
exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
|
||||
exports.AwaitExpression = exports.YieldExpression = void 0;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var n = _interopRequireWildcard(require("../node"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
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) {
|
||||
this.word("do");
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
|
||||
function ParenthesizedExpression(node) {
|
||||
this.token("(");
|
||||
this.print(node.expression, node);
|
||||
this.token(")");
|
||||
}
|
||||
|
||||
function UpdateExpression(node) {
|
||||
if (node.prefix) {
|
||||
this.token(node.operator);
|
||||
this.print(node.argument, node);
|
||||
} else {
|
||||
this.startTerminatorless(true);
|
||||
this.print(node.argument, node);
|
||||
this.endTerminatorless();
|
||||
this.token(node.operator);
|
||||
}
|
||||
}
|
||||
|
||||
function ConditionalExpression(node) {
|
||||
this.print(node.test, node);
|
||||
this.space();
|
||||
this.token("?");
|
||||
this.space();
|
||||
this.print(node.consequent, node);
|
||||
this.space();
|
||||
this.token(":");
|
||||
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 && !t.isCallExpression(parent, {
|
||||
callee: node
|
||||
}) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.print(node.typeArguments, node);
|
||||
this.print(node.typeParameters, node);
|
||||
|
||||
if (node.optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
|
||||
this.token("(");
|
||||
this.printList(node.arguments, node);
|
||||
this.token(")");
|
||||
}
|
||||
|
||||
function SequenceExpression(node) {
|
||||
this.printList(node.expressions, node);
|
||||
}
|
||||
|
||||
function ThisExpression() {
|
||||
this.word("this");
|
||||
}
|
||||
|
||||
function Super() {
|
||||
this.word("super");
|
||||
}
|
||||
|
||||
function Decorator(node) {
|
||||
this.token("@");
|
||||
this.print(node.expression, node);
|
||||
this.newline();
|
||||
}
|
||||
|
||||
function OptionalMemberExpression(node) {
|
||||
this.print(node.object, node);
|
||||
|
||||
if (!node.computed && t.isMemberExpression(node.property)) {
|
||||
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
||||
}
|
||||
|
||||
let computed = node.computed;
|
||||
|
||||
if (t.isLiteral(node.property) && typeof node.property.value === "number") {
|
||||
computed = true;
|
||||
}
|
||||
|
||||
if (node.optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
|
||||
if (computed) {
|
||||
this.token("[");
|
||||
this.print(node.property, node);
|
||||
this.token("]");
|
||||
} else {
|
||||
if (!node.optional) {
|
||||
this.token(".");
|
||||
}
|
||||
|
||||
this.print(node.property, node);
|
||||
}
|
||||
}
|
||||
|
||||
function OptionalCallExpression(node) {
|
||||
this.print(node.callee, node);
|
||||
this.print(node.typeArguments, node);
|
||||
this.print(node.typeParameters, node);
|
||||
|
||||
if (node.optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
|
||||
this.token("(");
|
||||
this.printList(node.arguments, node);
|
||||
this.token(")");
|
||||
}
|
||||
|
||||
function CallExpression(node) {
|
||||
this.print(node.callee, node);
|
||||
this.print(node.typeArguments, node);
|
||||
this.print(node.typeParameters, node);
|
||||
this.token("(");
|
||||
this.printList(node.arguments, node);
|
||||
this.token(")");
|
||||
}
|
||||
|
||||
function Import() {
|
||||
this.word("import");
|
||||
}
|
||||
|
||||
function buildYieldAwait(keyword) {
|
||||
return function (node) {
|
||||
this.word(keyword);
|
||||
|
||||
if (node.delegate) {
|
||||
this.token("*");
|
||||
}
|
||||
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
const terminatorState = this.startTerminatorless();
|
||||
this.print(node.argument, node);
|
||||
this.endTerminatorless(terminatorState);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const YieldExpression = buildYieldAwait("yield");
|
||||
exports.YieldExpression = YieldExpression;
|
||||
const AwaitExpression = buildYieldAwait("await");
|
||||
exports.AwaitExpression = AwaitExpression;
|
||||
|
||||
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.token("?");
|
||||
this.print(node.left.typeAnnotation, node);
|
||||
this.space();
|
||||
this.token("=");
|
||||
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.token("(");
|
||||
}
|
||||
|
||||
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.token(")");
|
||||
}
|
||||
}
|
||||
|
||||
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 && t.isMemberExpression(node.property)) {
|
||||
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
||||
}
|
||||
|
||||
let computed = node.computed;
|
||||
|
||||
if (t.isLiteral(node.property) && typeof node.property.value === "number") {
|
||||
computed = true;
|
||||
}
|
||||
|
||||
if (computed) {
|
||||
this.token("[");
|
||||
this.print(node.property, node);
|
||||
this.token("]");
|
||||
} else {
|
||||
this.token(".");
|
||||
this.print(node.property, node);
|
||||
}
|
||||
}
|
||||
|
||||
function MetaProperty(node) {
|
||||
this.print(node.meta, node);
|
||||
this.token(".");
|
||||
this.print(node.property, node);
|
||||
}
|
||||
|
||||
function PrivateName(node) {
|
||||
this.token("#");
|
||||
this.print(node.id, node);
|
||||
}
|
||||
|
||||
function V8IntrinsicIdentifier(node) {
|
||||
this.token("%");
|
||||
this.word(node.name);
|
||||
}
|
||||
753
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/flow.js
generated
vendored
Normal file
753
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/flow.js
generated
vendored
Normal file
@@ -0,0 +1,753 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.AnyTypeAnnotation = AnyTypeAnnotation;
|
||||
exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
|
||||
exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
|
||||
exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
|
||||
exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
|
||||
exports.DeclareClass = DeclareClass;
|
||||
exports.DeclareFunction = DeclareFunction;
|
||||
exports.InferredPredicate = InferredPredicate;
|
||||
exports.DeclaredPredicate = DeclaredPredicate;
|
||||
exports.DeclareInterface = DeclareInterface;
|
||||
exports.DeclareModule = DeclareModule;
|
||||
exports.DeclareModuleExports = DeclareModuleExports;
|
||||
exports.DeclareTypeAlias = DeclareTypeAlias;
|
||||
exports.DeclareOpaqueType = DeclareOpaqueType;
|
||||
exports.DeclareVariable = DeclareVariable;
|
||||
exports.DeclareExportDeclaration = DeclareExportDeclaration;
|
||||
exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
|
||||
exports.EnumDeclaration = EnumDeclaration;
|
||||
exports.EnumBooleanBody = EnumBooleanBody;
|
||||
exports.EnumNumberBody = EnumNumberBody;
|
||||
exports.EnumStringBody = EnumStringBody;
|
||||
exports.EnumSymbolBody = EnumSymbolBody;
|
||||
exports.EnumDefaultedMember = EnumDefaultedMember;
|
||||
exports.EnumBooleanMember = EnumBooleanMember;
|
||||
exports.EnumNumberMember = EnumNumberMember;
|
||||
exports.EnumStringMember = EnumStringMember;
|
||||
exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
|
||||
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
||||
exports.FunctionTypeParam = FunctionTypeParam;
|
||||
exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends;
|
||||
exports._interfaceish = _interfaceish;
|
||||
exports._variance = _variance;
|
||||
exports.InterfaceDeclaration = InterfaceDeclaration;
|
||||
exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
|
||||
exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
|
||||
exports.MixedTypeAnnotation = MixedTypeAnnotation;
|
||||
exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
|
||||
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
||||
exports.NumberTypeAnnotation = NumberTypeAnnotation;
|
||||
exports.StringTypeAnnotation = StringTypeAnnotation;
|
||||
exports.ThisTypeAnnotation = ThisTypeAnnotation;
|
||||
exports.TupleTypeAnnotation = TupleTypeAnnotation;
|
||||
exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
|
||||
exports.TypeAlias = TypeAlias;
|
||||
exports.TypeAnnotation = TypeAnnotation;
|
||||
exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation;
|
||||
exports.TypeParameter = TypeParameter;
|
||||
exports.OpaqueType = OpaqueType;
|
||||
exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
|
||||
exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
|
||||
exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
|
||||
exports.ObjectTypeIndexer = ObjectTypeIndexer;
|
||||
exports.ObjectTypeProperty = ObjectTypeProperty;
|
||||
exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
|
||||
exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
|
||||
exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
|
||||
exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
||||
exports.TypeCastExpression = TypeCastExpression;
|
||||
exports.Variance = Variance;
|
||||
exports.VoidTypeAnnotation = VoidTypeAnnotation;
|
||||
Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types2.NumericLiteral;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types2.StringLiteral;
|
||||
}
|
||||
});
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _modules = require("./modules");
|
||||
|
||||
var _types2 = require("./types");
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function AnyTypeAnnotation() {
|
||||
this.word("any");
|
||||
}
|
||||
|
||||
function ArrayTypeAnnotation(node) {
|
||||
this.print(node.elementType, node);
|
||||
this.token("[");
|
||||
this.token("]");
|
||||
}
|
||||
|
||||
function BooleanTypeAnnotation() {
|
||||
this.word("boolean");
|
||||
}
|
||||
|
||||
function BooleanLiteralTypeAnnotation(node) {
|
||||
this.word(node.value ? "true" : "false");
|
||||
}
|
||||
|
||||
function NullLiteralTypeAnnotation() {
|
||||
this.word("null");
|
||||
}
|
||||
|
||||
function DeclareClass(node, parent) {
|
||||
if (!t.isDeclareExportDeclaration(parent)) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.word("class");
|
||||
this.space();
|
||||
|
||||
this._interfaceish(node);
|
||||
}
|
||||
|
||||
function DeclareFunction(node, parent) {
|
||||
if (!t.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.token("%");
|
||||
this.word("checks");
|
||||
}
|
||||
|
||||
function DeclaredPredicate(node) {
|
||||
this.token("%");
|
||||
this.word("checks");
|
||||
this.token("(");
|
||||
this.print(node.value, node);
|
||||
this.token(")");
|
||||
}
|
||||
|
||||
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.token(".");
|
||||
this.word("exports");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function DeclareTypeAlias(node) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
this.TypeAlias(node);
|
||||
}
|
||||
|
||||
function DeclareOpaqueType(node, parent) {
|
||||
if (!t.isDeclareExportDeclaration(parent)) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.OpaqueType(node);
|
||||
}
|
||||
|
||||
function DeclareVariable(node, parent) {
|
||||
if (!t.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.apply(this, arguments);
|
||||
}
|
||||
|
||||
function DeclareExportAllDeclaration() {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
|
||||
_modules.ExportAllDeclaration.apply(this, arguments);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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.token(",");
|
||||
}
|
||||
|
||||
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 (!t.isStatement(declar)) this.semicolon();
|
||||
} else {
|
||||
this.token("{");
|
||||
|
||||
if (node.specifiers.length) {
|
||||
this.space();
|
||||
this.printList(node.specifiers, node);
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("}");
|
||||
|
||||
if (node.source) {
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
this.print(node.source, node);
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
}
|
||||
}
|
||||
|
||||
function ExistsTypeAnnotation() {
|
||||
this.token("*");
|
||||
}
|
||||
|
||||
function FunctionTypeAnnotation(node, parent) {
|
||||
this.print(node.typeParameters, node);
|
||||
this.token("(");
|
||||
this.printList(node.params, node);
|
||||
|
||||
if (node.rest) {
|
||||
if (node.params.length) {
|
||||
this.token(",");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("...");
|
||||
this.print(node.rest, node);
|
||||
}
|
||||
|
||||
this.token(")");
|
||||
|
||||
if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method) {
|
||||
this.token(":");
|
||||
} else {
|
||||
this.space();
|
||||
this.token("=>");
|
||||
}
|
||||
|
||||
this.space();
|
||||
this.print(node.returnType, node);
|
||||
}
|
||||
|
||||
function FunctionTypeParam(node) {
|
||||
this.print(node.name, node);
|
||||
if (node.optional) this.token("?");
|
||||
|
||||
if (node.name) {
|
||||
this.token(":");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function InterfaceExtends(node) {
|
||||
this.print(node.id, node);
|
||||
this.print(node.typeParameters, node);
|
||||
}
|
||||
|
||||
function _interfaceish(node) {
|
||||
this.print(node.id, node);
|
||||
this.print(node.typeParameters, node);
|
||||
|
||||
if (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.token("+");
|
||||
} else if (node.variance.kind === "minus") {
|
||||
this.token("-");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function InterfaceDeclaration(node) {
|
||||
this.word("interface");
|
||||
this.space();
|
||||
|
||||
this._interfaceish(node);
|
||||
}
|
||||
|
||||
function andSeparator() {
|
||||
this.space();
|
||||
this.token("&");
|
||||
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.token("?");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function NumberTypeAnnotation() {
|
||||
this.word("number");
|
||||
}
|
||||
|
||||
function StringTypeAnnotation() {
|
||||
this.word("string");
|
||||
}
|
||||
|
||||
function ThisTypeAnnotation() {
|
||||
this.word("this");
|
||||
}
|
||||
|
||||
function TupleTypeAnnotation(node) {
|
||||
this.token("[");
|
||||
this.printList(node.types, node);
|
||||
this.token("]");
|
||||
}
|
||||
|
||||
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.token("=");
|
||||
this.space();
|
||||
this.print(node.right, node);
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function TypeAnnotation(node) {
|
||||
this.token(":");
|
||||
this.space();
|
||||
if (node.optional) this.token("?");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function TypeParameterInstantiation(node) {
|
||||
this.token("<");
|
||||
this.printList(node.params, node, {});
|
||||
this.token(">");
|
||||
}
|
||||
|
||||
function TypeParameter(node) {
|
||||
this._variance(node);
|
||||
|
||||
this.word(node.name);
|
||||
|
||||
if (node.bound) {
|
||||
this.print(node.bound, node);
|
||||
}
|
||||
|
||||
if (node.default) {
|
||||
this.space();
|
||||
this.token("=");
|
||||
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.token(":");
|
||||
this.space();
|
||||
this.print(node.supertype, node);
|
||||
}
|
||||
|
||||
if (node.impltype) {
|
||||
this.space();
|
||||
this.token("=");
|
||||
this.space();
|
||||
this.print(node.impltype, node);
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function ObjectTypeAnnotation(node) {
|
||||
if (node.exact) {
|
||||
this.token("{|");
|
||||
} else {
|
||||
this.token("{");
|
||||
}
|
||||
|
||||
const props = node.properties.concat(node.callProperties || [], node.indexers || [], node.internalSlots || []);
|
||||
|
||||
if (props.length) {
|
||||
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.token(",");
|
||||
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.token("}");
|
||||
}
|
||||
}
|
||||
|
||||
function ObjectTypeInternalSlot(node) {
|
||||
if (node.static) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("[");
|
||||
this.token("[");
|
||||
this.print(node.id, node);
|
||||
this.token("]");
|
||||
this.token("]");
|
||||
if (node.optional) this.token("?");
|
||||
|
||||
if (!node.method) {
|
||||
this.token(":");
|
||||
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.token("[");
|
||||
|
||||
if (node.id) {
|
||||
this.print(node.id, node);
|
||||
this.token(":");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.print(node.key, node);
|
||||
this.token("]");
|
||||
this.token(":");
|
||||
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.token("?");
|
||||
|
||||
if (!node.method) {
|
||||
this.token(":");
|
||||
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.token(".");
|
||||
this.print(node.id, node);
|
||||
}
|
||||
|
||||
function SymbolTypeAnnotation() {
|
||||
this.word("symbol");
|
||||
}
|
||||
|
||||
function orSeparator() {
|
||||
this.space();
|
||||
this.token("|");
|
||||
this.space();
|
||||
}
|
||||
|
||||
function UnionTypeAnnotation(node) {
|
||||
this.printJoin(node.types, node, {
|
||||
separator: orSeparator
|
||||
});
|
||||
}
|
||||
|
||||
function TypeCastExpression(node) {
|
||||
this.token("(");
|
||||
this.print(node.expression, node);
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.token(")");
|
||||
}
|
||||
|
||||
function Variance(node) {
|
||||
if (node.kind === "plus") {
|
||||
this.token("+");
|
||||
} else {
|
||||
this.token("-");
|
||||
}
|
||||
}
|
||||
|
||||
function VoidTypeAnnotation() {
|
||||
this.word("void");
|
||||
}
|
||||
137
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/index.js
generated
vendored
Normal file
137
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/index.js
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
"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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _typescript[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
145
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/jsx.js
generated
vendored
Normal file
145
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/jsx.js
generated
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.JSXAttribute = JSXAttribute;
|
||||
exports.JSXIdentifier = JSXIdentifier;
|
||||
exports.JSXNamespacedName = JSXNamespacedName;
|
||||
exports.JSXMemberExpression = JSXMemberExpression;
|
||||
exports.JSXSpreadAttribute = JSXSpreadAttribute;
|
||||
exports.JSXExpressionContainer = JSXExpressionContainer;
|
||||
exports.JSXSpreadChild = JSXSpreadChild;
|
||||
exports.JSXText = JSXText;
|
||||
exports.JSXElement = JSXElement;
|
||||
exports.JSXOpeningElement = JSXOpeningElement;
|
||||
exports.JSXClosingElement = JSXClosingElement;
|
||||
exports.JSXEmptyExpression = JSXEmptyExpression;
|
||||
exports.JSXFragment = JSXFragment;
|
||||
exports.JSXOpeningFragment = JSXOpeningFragment;
|
||||
exports.JSXClosingFragment = JSXClosingFragment;
|
||||
|
||||
function JSXAttribute(node) {
|
||||
this.print(node.name, node);
|
||||
|
||||
if (node.value) {
|
||||
this.token("=");
|
||||
this.print(node.value, node);
|
||||
}
|
||||
}
|
||||
|
||||
function JSXIdentifier(node) {
|
||||
this.word(node.name);
|
||||
}
|
||||
|
||||
function JSXNamespacedName(node) {
|
||||
this.print(node.namespace, node);
|
||||
this.token(":");
|
||||
this.print(node.name, node);
|
||||
}
|
||||
|
||||
function JSXMemberExpression(node) {
|
||||
this.print(node.object, node);
|
||||
this.token(".");
|
||||
this.print(node.property, node);
|
||||
}
|
||||
|
||||
function JSXSpreadAttribute(node) {
|
||||
this.token("{");
|
||||
this.token("...");
|
||||
this.print(node.argument, node);
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
function JSXExpressionContainer(node) {
|
||||
this.token("{");
|
||||
this.print(node.expression, node);
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
function JSXSpreadChild(node) {
|
||||
this.token("{");
|
||||
this.token("...");
|
||||
this.print(node.expression, node);
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
function JSXText(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (raw != null) {
|
||||
this.token(raw);
|
||||
} else {
|
||||
this.token(node.value);
|
||||
}
|
||||
}
|
||||
|
||||
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.token("<");
|
||||
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.token(">");
|
||||
}
|
||||
}
|
||||
|
||||
function JSXClosingElement(node) {
|
||||
this.token("</");
|
||||
this.print(node.name, node);
|
||||
this.token(">");
|
||||
}
|
||||
|
||||
function JSXEmptyExpression(node) {
|
||||
this.printInnerComments(node);
|
||||
}
|
||||
|
||||
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.token("<");
|
||||
this.token(">");
|
||||
}
|
||||
|
||||
function JSXClosingFragment() {
|
||||
this.token("</");
|
||||
this.token(">");
|
||||
}
|
||||
161
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/methods.js
generated
vendored
Normal file
161
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/methods.js
generated
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports._params = _params;
|
||||
exports._parameters = _parameters;
|
||||
exports._param = _param;
|
||||
exports._methodHead = _methodHead;
|
||||
exports._predicate = _predicate;
|
||||
exports._functionHead = _functionHead;
|
||||
exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression;
|
||||
exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _params(node) {
|
||||
this.print(node.typeParameters, node);
|
||||
this.token("(");
|
||||
|
||||
this._parameters(node.params, node);
|
||||
|
||||
this.token(")");
|
||||
this.print(node.returnType, node);
|
||||
}
|
||||
|
||||
function _parameters(parameters, parent) {
|
||||
for (let i = 0; i < parameters.length; i++) {
|
||||
this._param(parameters[i], parent);
|
||||
|
||||
if (i < parameters.length - 1) {
|
||||
this.token(",");
|
||||
this.space();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _param(parameter, parent) {
|
||||
this.printJoin(parameter.decorators, parameter);
|
||||
this.print(parameter, parent);
|
||||
if (parameter.optional) this.token("?");
|
||||
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");
|
||||
this.space();
|
||||
}
|
||||
|
||||
if (kind === "method" || kind === "init") {
|
||||
if (node.generator) {
|
||||
this.token("*");
|
||||
}
|
||||
}
|
||||
|
||||
if (node.computed) {
|
||||
this.token("[");
|
||||
this.print(key, node);
|
||||
this.token("]");
|
||||
} else {
|
||||
this.print(key, node);
|
||||
}
|
||||
|
||||
if (node.optional) {
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
this._params(node);
|
||||
}
|
||||
|
||||
function _predicate(node) {
|
||||
if (node.predicate) {
|
||||
if (!node.returnType) {
|
||||
this.token(":");
|
||||
}
|
||||
|
||||
this.space();
|
||||
this.print(node.predicate, node);
|
||||
}
|
||||
}
|
||||
|
||||
function _functionHead(node) {
|
||||
if (node.async) {
|
||||
this.word("async");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.word("function");
|
||||
if (node.generator) this.token("*");
|
||||
this.space();
|
||||
|
||||
if (node.id) {
|
||||
this.print(node.id, node);
|
||||
}
|
||||
|
||||
this._params(node);
|
||||
|
||||
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");
|
||||
this.space();
|
||||
}
|
||||
|
||||
const firstParam = node.params[0];
|
||||
|
||||
if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
|
||||
if (this.format.retainLines && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) {
|
||||
this.token("(");
|
||||
|
||||
if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {
|
||||
this.indent();
|
||||
this.print(firstParam, node);
|
||||
this.dedent();
|
||||
|
||||
this._catchUp("start", node.body.loc);
|
||||
} else {
|
||||
this.print(firstParam, node);
|
||||
}
|
||||
|
||||
this.token(")");
|
||||
} else {
|
||||
this.print(firstParam, node);
|
||||
}
|
||||
} else {
|
||||
this._params(node);
|
||||
}
|
||||
|
||||
this._predicate(node);
|
||||
|
||||
this.space();
|
||||
this.token("=>");
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
}
|
||||
|
||||
function hasTypes(node, param) {
|
||||
return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments;
|
||||
}
|
||||
208
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/modules.js
generated
vendored
Normal file
208
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/modules.js
generated
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ImportSpecifier = ImportSpecifier;
|
||||
exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
|
||||
exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
|
||||
exports.ExportSpecifier = ExportSpecifier;
|
||||
exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
|
||||
exports.ExportAllDeclaration = ExportAllDeclaration;
|
||||
exports.ExportNamedDeclaration = ExportNamedDeclaration;
|
||||
exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
|
||||
exports.ImportDeclaration = ImportDeclaration;
|
||||
exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
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) {
|
||||
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.token("*");
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.exported, node);
|
||||
}
|
||||
|
||||
function ExportAllDeclaration(node) {
|
||||
this.word("export");
|
||||
this.space();
|
||||
|
||||
if (node.exportKind === "type") {
|
||||
this.word("type");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("*");
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
this.print(node.source, node);
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function ExportNamedDeclaration(node) {
|
||||
if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {
|
||||
this.printJoin(node.declaration.decorators, node);
|
||||
}
|
||||
|
||||
this.word("export");
|
||||
this.space();
|
||||
ExportDeclaration.apply(this, arguments);
|
||||
}
|
||||
|
||||
function ExportDefaultDeclaration(node) {
|
||||
if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {
|
||||
this.printJoin(node.declaration.decorators, node);
|
||||
}
|
||||
|
||||
this.word("export");
|
||||
this.space();
|
||||
this.word("default");
|
||||
this.space();
|
||||
ExportDeclaration.apply(this, arguments);
|
||||
}
|
||||
|
||||
function ExportDeclaration(node) {
|
||||
if (node.declaration) {
|
||||
const declar = node.declaration;
|
||||
this.print(declar, node);
|
||||
if (!t.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 (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) {
|
||||
hasSpecial = true;
|
||||
this.print(specifiers.shift(), node);
|
||||
|
||||
if (specifiers.length) {
|
||||
this.token(",");
|
||||
this.space();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (specifiers.length || !specifiers.length && !hasSpecial) {
|
||||
this.token("{");
|
||||
|
||||
if (specifiers.length) {
|
||||
this.space();
|
||||
this.printList(specifiers, node);
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
if (node.source) {
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
this.print(node.source, node);
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
}
|
||||
}
|
||||
|
||||
function ImportDeclaration(node) {
|
||||
this.word("import");
|
||||
this.space();
|
||||
|
||||
if (node.importKind === "type" || node.importKind === "typeof") {
|
||||
this.word(node.importKind);
|
||||
this.space();
|
||||
}
|
||||
|
||||
const specifiers = node.specifiers.slice(0);
|
||||
|
||||
if (specifiers == null ? void 0 : specifiers.length) {
|
||||
for (;;) {
|
||||
const first = specifiers[0];
|
||||
|
||||
if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) {
|
||||
this.print(specifiers.shift(), node);
|
||||
|
||||
if (specifiers.length) {
|
||||
this.token(",");
|
||||
this.space();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (specifiers.length) {
|
||||
this.token("{");
|
||||
this.space();
|
||||
this.printList(specifiers, node);
|
||||
this.space();
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.print(node.source, node);
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function ImportNamespaceSpecifier(node) {
|
||||
this.token("*");
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(node.local, node);
|
||||
}
|
||||
313
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/statements.js
generated
vendored
Normal file
313
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/statements.js
generated
vendored
Normal file
@@ -0,0 +1,313 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.WithStatement = WithStatement;
|
||||
exports.IfStatement = IfStatement;
|
||||
exports.ForStatement = ForStatement;
|
||||
exports.WhileStatement = WhileStatement;
|
||||
exports.DoWhileStatement = DoWhileStatement;
|
||||
exports.LabeledStatement = LabeledStatement;
|
||||
exports.TryStatement = TryStatement;
|
||||
exports.CatchClause = CatchClause;
|
||||
exports.SwitchStatement = SwitchStatement;
|
||||
exports.SwitchCase = SwitchCase;
|
||||
exports.DebuggerStatement = DebuggerStatement;
|
||||
exports.VariableDeclaration = VariableDeclaration;
|
||||
exports.VariableDeclarator = VariableDeclarator;
|
||||
exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForOfStatement = exports.ForInStatement = void 0;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function WithStatement(node) {
|
||||
this.word("with");
|
||||
this.space();
|
||||
this.token("(");
|
||||
this.print(node.object, node);
|
||||
this.token(")");
|
||||
this.printBlock(node);
|
||||
}
|
||||
|
||||
function IfStatement(node) {
|
||||
this.word("if");
|
||||
this.space();
|
||||
this.token("(");
|
||||
this.print(node.test, node);
|
||||
this.token(")");
|
||||
this.space();
|
||||
const needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent));
|
||||
|
||||
if (needsBlock) {
|
||||
this.token("{");
|
||||
this.newline();
|
||||
this.indent();
|
||||
}
|
||||
|
||||
this.printAndIndentOnComments(node.consequent, node);
|
||||
|
||||
if (needsBlock) {
|
||||
this.dedent();
|
||||
this.newline();
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
if (node.alternate) {
|
||||
if (this.endsWith("}")) this.space();
|
||||
this.word("else");
|
||||
this.space();
|
||||
this.printAndIndentOnComments(node.alternate, node);
|
||||
}
|
||||
}
|
||||
|
||||
function getLastStatement(statement) {
|
||||
if (!t.isStatement(statement.body)) return statement;
|
||||
return getLastStatement(statement.body);
|
||||
}
|
||||
|
||||
function ForStatement(node) {
|
||||
this.word("for");
|
||||
this.space();
|
||||
this.token("(");
|
||||
this.inForStatementInitCounter++;
|
||||
this.print(node.init, node);
|
||||
this.inForStatementInitCounter--;
|
||||
this.token(";");
|
||||
|
||||
if (node.test) {
|
||||
this.space();
|
||||
this.print(node.test, node);
|
||||
}
|
||||
|
||||
this.token(";");
|
||||
|
||||
if (node.update) {
|
||||
this.space();
|
||||
this.print(node.update, node);
|
||||
}
|
||||
|
||||
this.token(")");
|
||||
this.printBlock(node);
|
||||
}
|
||||
|
||||
function WhileStatement(node) {
|
||||
this.word("while");
|
||||
this.space();
|
||||
this.token("(");
|
||||
this.print(node.test, node);
|
||||
this.token(")");
|
||||
this.printBlock(node);
|
||||
}
|
||||
|
||||
const buildForXStatement = function (op) {
|
||||
return function (node) {
|
||||
this.word("for");
|
||||
this.space();
|
||||
|
||||
if (op === "of" && node.await) {
|
||||
this.word("await");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("(");
|
||||
this.print(node.left, node);
|
||||
this.space();
|
||||
this.word(op);
|
||||
this.space();
|
||||
this.print(node.right, node);
|
||||
this.token(")");
|
||||
this.printBlock(node);
|
||||
};
|
||||
};
|
||||
|
||||
const ForInStatement = buildForXStatement("in");
|
||||
exports.ForInStatement = ForInStatement;
|
||||
const ForOfStatement = buildForXStatement("of");
|
||||
exports.ForOfStatement = ForOfStatement;
|
||||
|
||||
function DoWhileStatement(node) {
|
||||
this.word("do");
|
||||
this.space();
|
||||
this.print(node.body, node);
|
||||
this.space();
|
||||
this.word("while");
|
||||
this.space();
|
||||
this.token("(");
|
||||
this.print(node.test, node);
|
||||
this.token(")");
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function buildLabelStatement(prefix, key = "label") {
|
||||
return function (node) {
|
||||
this.word(prefix);
|
||||
const label = node[key];
|
||||
|
||||
if (label) {
|
||||
this.space();
|
||||
const isLabel = key == "label";
|
||||
const terminatorState = this.startTerminatorless(isLabel);
|
||||
this.print(label, node);
|
||||
this.endTerminatorless(terminatorState);
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
};
|
||||
}
|
||||
|
||||
const ContinueStatement = buildLabelStatement("continue");
|
||||
exports.ContinueStatement = ContinueStatement;
|
||||
const ReturnStatement = buildLabelStatement("return", "argument");
|
||||
exports.ReturnStatement = ReturnStatement;
|
||||
const BreakStatement = buildLabelStatement("break");
|
||||
exports.BreakStatement = BreakStatement;
|
||||
const ThrowStatement = buildLabelStatement("throw", "argument");
|
||||
exports.ThrowStatement = ThrowStatement;
|
||||
|
||||
function LabeledStatement(node) {
|
||||
this.print(node.label, node);
|
||||
this.token(":");
|
||||
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.token("(");
|
||||
this.print(node.param, node);
|
||||
this.token(")");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.print(node.body, node);
|
||||
}
|
||||
|
||||
function SwitchStatement(node) {
|
||||
this.word("switch");
|
||||
this.space();
|
||||
this.token("(");
|
||||
this.print(node.discriminant, node);
|
||||
this.token(")");
|
||||
this.space();
|
||||
this.token("{");
|
||||
this.printSequence(node.cases, node, {
|
||||
indent: true,
|
||||
|
||||
addNewlines(leading, cas) {
|
||||
if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
|
||||
}
|
||||
|
||||
});
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
function SwitchCase(node) {
|
||||
if (node.test) {
|
||||
this.word("case");
|
||||
this.space();
|
||||
this.print(node.test, node);
|
||||
this.token(":");
|
||||
} else {
|
||||
this.word("default");
|
||||
this.token(":");
|
||||
}
|
||||
|
||||
if (node.consequent.length) {
|
||||
this.newline();
|
||||
this.printSequence(node.consequent, node, {
|
||||
indent: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function DebuggerStatement() {
|
||||
this.word("debugger");
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function variableDeclarationIndent() {
|
||||
this.token(",");
|
||||
this.newline();
|
||||
if (this.endsWith("\n")) for (let i = 0; i < 4; i++) this.space(true);
|
||||
}
|
||||
|
||||
function constDeclarationIndent() {
|
||||
this.token(",");
|
||||
this.newline();
|
||||
if (this.endsWith("\n")) for (let i = 0; i < 6; i++) this.space(true);
|
||||
}
|
||||
|
||||
function VariableDeclaration(node, parent) {
|
||||
if (node.declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.word(node.kind);
|
||||
this.space();
|
||||
let hasInits = false;
|
||||
|
||||
if (!t.isFor(parent)) {
|
||||
for (const declar of node.declarations) {
|
||||
if (declar.init) {
|
||||
hasInits = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let separator;
|
||||
|
||||
if (hasInits) {
|
||||
separator = node.kind === "const" ? constDeclarationIndent : variableDeclarationIndent;
|
||||
}
|
||||
|
||||
this.printList(node.declarations, node, {
|
||||
separator
|
||||
});
|
||||
|
||||
if (t.isFor(parent)) {
|
||||
if (parent.left === node || parent.init === node) return;
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function VariableDeclarator(node) {
|
||||
this.print(node.id, node);
|
||||
if (node.definite) this.token("!");
|
||||
this.print(node.id.typeAnnotation, node);
|
||||
|
||||
if (node.init) {
|
||||
this.space();
|
||||
this.token("=");
|
||||
this.space();
|
||||
this.print(node.init, node);
|
||||
}
|
||||
}
|
||||
33
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/template-literals.js
generated
vendored
Normal file
33
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/template-literals.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
"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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
251
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/types.js
generated
vendored
Normal file
251
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/types.js
generated
vendored
Normal file
@@ -0,0 +1,251 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Identifier = Identifier;
|
||||
exports.ArgumentPlaceholder = ArgumentPlaceholder;
|
||||
exports.SpreadElement = exports.RestElement = RestElement;
|
||||
exports.ObjectPattern = exports.ObjectExpression = ObjectExpression;
|
||||
exports.ObjectMethod = ObjectMethod;
|
||||
exports.ObjectProperty = ObjectProperty;
|
||||
exports.ArrayPattern = exports.ArrayExpression = ArrayExpression;
|
||||
exports.RecordExpression = RecordExpression;
|
||||
exports.TupleExpression = TupleExpression;
|
||||
exports.RegExpLiteral = RegExpLiteral;
|
||||
exports.BooleanLiteral = BooleanLiteral;
|
||||
exports.NullLiteral = NullLiteral;
|
||||
exports.NumericLiteral = NumericLiteral;
|
||||
exports.StringLiteral = StringLiteral;
|
||||
exports.BigIntLiteral = BigIntLiteral;
|
||||
exports.PipelineTopicExpression = PipelineTopicExpression;
|
||||
exports.PipelineBareFunction = PipelineBareFunction;
|
||||
exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _jsesc = _interopRequireDefault(require("jsesc"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function Identifier(node) {
|
||||
this.exactSource(node.loc, () => {
|
||||
this.word(node.name);
|
||||
});
|
||||
}
|
||||
|
||||
function ArgumentPlaceholder() {
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
function RestElement(node) {
|
||||
this.token("...");
|
||||
this.print(node.argument, node);
|
||||
}
|
||||
|
||||
function ObjectExpression(node) {
|
||||
const props = node.properties;
|
||||
this.token("{");
|
||||
this.printInnerComments(node);
|
||||
|
||||
if (props.length) {
|
||||
this.space();
|
||||
this.printList(props, node, {
|
||||
indent: true,
|
||||
statement: true
|
||||
});
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
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.token("[");
|
||||
this.print(node.key, node);
|
||||
this.token("]");
|
||||
} else {
|
||||
if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) && node.key.name === node.value.left.name) {
|
||||
this.print(node.value, node);
|
||||
return;
|
||||
}
|
||||
|
||||
this.print(node.key, node);
|
||||
|
||||
if (node.shorthand && t.isIdentifier(node.key) && t.isIdentifier(node.value) && node.key.name === node.value.name) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.token(":");
|
||||
this.space();
|
||||
this.print(node.value, node);
|
||||
}
|
||||
|
||||
function ArrayExpression(node) {
|
||||
const elems = node.elements;
|
||||
const len = elems.length;
|
||||
this.token("[");
|
||||
this.printInnerComments(node);
|
||||
|
||||
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.token(",");
|
||||
} else {
|
||||
this.token(",");
|
||||
}
|
||||
}
|
||||
|
||||
this.token("]");
|
||||
}
|
||||
|
||||
function RecordExpression(node) {
|
||||
const props = node.properties;
|
||||
let startToken;
|
||||
let endToken;
|
||||
|
||||
if (this.format.recordAndTupleSyntaxType === "bar") {
|
||||
startToken = "{|";
|
||||
endToken = "|}";
|
||||
} else if (this.format.recordAndTupleSyntaxType === "hash") {
|
||||
startToken = "#{";
|
||||
endToken = "}";
|
||||
} else {
|
||||
throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
|
||||
}
|
||||
|
||||
this.token(startToken);
|
||||
this.printInnerComments(node);
|
||||
|
||||
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);
|
||||
this.printInnerComments(node);
|
||||
|
||||
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.token(",");
|
||||
}
|
||||
}
|
||||
|
||||
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((0, _jsesc.default)(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 != null) {
|
||||
this.token(raw);
|
||||
return;
|
||||
}
|
||||
|
||||
const opts = this.format.jsescOption;
|
||||
|
||||
if (this.format.jsonCompatibleStrings) {
|
||||
opts.json = true;
|
||||
}
|
||||
|
||||
const val = (0, _jsesc.default)(node.value, opts);
|
||||
return this.token(val);
|
||||
}
|
||||
|
||||
function BigIntLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (!this.format.minified && raw != null) {
|
||||
this.token(raw);
|
||||
return;
|
||||
}
|
||||
|
||||
this.token(node.value);
|
||||
}
|
||||
|
||||
function PipelineTopicExpression(node) {
|
||||
this.print(node.expression, node);
|
||||
}
|
||||
|
||||
function PipelineBareFunction(node) {
|
||||
this.print(node.callee, node);
|
||||
}
|
||||
|
||||
function PipelinePrimaryTopicReference() {
|
||||
this.token("#");
|
||||
}
|
||||
758
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/typescript.js
generated
vendored
Normal file
758
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/generators/typescript.js
generated
vendored
Normal file
@@ -0,0 +1,758 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TSTypeAnnotation = TSTypeAnnotation;
|
||||
exports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
|
||||
exports.TSTypeParameter = TSTypeParameter;
|
||||
exports.TSParameterProperty = TSParameterProperty;
|
||||
exports.TSDeclareFunction = TSDeclareFunction;
|
||||
exports.TSDeclareMethod = TSDeclareMethod;
|
||||
exports.TSQualifiedName = TSQualifiedName;
|
||||
exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration;
|
||||
exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;
|
||||
exports.TSPropertySignature = TSPropertySignature;
|
||||
exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
|
||||
exports.TSMethodSignature = TSMethodSignature;
|
||||
exports.TSIndexSignature = TSIndexSignature;
|
||||
exports.TSAnyKeyword = TSAnyKeyword;
|
||||
exports.TSBigIntKeyword = TSBigIntKeyword;
|
||||
exports.TSUnknownKeyword = TSUnknownKeyword;
|
||||
exports.TSNumberKeyword = TSNumberKeyword;
|
||||
exports.TSObjectKeyword = TSObjectKeyword;
|
||||
exports.TSBooleanKeyword = TSBooleanKeyword;
|
||||
exports.TSStringKeyword = TSStringKeyword;
|
||||
exports.TSSymbolKeyword = TSSymbolKeyword;
|
||||
exports.TSVoidKeyword = TSVoidKeyword;
|
||||
exports.TSUndefinedKeyword = TSUndefinedKeyword;
|
||||
exports.TSNullKeyword = TSNullKeyword;
|
||||
exports.TSNeverKeyword = TSNeverKeyword;
|
||||
exports.TSThisType = TSThisType;
|
||||
exports.TSFunctionType = TSFunctionType;
|
||||
exports.TSConstructorType = TSConstructorType;
|
||||
exports.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType;
|
||||
exports.TSTypeReference = TSTypeReference;
|
||||
exports.TSTypePredicate = TSTypePredicate;
|
||||
exports.TSTypeQuery = TSTypeQuery;
|
||||
exports.TSTypeLiteral = TSTypeLiteral;
|
||||
exports.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody;
|
||||
exports.tsPrintBraced = tsPrintBraced;
|
||||
exports.TSArrayType = TSArrayType;
|
||||
exports.TSTupleType = TSTupleType;
|
||||
exports.TSOptionalType = TSOptionalType;
|
||||
exports.TSRestType = TSRestType;
|
||||
exports.TSUnionType = TSUnionType;
|
||||
exports.TSIntersectionType = TSIntersectionType;
|
||||
exports.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType;
|
||||
exports.TSConditionalType = TSConditionalType;
|
||||
exports.TSInferType = TSInferType;
|
||||
exports.TSParenthesizedType = TSParenthesizedType;
|
||||
exports.TSTypeOperator = TSTypeOperator;
|
||||
exports.TSIndexedAccessType = TSIndexedAccessType;
|
||||
exports.TSMappedType = TSMappedType;
|
||||
exports.TSLiteralType = TSLiteralType;
|
||||
exports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;
|
||||
exports.TSInterfaceDeclaration = TSInterfaceDeclaration;
|
||||
exports.TSInterfaceBody = TSInterfaceBody;
|
||||
exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
|
||||
exports.TSAsExpression = TSAsExpression;
|
||||
exports.TSTypeAssertion = TSTypeAssertion;
|
||||
exports.TSEnumDeclaration = TSEnumDeclaration;
|
||||
exports.TSEnumMember = TSEnumMember;
|
||||
exports.TSModuleDeclaration = TSModuleDeclaration;
|
||||
exports.TSModuleBlock = TSModuleBlock;
|
||||
exports.TSImportType = TSImportType;
|
||||
exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
|
||||
exports.TSExternalModuleReference = TSExternalModuleReference;
|
||||
exports.TSNonNullExpression = TSNonNullExpression;
|
||||
exports.TSExportAssignment = TSExportAssignment;
|
||||
exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
|
||||
exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase;
|
||||
exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers;
|
||||
|
||||
function TSTypeAnnotation(node) {
|
||||
this.token(":");
|
||||
this.space();
|
||||
if (node.optional) this.token("?");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function TSTypeParameterInstantiation(node) {
|
||||
this.token("<");
|
||||
this.printList(node.params, node, {});
|
||||
this.token(">");
|
||||
}
|
||||
|
||||
function TSTypeParameter(node) {
|
||||
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.token("=");
|
||||
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.token(";");
|
||||
}
|
||||
|
||||
function TSDeclareMethod(node) {
|
||||
this._classMethodHead(node);
|
||||
|
||||
this.token(";");
|
||||
}
|
||||
|
||||
function TSQualifiedName(node) {
|
||||
this.print(node.left, node);
|
||||
this.token(".");
|
||||
this.print(node.right, node);
|
||||
}
|
||||
|
||||
function TSCallSignatureDeclaration(node) {
|
||||
this.tsPrintSignatureDeclarationBase(node);
|
||||
this.token(";");
|
||||
}
|
||||
|
||||
function TSConstructSignatureDeclaration(node) {
|
||||
this.word("new");
|
||||
this.space();
|
||||
this.tsPrintSignatureDeclarationBase(node);
|
||||
this.token(";");
|
||||
}
|
||||
|
||||
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.token("=");
|
||||
this.space();
|
||||
this.print(initializer, node);
|
||||
}
|
||||
|
||||
this.token(";");
|
||||
}
|
||||
|
||||
function tsPrintPropertyOrMethodName(node) {
|
||||
if (node.computed) {
|
||||
this.token("[");
|
||||
}
|
||||
|
||||
this.print(node.key, node);
|
||||
|
||||
if (node.computed) {
|
||||
this.token("]");
|
||||
}
|
||||
|
||||
if (node.optional) {
|
||||
this.token("?");
|
||||
}
|
||||
}
|
||||
|
||||
function TSMethodSignature(node) {
|
||||
this.tsPrintPropertyOrMethodName(node);
|
||||
this.tsPrintSignatureDeclarationBase(node);
|
||||
this.token(";");
|
||||
}
|
||||
|
||||
function TSIndexSignature(node) {
|
||||
const {
|
||||
readonly
|
||||
} = node;
|
||||
|
||||
if (readonly) {
|
||||
this.word("readonly");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("[");
|
||||
|
||||
this._parameters(node.parameters, node);
|
||||
|
||||
this.token("]");
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.token(";");
|
||||
}
|
||||
|
||||
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 TSThisType() {
|
||||
this.word("this");
|
||||
}
|
||||
|
||||
function TSFunctionType(node) {
|
||||
this.tsPrintFunctionOrConstructorType(node);
|
||||
}
|
||||
|
||||
function TSConstructorType(node) {
|
||||
this.word("new");
|
||||
this.space();
|
||||
this.tsPrintFunctionOrConstructorType(node);
|
||||
}
|
||||
|
||||
function tsPrintFunctionOrConstructorType(node) {
|
||||
const {
|
||||
typeParameters,
|
||||
parameters
|
||||
} = node;
|
||||
this.print(typeParameters, node);
|
||||
this.token("(");
|
||||
|
||||
this._parameters(parameters, node);
|
||||
|
||||
this.token(")");
|
||||
this.space();
|
||||
this.token("=>");
|
||||
this.space();
|
||||
this.print(node.typeAnnotation.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function TSTypeReference(node) {
|
||||
this.print(node.typeName, node);
|
||||
this.print(node.typeParameters, node);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
function TSTypeLiteral(node) {
|
||||
this.tsPrintTypeLiteralOrInterfaceBody(node.members, node);
|
||||
}
|
||||
|
||||
function tsPrintTypeLiteralOrInterfaceBody(members, node) {
|
||||
this.tsPrintBraced(members, node);
|
||||
}
|
||||
|
||||
function tsPrintBraced(members, node) {
|
||||
this.token("{");
|
||||
|
||||
if (members.length) {
|
||||
this.indent();
|
||||
this.newline();
|
||||
|
||||
for (const member of members) {
|
||||
this.print(member, node);
|
||||
this.newline();
|
||||
}
|
||||
|
||||
this.dedent();
|
||||
this.rightBrace();
|
||||
} else {
|
||||
this.token("}");
|
||||
}
|
||||
}
|
||||
|
||||
function TSArrayType(node) {
|
||||
this.print(node.elementType, node);
|
||||
this.token("[]");
|
||||
}
|
||||
|
||||
function TSTupleType(node) {
|
||||
this.token("[");
|
||||
this.printList(node.elementTypes, node);
|
||||
this.token("]");
|
||||
}
|
||||
|
||||
function TSOptionalType(node) {
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
function TSRestType(node) {
|
||||
this.token("...");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function TSUnionType(node) {
|
||||
this.tsPrintUnionOrIntersectionType(node, "|");
|
||||
}
|
||||
|
||||
function TSIntersectionType(node) {
|
||||
this.tsPrintUnionOrIntersectionType(node, "&");
|
||||
}
|
||||
|
||||
function tsPrintUnionOrIntersectionType(node, sep) {
|
||||
this.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.token("?");
|
||||
this.space();
|
||||
this.print(node.trueType);
|
||||
this.space();
|
||||
this.token(":");
|
||||
this.space();
|
||||
this.print(node.falseType);
|
||||
}
|
||||
|
||||
function TSInferType(node) {
|
||||
this.token("infer");
|
||||
this.space();
|
||||
this.print(node.typeParameter);
|
||||
}
|
||||
|
||||
function TSParenthesizedType(node) {
|
||||
this.token("(");
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.token(")");
|
||||
}
|
||||
|
||||
function TSTypeOperator(node) {
|
||||
this.token(node.operator);
|
||||
this.space();
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function TSIndexedAccessType(node) {
|
||||
this.print(node.objectType, node);
|
||||
this.token("[");
|
||||
this.print(node.indexType, node);
|
||||
this.token("]");
|
||||
}
|
||||
|
||||
function TSMappedType(node) {
|
||||
const {
|
||||
readonly,
|
||||
typeParameter,
|
||||
optional
|
||||
} = node;
|
||||
this.token("{");
|
||||
this.space();
|
||||
|
||||
if (readonly) {
|
||||
tokenIfPlusMinus(this, readonly);
|
||||
this.word("readonly");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("[");
|
||||
this.word(typeParameter.name);
|
||||
this.space();
|
||||
this.word("in");
|
||||
this.space();
|
||||
this.print(typeParameter.constraint, typeParameter);
|
||||
this.token("]");
|
||||
|
||||
if (optional) {
|
||||
tokenIfPlusMinus(this, optional);
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
this.token(":");
|
||||
this.space();
|
||||
this.print(node.typeAnnotation, node);
|
||||
this.space();
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
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) {
|
||||
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.token("=");
|
||||
this.space();
|
||||
this.print(typeAnnotation, node);
|
||||
this.token(";");
|
||||
}
|
||||
|
||||
function TSAsExpression(node) {
|
||||
const {
|
||||
expression,
|
||||
typeAnnotation
|
||||
} = node;
|
||||
this.print(expression, node);
|
||||
this.space();
|
||||
this.word("as");
|
||||
this.space();
|
||||
this.print(typeAnnotation, node);
|
||||
}
|
||||
|
||||
function TSTypeAssertion(node) {
|
||||
const {
|
||||
typeAnnotation,
|
||||
expression
|
||||
} = node;
|
||||
this.token("<");
|
||||
this.print(typeAnnotation, node);
|
||||
this.token(">");
|
||||
this.space();
|
||||
this.print(expression, 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();
|
||||
this.tsPrintBraced(members, node);
|
||||
}
|
||||
|
||||
function TSEnumMember(node) {
|
||||
const {
|
||||
id,
|
||||
initializer
|
||||
} = node;
|
||||
this.print(id, node);
|
||||
|
||||
if (initializer) {
|
||||
this.space();
|
||||
this.token("=");
|
||||
this.space();
|
||||
this.print(initializer, node);
|
||||
}
|
||||
|
||||
this.token(",");
|
||||
}
|
||||
|
||||
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.token(";");
|
||||
return;
|
||||
}
|
||||
|
||||
let body = node.body;
|
||||
|
||||
while (body.type === "TSModuleDeclaration") {
|
||||
this.token(".");
|
||||
this.print(body.id, body);
|
||||
body = body.body;
|
||||
}
|
||||
|
||||
this.space();
|
||||
this.print(body, node);
|
||||
}
|
||||
|
||||
function TSModuleBlock(node) {
|
||||
this.tsPrintBraced(node.body, node);
|
||||
}
|
||||
|
||||
function TSImportType(node) {
|
||||
const {
|
||||
argument,
|
||||
qualifier,
|
||||
typeParameters
|
||||
} = node;
|
||||
this.word("import");
|
||||
this.token("(");
|
||||
this.print(argument, node);
|
||||
this.token(")");
|
||||
|
||||
if (qualifier) {
|
||||
this.token(".");
|
||||
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.token("=");
|
||||
this.space();
|
||||
this.print(moduleReference, node);
|
||||
this.token(";");
|
||||
}
|
||||
|
||||
function TSExternalModuleReference(node) {
|
||||
this.token("require(");
|
||||
this.print(node.expression, node);
|
||||
this.token(")");
|
||||
}
|
||||
|
||||
function TSNonNullExpression(node) {
|
||||
this.print(node.expression, node);
|
||||
this.token("!");
|
||||
}
|
||||
|
||||
function TSExportAssignment(node) {
|
||||
this.word("export");
|
||||
this.space();
|
||||
this.token("=");
|
||||
this.space();
|
||||
this.print(node.expression, node);
|
||||
this.token(";");
|
||||
}
|
||||
|
||||
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,
|
||||
parameters
|
||||
} = node;
|
||||
this.print(typeParameters, node);
|
||||
this.token("(");
|
||||
|
||||
this._parameters(parameters, node);
|
||||
|
||||
this.token(")");
|
||||
this.print(node.typeAnnotation, node);
|
||||
}
|
||||
|
||||
function tsPrintClassMemberModifiers(node, isField) {
|
||||
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.abstract) {
|
||||
this.word("abstract");
|
||||
this.space();
|
||||
}
|
||||
|
||||
if (isField && node.readonly) {
|
||||
this.word("readonly");
|
||||
this.space();
|
||||
}
|
||||
}
|
||||
93
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/index.js
generated
vendored
Normal file
93
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
exports.CodeGenerator = void 0;
|
||||
|
||||
var _sourceMap = _interopRequireDefault(require("./source-map"));
|
||||
|
||||
var _printer = _interopRequireDefault(require("./printer"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
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 = 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,
|
||||
jsonCompatibleStrings: opts.jsonCompatibleStrings,
|
||||
indent: {
|
||||
adjustMultilineComment: true,
|
||||
style: " ",
|
||||
base: 0
|
||||
},
|
||||
decoratorsBeforeExport: !!opts.decoratorsBeforeExport,
|
||||
jsescOption: Object.assign({
|
||||
quotes: "double",
|
||||
wrap: true
|
||||
}, opts.jsescOption),
|
||||
recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType
|
||||
};
|
||||
|
||||
if (format.minified) {
|
||||
format.compact = true;
|
||||
|
||||
format.shouldPrintComment = format.shouldPrintComment || (() => format.comments);
|
||||
} else {
|
||||
format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
class CodeGenerator {
|
||||
constructor(ast, opts, code) {
|
||||
this._generator = new Generator(ast, opts, code);
|
||||
}
|
||||
|
||||
generate() {
|
||||
return this._generator.generate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.CodeGenerator = CodeGenerator;
|
||||
|
||||
function _default(ast, opts, code) {
|
||||
const gen = new Generator(ast, opts, code);
|
||||
return gen.generate();
|
||||
}
|
||||
107
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/node/index.js
generated
vendored
Normal file
107
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/node/index.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.needsWhitespace = needsWhitespace;
|
||||
exports.needsWhitespaceBefore = needsWhitespaceBefore;
|
||||
exports.needsWhitespaceAfter = needsWhitespaceAfter;
|
||||
exports.needsParens = needsParens;
|
||||
|
||||
var whitespace = _interopRequireWildcard(require("./whitespace"));
|
||||
|
||||
var parens = _interopRequireWildcard(require("./parentheses"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
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 = t.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);
|
||||
const expandedWhitespaceList = expandAliases(whitespace.list);
|
||||
|
||||
function find(obj, node, parent, printStack) {
|
||||
const fn = obj[node.type];
|
||||
return fn ? fn(node, parent, printStack) : null;
|
||||
}
|
||||
|
||||
function isOrHasCallExpression(node) {
|
||||
if (t.isCallExpression(node)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return t.isMemberExpression(node) && isOrHasCallExpression(node.object);
|
||||
}
|
||||
|
||||
function needsWhitespace(node, parent, type) {
|
||||
if (!node) return 0;
|
||||
|
||||
if (t.isExpressionStatement(node)) {
|
||||
node = node.expression;
|
||||
}
|
||||
|
||||
let linesInfo = find(expandedWhitespaceNodes, node, parent);
|
||||
|
||||
if (!linesInfo) {
|
||||
const items = find(expandedWhitespaceList, node, parent);
|
||||
|
||||
if (items) {
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
linesInfo = needsWhitespace(items[i], node, type);
|
||||
if (linesInfo) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof linesInfo === "object" && linesInfo !== null) {
|
||||
return linesInfo[type] || 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function needsWhitespaceBefore(node, parent) {
|
||||
return needsWhitespace(node, parent, "before");
|
||||
}
|
||||
|
||||
function needsWhitespaceAfter(node, parent) {
|
||||
return needsWhitespace(node, parent, "after");
|
||||
}
|
||||
|
||||
function needsParens(node, parent, printStack) {
|
||||
if (!parent) return false;
|
||||
|
||||
if (t.isNewExpression(parent) && parent.callee === node) {
|
||||
if (isOrHasCallExpression(node)) return true;
|
||||
}
|
||||
|
||||
return find(expandedParens, node, parent, printStack);
|
||||
}
|
||||
253
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/node/parentheses.js
generated
vendored
Normal file
253
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/node/parentheses.js
generated
vendored
Normal file
@@ -0,0 +1,253 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
||||
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
||||
exports.UpdateExpression = UpdateExpression;
|
||||
exports.ObjectExpression = ObjectExpression;
|
||||
exports.DoExpression = DoExpression;
|
||||
exports.Binary = Binary;
|
||||
exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
||||
exports.TSAsExpression = TSAsExpression;
|
||||
exports.TSTypeAssertion = TSTypeAssertion;
|
||||
exports.TSIntersectionType = exports.TSUnionType = TSUnionType;
|
||||
exports.TSInferType = TSInferType;
|
||||
exports.BinaryExpression = BinaryExpression;
|
||||
exports.SequenceExpression = SequenceExpression;
|
||||
exports.AwaitExpression = exports.YieldExpression = YieldExpression;
|
||||
exports.ClassExpression = ClassExpression;
|
||||
exports.UnaryLike = UnaryLike;
|
||||
exports.FunctionExpression = FunctionExpression;
|
||||
exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
||||
exports.ConditionalExpression = ConditionalExpression;
|
||||
exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression;
|
||||
exports.AssignmentExpression = AssignmentExpression;
|
||||
exports.LogicalExpression = LogicalExpression;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const PRECEDENCE = {
|
||||
"||": 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) => (t.isClassDeclaration(parent) || t.isClassExpression(parent)) && parent.superClass === node;
|
||||
|
||||
const hasPostfixPart = (node, parent) => (t.isMemberExpression(parent) || t.isOptionalMemberExpression(parent)) && parent.object === node || (t.isCallExpression(parent) || t.isOptionalCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node || t.isTaggedTemplateExpression(parent) && parent.tag === node || t.isTSNonNullExpression(parent);
|
||||
|
||||
function NullableTypeAnnotation(node, parent) {
|
||||
return t.isArrayTypeAnnotation(parent);
|
||||
}
|
||||
|
||||
function FunctionTypeAnnotation(node, parent, printStack) {
|
||||
return t.isUnionTypeAnnotation(parent) || t.isIntersectionTypeAnnotation(parent) || t.isArrayTypeAnnotation(parent) || t.isTypeAnnotation(parent) && t.isArrowFunctionExpression(printStack[printStack.length - 3]);
|
||||
}
|
||||
|
||||
function UpdateExpression(node, parent) {
|
||||
return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);
|
||||
}
|
||||
|
||||
function ObjectExpression(node, parent, printStack) {
|
||||
return isFirstInStatement(printStack, {
|
||||
considerArrow: true
|
||||
});
|
||||
}
|
||||
|
||||
function DoExpression(node, parent, printStack) {
|
||||
return isFirstInStatement(printStack);
|
||||
}
|
||||
|
||||
function Binary(node, parent) {
|
||||
if (node.operator === "**" && t.isBinaryExpression(parent, {
|
||||
operator: "**"
|
||||
})) {
|
||||
return parent.left === node;
|
||||
}
|
||||
|
||||
if (isClassExtendsClause(node, parent)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (hasPostfixPart(node, parent) || t.isUnaryLike(parent) || t.isAwaitExpression(parent)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (t.isBinary(parent)) {
|
||||
const parentOp = parent.operator;
|
||||
const parentPos = PRECEDENCE[parentOp];
|
||||
const nodeOp = node.operator;
|
||||
const nodePos = PRECEDENCE[nodeOp];
|
||||
|
||||
if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent) || parentPos > nodePos) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function UnionTypeAnnotation(node, parent) {
|
||||
return t.isArrayTypeAnnotation(parent) || t.isNullableTypeAnnotation(parent) || t.isIntersectionTypeAnnotation(parent) || t.isUnionTypeAnnotation(parent);
|
||||
}
|
||||
|
||||
function TSAsExpression() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function TSTypeAssertion() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function TSUnionType(node, parent) {
|
||||
return t.isTSArrayType(parent) || t.isTSOptionalType(parent) || t.isTSIntersectionType(parent) || t.isTSUnionType(parent) || t.isTSRestType(parent);
|
||||
}
|
||||
|
||||
function TSInferType(node, parent) {
|
||||
return t.isTSArrayType(parent) || t.isTSOptionalType(parent);
|
||||
}
|
||||
|
||||
function BinaryExpression(node, parent) {
|
||||
return node.operator === "in" && (t.isVariableDeclarator(parent) || t.isFor(parent));
|
||||
}
|
||||
|
||||
function SequenceExpression(node, parent) {
|
||||
if (t.isForStatement(parent) || t.isThrowStatement(parent) || t.isReturnStatement(parent) || t.isIfStatement(parent) && parent.test === node || t.isWhileStatement(parent) && parent.test === node || t.isForInStatement(parent) && parent.right === node || t.isSwitchStatement(parent) && parent.discriminant === node || t.isExpressionStatement(parent) && parent.expression === node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function YieldExpression(node, parent) {
|
||||
return t.isBinary(parent) || t.isUnaryLike(parent) || hasPostfixPart(node, parent) || t.isAwaitExpression(parent) && t.isYieldExpression(node) || t.isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
|
||||
}
|
||||
|
||||
function ClassExpression(node, parent, printStack) {
|
||||
return isFirstInStatement(printStack, {
|
||||
considerDefaultExports: true
|
||||
});
|
||||
}
|
||||
|
||||
function UnaryLike(node, parent) {
|
||||
return hasPostfixPart(node, parent) || t.isBinaryExpression(parent, {
|
||||
operator: "**",
|
||||
left: node
|
||||
}) || isClassExtendsClause(node, parent);
|
||||
}
|
||||
|
||||
function FunctionExpression(node, parent, printStack) {
|
||||
return isFirstInStatement(printStack, {
|
||||
considerDefaultExports: true
|
||||
});
|
||||
}
|
||||
|
||||
function ArrowFunctionExpression(node, parent) {
|
||||
return t.isExportDeclaration(parent) || ConditionalExpression(node, parent);
|
||||
}
|
||||
|
||||
function ConditionalExpression(node, parent) {
|
||||
if (t.isUnaryLike(parent) || t.isBinary(parent) || t.isConditionalExpression(parent, {
|
||||
test: node
|
||||
}) || t.isAwaitExpression(parent) || t.isTSTypeAssertion(parent) || t.isTSAsExpression(parent)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return UnaryLike(node, parent);
|
||||
}
|
||||
|
||||
function OptionalMemberExpression(node, parent) {
|
||||
return t.isCallExpression(parent, {
|
||||
callee: node
|
||||
}) || t.isMemberExpression(parent, {
|
||||
object: node
|
||||
});
|
||||
}
|
||||
|
||||
function AssignmentExpression(node, parent, printStack) {
|
||||
if (t.isObjectPattern(node.left)) {
|
||||
return true;
|
||||
} else {
|
||||
return ConditionalExpression(node, parent, printStack);
|
||||
}
|
||||
}
|
||||
|
||||
function LogicalExpression(node, parent) {
|
||||
switch (node.operator) {
|
||||
case "||":
|
||||
if (!t.isLogicalExpression(parent)) return false;
|
||||
return parent.operator === "??" || parent.operator === "&&";
|
||||
|
||||
case "&&":
|
||||
return t.isLogicalExpression(parent, {
|
||||
operator: "??"
|
||||
});
|
||||
|
||||
case "??":
|
||||
return t.isLogicalExpression(parent) && parent.operator !== "??";
|
||||
}
|
||||
}
|
||||
|
||||
function isFirstInStatement(printStack, {
|
||||
considerArrow = false,
|
||||
considerDefaultExports = false
|
||||
} = {}) {
|
||||
let i = printStack.length - 1;
|
||||
let node = printStack[i];
|
||||
i--;
|
||||
let parent = printStack[i];
|
||||
|
||||
while (i > 0) {
|
||||
if (t.isExpressionStatement(parent, {
|
||||
expression: node
|
||||
}) || considerDefaultExports && t.isExportDefaultDeclaration(parent, {
|
||||
declaration: node
|
||||
}) || considerArrow && t.isArrowFunctionExpression(parent, {
|
||||
body: node
|
||||
})) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (hasPostfixPart(node, parent) && !t.isNewExpression(parent) || t.isSequenceExpression(parent) && parent.expressions[0] === node || t.isConditional(parent, {
|
||||
test: node
|
||||
}) || t.isBinary(parent, {
|
||||
left: node
|
||||
}) || t.isAssignmentExpression(parent, {
|
||||
left: node
|
||||
})) {
|
||||
node = parent;
|
||||
i--;
|
||||
parent = printStack[i];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
201
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/node/whitespace.js
generated
vendored
Normal file
201
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/node/whitespace.js
generated
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.list = exports.nodes = void 0;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function crawl(node, state = {}) {
|
||||
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
|
||||
crawl(node.object, state);
|
||||
if (node.computed) crawl(node.property, state);
|
||||
} else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
|
||||
crawl(node.left, state);
|
||||
crawl(node.right, state);
|
||||
} else if (t.isCallExpression(node) || t.isOptionalCallExpression(node)) {
|
||||
state.hasCall = true;
|
||||
crawl(node.callee, state);
|
||||
} else if (t.isFunction(node)) {
|
||||
state.hasFunction = true;
|
||||
} else if (t.isIdentifier(node)) {
|
||||
state.hasHelper = state.hasHelper || isHelper(node.callee);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
function isHelper(node) {
|
||||
if (t.isMemberExpression(node)) {
|
||||
return isHelper(node.object) || isHelper(node.property);
|
||||
} else if (t.isIdentifier(node)) {
|
||||
return node.name === "require" || node.name[0] === "_";
|
||||
} else if (t.isCallExpression(node)) {
|
||||
return isHelper(node.callee);
|
||||
} else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
|
||||
return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isType(node) {
|
||||
return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);
|
||||
}
|
||||
|
||||
const nodes = {
|
||||
AssignmentExpression(node) {
|
||||
const state = crawl(node.right);
|
||||
|
||||
if (state.hasCall && state.hasHelper || state.hasFunction) {
|
||||
return {
|
||||
before: state.hasFunction,
|
||||
after: true
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
SwitchCase(node, parent) {
|
||||
return {
|
||||
before: node.consequent.length || parent.cases[0] === node,
|
||||
after: !node.consequent.length && parent.cases[parent.cases.length - 1] === node
|
||||
};
|
||||
},
|
||||
|
||||
LogicalExpression(node) {
|
||||
if (t.isFunction(node.left) || t.isFunction(node.right)) {
|
||||
return {
|
||||
after: true
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
Literal(node) {
|
||||
if (node.value === "use strict") {
|
||||
return {
|
||||
after: true
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
CallExpression(node) {
|
||||
if (t.isFunction(node.callee) || isHelper(node)) {
|
||||
return {
|
||||
before: true,
|
||||
after: true
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
OptionalCallExpression(node) {
|
||||
if (t.isFunction(node.callee)) {
|
||||
return {
|
||||
before: true,
|
||||
after: true
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
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) {
|
||||
const state = crawl(declar.init);
|
||||
enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
return {
|
||||
before: true,
|
||||
after: true
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
IfStatement(node) {
|
||||
if (t.isBlockStatement(node.consequent)) {
|
||||
return {
|
||||
before: true,
|
||||
after: true
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
exports.nodes = nodes;
|
||||
|
||||
nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) {
|
||||
if (parent.properties[0] === node) {
|
||||
return {
|
||||
before: true
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
nodes.ObjectTypeCallProperty = function (node, parent) {
|
||||
var _parent$properties;
|
||||
|
||||
if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) == null ? void 0 : _parent$properties.length)) {
|
||||
return {
|
||||
before: true
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
nodes.ObjectTypeIndexer = function (node, parent) {
|
||||
var _parent$properties2, _parent$callPropertie;
|
||||
|
||||
if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) == null ? void 0 : _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) == null ? void 0 : _parent$callPropertie.length)) {
|
||||
return {
|
||||
before: true
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
nodes.ObjectTypeInternalSlot = function (node, parent) {
|
||||
var _parent$properties3, _parent$callPropertie2, _parent$indexers;
|
||||
|
||||
if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) == null ? void 0 : _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) == null ? void 0 : _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) == null ? void 0 : _parent$indexers.length)) {
|
||||
return {
|
||||
before: true
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const list = {
|
||||
VariableDeclaration(node) {
|
||||
return node.declarations.map(decl => decl.init);
|
||||
},
|
||||
|
||||
ArrayExpression(node) {
|
||||
return node.elements;
|
||||
},
|
||||
|
||||
ObjectExpression(node) {
|
||||
return node.properties;
|
||||
}
|
||||
|
||||
};
|
||||
exports.list = list;
|
||||
[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) {
|
||||
if (typeof amounts === "boolean") {
|
||||
amounts = {
|
||||
after: amounts,
|
||||
before: amounts
|
||||
};
|
||||
}
|
||||
|
||||
[type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
|
||||
nodes[type] = function () {
|
||||
return amounts;
|
||||
};
|
||||
});
|
||||
});
|
||||
502
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/printer.js
generated
vendored
Normal file
502
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/printer.js
generated
vendored
Normal file
@@ -0,0 +1,502 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _isInteger = _interopRequireDefault(require("lodash/isInteger"));
|
||||
|
||||
var _repeat = _interopRequireDefault(require("lodash/repeat"));
|
||||
|
||||
var _buffer = _interopRequireDefault(require("./buffer"));
|
||||
|
||||
var n = _interopRequireWildcard(require("./node"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var generatorFunctions = _interopRequireWildcard(require("./generators"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const SCIENTIFIC_NOTATION = /e/i;
|
||||
const ZERO_DECIMAL_INTEGER = /\.0+$/;
|
||||
const NON_DECIMAL_LITERAL = /^0[box]/;
|
||||
const PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/;
|
||||
|
||||
class Printer {
|
||||
constructor(format, map) {
|
||||
this.inForStatementInitCounter = 0;
|
||||
this._printStack = [];
|
||||
this._indent = 0;
|
||||
this._insideAux = false;
|
||||
this._printedCommentStarts = {};
|
||||
this._parenPushNewlineState = null;
|
||||
this._noLineTerminator = false;
|
||||
this._printAuxAfterOnNextUserNode = false;
|
||||
this._printedComments = new WeakSet();
|
||||
this._endsWithInteger = false;
|
||||
this._endsWithWord = false;
|
||||
this.format = format || {};
|
||||
this._buf = new _buffer.default(map);
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
this._append(";", !force);
|
||||
}
|
||||
|
||||
rightBrace() {
|
||||
if (this.format.minified) {
|
||||
this._buf.removeLastSemicolon();
|
||||
}
|
||||
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
space(force = false) {
|
||||
if (this.format.compact) return;
|
||||
|
||||
if (this._buf.hasContent() && !this.endsWith(" ") && !this.endsWith("\n") || force) {
|
||||
this._space();
|
||||
}
|
||||
}
|
||||
|
||||
word(str) {
|
||||
if (this._endsWithWord || this.endsWith("/") && str.indexOf("/") === 0) {
|
||||
this._space();
|
||||
}
|
||||
|
||||
this._maybeAddAuxComment();
|
||||
|
||||
this._append(str);
|
||||
|
||||
this._endsWithWord = true;
|
||||
}
|
||||
|
||||
number(str) {
|
||||
this.word(str);
|
||||
this._endsWithInteger = (0, _isInteger.default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== ".";
|
||||
}
|
||||
|
||||
token(str) {
|
||||
if (str === "--" && this.endsWith("!") || str[0] === "+" && this.endsWith("+") || str[0] === "-" && this.endsWith("-") || str[0] === "." && this._endsWithInteger) {
|
||||
this._space();
|
||||
}
|
||||
|
||||
this._maybeAddAuxComment();
|
||||
|
||||
this._append(str);
|
||||
}
|
||||
|
||||
newline(i) {
|
||||
if (this.format.retainLines || this.format.compact) return;
|
||||
|
||||
if (this.format.concise) {
|
||||
this.space();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.endsWith("\n\n")) return;
|
||||
if (typeof i !== "number") i = 1;
|
||||
i = Math.min(2, i);
|
||||
if (this.endsWith("{\n") || this.endsWith(":\n")) i--;
|
||||
if (i <= 0) return;
|
||||
|
||||
for (let j = 0; j < i; j++) {
|
||||
this._newline();
|
||||
}
|
||||
}
|
||||
|
||||
endsWith(str) {
|
||||
return this._buf.endsWith(str);
|
||||
}
|
||||
|
||||
removeTrailingNewline() {
|
||||
this._buf.removeTrailingNewline();
|
||||
}
|
||||
|
||||
exactSource(loc, cb) {
|
||||
this._catchUp("start", loc);
|
||||
|
||||
this._buf.exactSource(loc, cb);
|
||||
}
|
||||
|
||||
source(prop, loc) {
|
||||
this._catchUp(prop, loc);
|
||||
|
||||
this._buf.source(prop, loc);
|
||||
}
|
||||
|
||||
withSource(prop, loc, cb) {
|
||||
this._catchUp(prop, loc);
|
||||
|
||||
this._buf.withSource(prop, loc, cb);
|
||||
}
|
||||
|
||||
_space() {
|
||||
this._append(" ", true);
|
||||
}
|
||||
|
||||
_newline() {
|
||||
this._append("\n", true);
|
||||
}
|
||||
|
||||
_append(str, queue = false) {
|
||||
this._maybeAddParen(str);
|
||||
|
||||
this._maybeIndent(str);
|
||||
|
||||
if (queue) this._buf.queue(str);else this._buf.append(str);
|
||||
this._endsWithWord = false;
|
||||
this._endsWithInteger = false;
|
||||
}
|
||||
|
||||
_maybeIndent(str) {
|
||||
if (this._indent && this.endsWith("\n") && str[0] !== "\n") {
|
||||
this._buf.queue(this._getIndent());
|
||||
}
|
||||
}
|
||||
|
||||
_maybeAddParen(str) {
|
||||
const parenPushNewlineState = this._parenPushNewlineState;
|
||||
if (!parenPushNewlineState) return;
|
||||
let i;
|
||||
|
||||
for (i = 0; i < str.length && str[i] === " "; i++) continue;
|
||||
|
||||
if (i === str.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const cha = str[i];
|
||||
|
||||
if (cha !== "\n") {
|
||||
if (cha !== "/" || i + 1 === str.length) {
|
||||
this._parenPushNewlineState = null;
|
||||
return;
|
||||
}
|
||||
|
||||
const chaPost = str[i + 1];
|
||||
|
||||
if (chaPost === "*") {
|
||||
if (PURE_ANNOTATION_RE.test(str.slice(i + 2, str.length - 2))) {
|
||||
return;
|
||||
}
|
||||
} else if (chaPost !== "/") {
|
||||
this._parenPushNewlineState = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.token("(");
|
||||
this.indent();
|
||||
parenPushNewlineState.printed = true;
|
||||
}
|
||||
|
||||
_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 (0, _repeat.default)(this.format.indent.style, this._indent);
|
||||
}
|
||||
|
||||
startTerminatorless(isLabel = false) {
|
||||
if (isLabel) {
|
||||
this._noLineTerminator = true;
|
||||
return null;
|
||||
} else {
|
||||
return this._parenPushNewlineState = {
|
||||
printed: false
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
endTerminatorless(state) {
|
||||
this._noLineTerminator = false;
|
||||
|
||||
if (state == null ? void 0 : state.printed) {
|
||||
this.dedent();
|
||||
this.newline();
|
||||
this.token(")");
|
||||
}
|
||||
}
|
||||
|
||||
print(node, parent) {
|
||||
if (!node) return;
|
||||
const oldConcise = this.format.concise;
|
||||
|
||||
if (node._compact) {
|
||||
this.format.concise = true;
|
||||
}
|
||||
|
||||
const printMethod = this[node.type];
|
||||
|
||||
if (!printMethod) {
|
||||
throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node == null ? void 0 : node.constructor.name)}`);
|
||||
}
|
||||
|
||||
this._printStack.push(node);
|
||||
|
||||
const oldInAux = this._insideAux;
|
||||
this._insideAux = !node.loc;
|
||||
|
||||
this._maybeAddAuxComment(this._insideAux && !oldInAux);
|
||||
|
||||
let needsParens = n.needsParens(node, parent, this._printStack);
|
||||
|
||||
if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) {
|
||||
needsParens = true;
|
||||
}
|
||||
|
||||
if (needsParens) this.token("(");
|
||||
|
||||
this._printLeadingComments(node);
|
||||
|
||||
const loc = t.isProgram(node) || t.isFile(node) ? null : node.loc;
|
||||
this.withSource("start", loc, () => {
|
||||
printMethod.call(this, node, parent);
|
||||
});
|
||||
|
||||
this._printTrailingComments(node);
|
||||
|
||||
if (needsParens) this.token(")");
|
||||
|
||||
this._printStack.pop();
|
||||
|
||||
this.format.concise = oldConcise;
|
||||
this._insideAux = oldInAux;
|
||||
}
|
||||
|
||||
_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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_printAuxAfterComment() {
|
||||
if (!this._printAuxAfterOnNextUserNode) return;
|
||||
this._printAuxAfterOnNextUserNode = false;
|
||||
const comment = this.format.auxiliaryCommentAfter;
|
||||
|
||||
if (comment) {
|
||||
this._printComment({
|
||||
type: "CommentBlock",
|
||||
value: comment
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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 ? void 0 : nodes.length)) return;
|
||||
if (opts.indent) this.indent();
|
||||
const newlineOpts = {
|
||||
addNewlines: opts.addNewlines
|
||||
};
|
||||
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
const node = nodes[i];
|
||||
if (!node) continue;
|
||||
if (opts.statement) this._printNewline(true, node, parent, newlineOpts);
|
||||
this.print(node, parent);
|
||||
|
||||
if (opts.iterator) {
|
||||
opts.iterator(node, i);
|
||||
}
|
||||
|
||||
if (opts.separator && i < nodes.length - 1) {
|
||||
opts.separator.call(this);
|
||||
}
|
||||
|
||||
if (opts.statement) this._printNewline(false, node, parent, 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 (!t.isEmptyStatement(node)) {
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.print(node, parent);
|
||||
}
|
||||
|
||||
_printTrailingComments(node) {
|
||||
this._printComments(this._getComments(false, node));
|
||||
}
|
||||
|
||||
_printLeadingComments(node) {
|
||||
this._printComments(this._getComments(true, node), true);
|
||||
}
|
||||
|
||||
printInnerComments(node, indent = true) {
|
||||
var _node$innerComments;
|
||||
|
||||
if (!((_node$innerComments = node.innerComments) == null ? void 0 : _node$innerComments.length)) return;
|
||||
if (indent) this.indent();
|
||||
|
||||
this._printComments(node.innerComments);
|
||||
|
||||
if (indent) this.dedent();
|
||||
}
|
||||
|
||||
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(leading, node, parent, opts) {
|
||||
if (this.format.retainLines || this.format.compact) return;
|
||||
|
||||
if (this.format.concise) {
|
||||
this.space();
|
||||
return;
|
||||
}
|
||||
|
||||
let lines = 0;
|
||||
|
||||
if (this._buf.hasContent()) {
|
||||
if (!leading) lines++;
|
||||
if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0;
|
||||
const needs = leading ? n.needsWhitespaceBefore : n.needsWhitespaceAfter;
|
||||
if (needs(node, parent)) lines++;
|
||||
}
|
||||
|
||||
this.newline(lines);
|
||||
}
|
||||
|
||||
_getComments(leading, node) {
|
||||
return node && (leading ? node.leadingComments : node.trailingComments) || [];
|
||||
}
|
||||
|
||||
_printComment(comment, skipNewLines) {
|
||||
if (!this.format.shouldPrintComment(comment.value)) return;
|
||||
if (comment.ignore) return;
|
||||
if (this._printedComments.has(comment)) return;
|
||||
|
||||
this._printedComments.add(comment);
|
||||
|
||||
if (comment.start != null) {
|
||||
if (this._printedCommentStarts[comment.start]) return;
|
||||
this._printedCommentStarts[comment.start] = true;
|
||||
}
|
||||
|
||||
const isBlockComment = comment.type === "CommentBlock";
|
||||
const printNewLines = isBlockComment && !skipNewLines && !this._noLineTerminator;
|
||||
if (printNewLines && this._buf.hasContent()) this.newline(1);
|
||||
if (!this.endsWith("[") && !this.endsWith("{")) this.space();
|
||||
let val = !isBlockComment && !this._noLineTerminator ? `//${comment.value}\n` : `/*${comment.value}*/`;
|
||||
|
||||
if (isBlockComment && 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");
|
||||
}
|
||||
|
||||
const indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn());
|
||||
val = val.replace(/\n(?!$)/g, `\n${(0, _repeat.default)(" ", indentSize)}`);
|
||||
}
|
||||
|
||||
if (this.endsWith("/")) this._space();
|
||||
this.withSource("start", comment.loc, () => {
|
||||
this._append(val);
|
||||
});
|
||||
if (printNewLines) this.newline(1);
|
||||
}
|
||||
|
||||
_printComments(comments, inlinePureAnnotation) {
|
||||
if (!(comments == null ? void 0 : comments.length)) return;
|
||||
|
||||
if (inlinePureAnnotation && comments.length === 1 && PURE_ANNOTATION_RE.test(comments[0].value)) {
|
||||
this._printComment(comments[0], this._buf.hasContent() && !this.endsWith("\n"));
|
||||
} else {
|
||||
for (const comment of comments) {
|
||||
this._printComment(comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = Printer;
|
||||
Object.assign(Printer.prototype, generatorFunctions);
|
||||
|
||||
function commaSeparator() {
|
||||
this.token(",");
|
||||
this.space();
|
||||
}
|
||||
73
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/source-map.js
generated
vendored
Normal file
73
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/lib/source-map.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _sourceMap = _interopRequireDefault(require("source-map"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
class SourceMap {
|
||||
constructor(opts, code) {
|
||||
this._cachedMap = null;
|
||||
this._code = code;
|
||||
this._opts = opts;
|
||||
this._rawMappings = [];
|
||||
}
|
||||
|
||||
get() {
|
||||
if (!this._cachedMap) {
|
||||
const map = this._cachedMap = new _sourceMap.default.SourceMapGenerator({
|
||||
sourceRoot: this._opts.sourceRoot
|
||||
});
|
||||
const code = this._code;
|
||||
|
||||
if (typeof code === "string") {
|
||||
map.setSourceContent(this._opts.sourceFileName.replace(/\\/g, "/"), code);
|
||||
} else if (typeof code === "object") {
|
||||
Object.keys(code).forEach(sourceFileName => {
|
||||
map.setSourceContent(sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
|
||||
});
|
||||
}
|
||||
|
||||
this._rawMappings.forEach(mapping => map.addMapping(mapping), map);
|
||||
}
|
||||
|
||||
return this._cachedMap.toJSON();
|
||||
}
|
||||
|
||||
getRawMappings() {
|
||||
return this._rawMappings.slice();
|
||||
}
|
||||
|
||||
mark(generatedLine, generatedColumn, line, column, identifierName, filename, force) {
|
||||
if (this._lastGenLine !== generatedLine && line === null) return;
|
||||
|
||||
if (!force && this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._cachedMap = null;
|
||||
this._lastGenLine = generatedLine;
|
||||
this._lastSourceLine = line;
|
||||
this._lastSourceColumn = column;
|
||||
|
||||
this._rawMappings.push({
|
||||
name: identifierName || undefined,
|
||||
generated: {
|
||||
line: generatedLine,
|
||||
column: generatedColumn
|
||||
},
|
||||
source: line == null ? undefined : (filename || this._opts.sourceFileName).replace(/\\/g, "/"),
|
||||
original: line == null ? undefined : {
|
||||
line: line,
|
||||
column: column
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = SourceMap;
|
||||
66
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/package.json
generated
vendored
Normal file
66
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/generator/package.json
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/generator@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/generator@7.10.1",
|
||||
"_id": "@babel/generator@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-AT0YPLQw9DI21tliuJIdplVfLHya6mcGa8ctkv7n4Qv+hYacJrKmNWIteAK1P9iyLikFIAkwqJ7HAOqIDLFfgA==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/generator",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/generator@7.10.1",
|
||||
"name": "@babel/generator",
|
||||
"escapedName": "@babel%2fgenerator",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin/@babel/traverse"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"author": {
|
||||
"name": "Sebastian McKenzie",
|
||||
"email": "sebmck@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.10.1",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.13",
|
||||
"source-map": "^0.5.0"
|
||||
},
|
||||
"description": "Turns an AST into code.",
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "^7.10.1",
|
||||
"@babel/parser": "^7.10.1"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/generator",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-generator"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
@@ -1,40 +1,45 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-function-name@7.9.5",
|
||||
"/home/henry/Documents/git/Speedtest-checker"
|
||||
"@babel/helper-function-name@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/helper-function-name@7.9.5",
|
||||
"_id": "@babel/helper-function-name@7.9.5",
|
||||
"_from": "@babel/helper-function-name@7.10.1",
|
||||
"_id": "@babel/helper-function-name@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==",
|
||||
"_integrity": "sha512-fcpumwhs3YyZ/ttd5Rz0xn0TpIwVkN7X0V38B9TWNfVF42KEkhkAAuPCQ3oXmtTRtiPJrmZ0TrfS0GKF0eMaRQ==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/helper-function-name",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-function-name@7.9.5",
|
||||
"raw": "@babel/helper-function-name@7.10.1",
|
||||
"name": "@babel/helper-function-name",
|
||||
"escapedName": "@babel%2fhelper-function-name",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.9.5",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.9.5"
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin"
|
||||
"/@babel/helper-create-class-features-plugin",
|
||||
"/@babel/helper-create-class-features-plugin/@babel/traverse"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz",
|
||||
"_spec": "7.9.5",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-checker",
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/helper-get-function-arity": "^7.8.3",
|
||||
"@babel/template": "^7.8.3",
|
||||
"@babel/types": "^7.9.5"
|
||||
"@babel/helper-get-function-arity": "^7.10.1",
|
||||
"@babel/template": "^7.10.1",
|
||||
"@babel/types": "^7.10.1"
|
||||
},
|
||||
"description": "Helper function to change the property 'name' of every function",
|
||||
"gitHead": "5b97e77e030cf3853a147fdff81844ea4026219d",
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/helper-function-name",
|
||||
@@ -43,7 +48,8 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-function-name"
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-function-name"
|
||||
},
|
||||
"version": "7.9.5"
|
||||
"version": "7.10.1"
|
||||
}
|
||||
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-get-function-arity/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-get-function-arity/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-get-function-arity/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-get-function-arity/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/helper-get-function-arity
|
||||
|
||||
> Helper function to get function arity
|
||||
|
||||
See our website [@babel/helper-get-function-arity](https://babeljs.io/docs/en/next/babel-helper-get-function-arity.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/helper-get-function-arity
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-get-function-arity --dev
|
||||
```
|
||||
26
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-get-function-arity/lib/index.js
generated
vendored
Normal file
26
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-get-function-arity/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _default(node) {
|
||||
const params = node.params;
|
||||
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
const param = params[i];
|
||||
|
||||
if (t.isAssignmentPattern(param) || t.isRestElement(param)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return params.length;
|
||||
}
|
||||
52
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-get-function-arity/package.json
generated
vendored
Normal file
52
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-get-function-arity/package.json
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-get-function-arity@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/helper-get-function-arity@7.10.1",
|
||||
"_id": "@babel/helper-get-function-arity@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-F5qdXkYGOQUb0hpRaPoetF9AnsXknKjWMZ+wmsIRsp5ge5sFh4c3h1eH2pRTTuy9KKAA2+TTYomGXAtEL2fQEw==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/helper-get-function-arity",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-get-function-arity@7.10.1",
|
||||
"name": "@babel/helper-get-function-arity",
|
||||
"escapedName": "@babel%2fhelper-get-function-arity",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin/@babel/helper-function-name"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.10.1"
|
||||
},
|
||||
"description": "Helper function to get function arity",
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/helper-get-function-arity",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-get-function-arity"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-member-expression-to-functions/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-member-expression-to-functions/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-member-expression-to-functions/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-member-expression-to-functions/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/helper-member-expression-to-functions
|
||||
|
||||
> Helper function to replace certain member expressions with function calls
|
||||
|
||||
See our website [@babel/helper-member-expression-to-functions](https://babeljs.io/docs/en/next/babel-helper-member-expression-to-functions.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/helper-member-expression-to-functions
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-member-expression-to-functions --dev
|
||||
```
|
||||
313
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-member-expression-to-functions/lib/index.js
generated
vendored
Normal file
313
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-member-expression-to-functions/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,313 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = memberExpressionToFunctions;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
class AssignmentMemoiser {
|
||||
constructor() {
|
||||
this._map = new WeakMap();
|
||||
}
|
||||
|
||||
has(key) {
|
||||
return this._map.has(key);
|
||||
}
|
||||
|
||||
get(key) {
|
||||
if (!this.has(key)) return;
|
||||
|
||||
const record = this._map.get(key);
|
||||
|
||||
const {
|
||||
value
|
||||
} = record;
|
||||
record.count--;
|
||||
|
||||
if (record.count === 0) {
|
||||
return t.assignmentExpression("=", value, key);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
set(key, value, count) {
|
||||
return this._map.set(key, {
|
||||
count,
|
||||
value
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function toNonOptional(path, base) {
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
|
||||
if (path.isOptionalMemberExpression()) {
|
||||
return t.memberExpression(base, node.property, node.computed);
|
||||
}
|
||||
|
||||
if (path.isOptionalCallExpression()) {
|
||||
const callee = path.get("callee");
|
||||
|
||||
if (path.node.optional && callee.isOptionalMemberExpression()) {
|
||||
const {
|
||||
object
|
||||
} = callee.node;
|
||||
const context = path.scope.maybeGenerateMemoised(object) || object;
|
||||
callee.get("object").replaceWith(t.assignmentExpression("=", context, object));
|
||||
return t.callExpression(t.memberExpression(base, t.identifier("call")), [context, ...node.arguments]);
|
||||
}
|
||||
|
||||
return t.callExpression(base, node.arguments);
|
||||
}
|
||||
|
||||
return path.node;
|
||||
}
|
||||
|
||||
function isInDetachedTree(path) {
|
||||
while (path) {
|
||||
if (path.isProgram()) break;
|
||||
const {
|
||||
parentPath,
|
||||
container,
|
||||
listKey
|
||||
} = path;
|
||||
const parentNode = parentPath.node;
|
||||
|
||||
if (listKey) {
|
||||
if (container !== parentNode[listKey]) return true;
|
||||
} else {
|
||||
if (container !== parentNode) return true;
|
||||
}
|
||||
|
||||
path = parentPath;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const handle = {
|
||||
memoise() {},
|
||||
|
||||
handle(member) {
|
||||
const {
|
||||
node,
|
||||
parent,
|
||||
parentPath
|
||||
} = member;
|
||||
|
||||
if (member.isOptionalMemberExpression()) {
|
||||
if (isInDetachedTree(member)) return;
|
||||
const endPath = member.find(({
|
||||
node,
|
||||
parent,
|
||||
parentPath
|
||||
}) => {
|
||||
if (parentPath.isOptionalMemberExpression()) {
|
||||
return parent.optional || parent.object !== node;
|
||||
}
|
||||
|
||||
if (parentPath.isOptionalCallExpression()) {
|
||||
return node !== member.node && parent.optional || parent.callee !== node;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
const rootParentPath = endPath.parentPath;
|
||||
|
||||
if (rootParentPath.isUpdateExpression({
|
||||
argument: node
|
||||
}) || rootParentPath.isAssignmentExpression({
|
||||
left: node
|
||||
})) {
|
||||
throw member.buildCodeFrameError(`can't handle assignment`);
|
||||
}
|
||||
|
||||
if (rootParentPath.isUnaryExpression({
|
||||
operator: "delete"
|
||||
})) {
|
||||
throw member.buildCodeFrameError(`can't handle delete`);
|
||||
}
|
||||
|
||||
let startingOptional = member;
|
||||
|
||||
for (;;) {
|
||||
if (startingOptional.isOptionalMemberExpression()) {
|
||||
if (startingOptional.node.optional) break;
|
||||
startingOptional = startingOptional.get("object");
|
||||
continue;
|
||||
} else if (startingOptional.isOptionalCallExpression()) {
|
||||
if (startingOptional.node.optional) break;
|
||||
startingOptional = startingOptional.get("callee");
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new Error(`Internal error: unexpected ${startingOptional.node.type}`);
|
||||
}
|
||||
|
||||
const {
|
||||
scope
|
||||
} = member;
|
||||
const startingProp = startingOptional.isOptionalMemberExpression() ? "object" : "callee";
|
||||
const startingNode = startingOptional.node[startingProp];
|
||||
const baseNeedsMemoised = scope.maybeGenerateMemoised(startingNode);
|
||||
const baseRef = baseNeedsMemoised != null ? baseNeedsMemoised : startingNode;
|
||||
const parentIsOptionalCall = parentPath.isOptionalCallExpression({
|
||||
callee: node
|
||||
});
|
||||
startingOptional.replaceWith(toNonOptional(startingOptional, baseRef));
|
||||
|
||||
if (parentIsOptionalCall) {
|
||||
if (parent.optional) {
|
||||
parentPath.replaceWith(this.optionalCall(member, parent.arguments));
|
||||
} else {
|
||||
parentPath.replaceWith(this.call(member, parent.arguments));
|
||||
}
|
||||
} else {
|
||||
member.replaceWith(this.get(member));
|
||||
}
|
||||
|
||||
let regular = member.node;
|
||||
|
||||
for (let current = member; current !== endPath;) {
|
||||
const {
|
||||
parentPath
|
||||
} = current;
|
||||
|
||||
if (parentPath === endPath && parentIsOptionalCall && parent.optional) {
|
||||
regular = parentPath.node;
|
||||
break;
|
||||
}
|
||||
|
||||
regular = toNonOptional(parentPath, regular);
|
||||
current = parentPath;
|
||||
}
|
||||
|
||||
let context;
|
||||
const endParentPath = endPath.parentPath;
|
||||
|
||||
if (t.isMemberExpression(regular) && endParentPath.isOptionalCallExpression({
|
||||
callee: endPath.node,
|
||||
optional: true
|
||||
})) {
|
||||
const {
|
||||
object
|
||||
} = regular;
|
||||
context = member.scope.maybeGenerateMemoised(object);
|
||||
|
||||
if (context) {
|
||||
regular.object = t.assignmentExpression("=", context, object);
|
||||
}
|
||||
}
|
||||
|
||||
endPath.replaceWith(t.conditionalExpression(t.logicalExpression("||", t.binaryExpression("===", baseNeedsMemoised ? t.assignmentExpression("=", baseRef, startingNode) : baseRef, t.nullLiteral()), t.binaryExpression("===", t.cloneNode(baseRef), scope.buildUndefinedNode())), scope.buildUndefinedNode(), regular));
|
||||
|
||||
if (context) {
|
||||
const endParent = endParentPath.node;
|
||||
endParentPath.replaceWith(t.optionalCallExpression(t.optionalMemberExpression(endParent.callee, t.identifier("call"), false, true), [context, ...endParent.arguments], false));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isUpdateExpression({
|
||||
argument: node
|
||||
})) {
|
||||
if (this.simpleSet) {
|
||||
member.replaceWith(this.simpleSet(member));
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
operator,
|
||||
prefix
|
||||
} = parent;
|
||||
this.memoise(member, 2);
|
||||
const value = t.binaryExpression(operator[0], t.unaryExpression("+", this.get(member)), t.numericLiteral(1));
|
||||
|
||||
if (prefix) {
|
||||
parentPath.replaceWith(this.set(member, value));
|
||||
} else {
|
||||
const {
|
||||
scope
|
||||
} = member;
|
||||
const ref = scope.generateUidIdentifierBasedOnNode(node);
|
||||
scope.push({
|
||||
id: ref
|
||||
});
|
||||
value.left = t.assignmentExpression("=", t.cloneNode(ref), value.left);
|
||||
parentPath.replaceWith(t.sequenceExpression([this.set(member, value), t.cloneNode(ref)]));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isAssignmentExpression({
|
||||
left: node
|
||||
})) {
|
||||
if (this.simpleSet) {
|
||||
member.replaceWith(this.simpleSet(member));
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
operator,
|
||||
right
|
||||
} = parent;
|
||||
let value = right;
|
||||
|
||||
if (operator !== "=") {
|
||||
this.memoise(member, 2);
|
||||
value = t.binaryExpression(operator.slice(0, -1), this.get(member), value);
|
||||
}
|
||||
|
||||
parentPath.replaceWith(this.set(member, value));
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
parentPath.replaceWith(this.call(member, parent.arguments));
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isOptionalCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
parentPath.replaceWith(this.optionalCall(member, parent.arguments));
|
||||
return;
|
||||
}
|
||||
|
||||
if (parentPath.isObjectProperty({
|
||||
value: node
|
||||
}) && parentPath.parentPath.isObjectPattern() || parentPath.isAssignmentPattern({
|
||||
left: node
|
||||
}) && parentPath.parentPath.isObjectProperty({
|
||||
value: parent
|
||||
}) && parentPath.parentPath.parentPath.isObjectPattern() || parentPath.isArrayPattern() || parentPath.isAssignmentPattern({
|
||||
left: node
|
||||
}) && parentPath.parentPath.isArrayPattern() || parentPath.isRestElement()) {
|
||||
member.replaceWith(this.destructureSet(member));
|
||||
return;
|
||||
}
|
||||
|
||||
member.replaceWith(this.get(member));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function memberExpressionToFunctions(path, visitor, state) {
|
||||
path.traverse(visitor, Object.assign(Object.assign(Object.assign({}, handle), state), {}, {
|
||||
memoiser: new AssignmentMemoiser()
|
||||
}));
|
||||
}
|
||||
57
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-member-expression-to-functions/package.json
generated
vendored
Normal file
57
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-member-expression-to-functions/package.json
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-member-expression-to-functions@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/helper-member-expression-to-functions@7.10.1",
|
||||
"_id": "@babel/helper-member-expression-to-functions@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-u7XLXeM2n50gb6PWJ9hoO5oO7JFPaZtrh35t8RqKLT1jFKj9IWeD1zrcrYp1q1qiZTdEarfDWfTIP8nGsu0h5g==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/helper-member-expression-to-functions",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-member-expression-to-functions@7.10.1",
|
||||
"name": "@babel/helper-member-expression-to-functions",
|
||||
"escapedName": "@babel%2fhelper-member-expression-to-functions",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin",
|
||||
"/@babel/helper-create-class-features-plugin/@babel/helper-replace-supers"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"author": {
|
||||
"name": "Justin Ridgewell",
|
||||
"email": "justin@ridgewell.name"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.10.1"
|
||||
},
|
||||
"description": "Helper function to replace certain member expressions with function calls",
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/helper-member-expression-to-functions",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-member-expression-to-functions"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-optimise-call-expression/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-optimise-call-expression/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-optimise-call-expression/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-optimise-call-expression/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/helper-optimise-call-expression
|
||||
|
||||
> Helper function to optimise call expression
|
||||
|
||||
See our website [@babel/helper-optimise-call-expression](https://babeljs.io/docs/en/next/babel-helper-optimise-call-expression.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/helper-optimise-call-expression
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-optimise-call-expression --dev
|
||||
```
|
||||
26
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-optimise-call-expression/lib/index.js
generated
vendored
Normal file
26
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-optimise-call-expression/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _default(callee, thisNode, args, optional) {
|
||||
if (args.length === 1 && t.isSpreadElement(args[0]) && t.isIdentifier(args[0].argument, {
|
||||
name: "arguments"
|
||||
})) {
|
||||
return t.callExpression(t.memberExpression(callee, t.identifier("apply")), [thisNode, args[0].argument]);
|
||||
} else {
|
||||
if (optional) {
|
||||
return t.optionalCallExpression(t.optionalMemberExpression(callee, t.identifier("call"), false, true), [thisNode, ...args], false);
|
||||
}
|
||||
|
||||
return t.callExpression(t.memberExpression(callee, t.identifier("call")), [thisNode, ...args]);
|
||||
}
|
||||
}
|
||||
53
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-optimise-call-expression/package.json
generated
vendored
Normal file
53
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-optimise-call-expression/package.json
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-optimise-call-expression@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/helper-optimise-call-expression@7.10.1",
|
||||
"_id": "@babel/helper-optimise-call-expression@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-a0DjNS1prnBsoKx83dP2falChcs7p3i8VMzdrSbfLhuQra/2ENC4sbri34dz/rWmDADsmF1q5GbfaXydh0Jbjg==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/helper-optimise-call-expression",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-optimise-call-expression@7.10.1",
|
||||
"name": "@babel/helper-optimise-call-expression",
|
||||
"escapedName": "@babel%2fhelper-optimise-call-expression",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin",
|
||||
"/@babel/helper-create-class-features-plugin/@babel/helper-replace-supers"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.10.1"
|
||||
},
|
||||
"description": "Helper function to optimise call expression",
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/helper-optimise-call-expression",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-optimise-call-expression"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/helper-plugin-utils
|
||||
|
||||
> General utilities for plugins to use
|
||||
|
||||
See our website [@babel/helper-plugin-utils](https://babeljs.io/docs/en/next/babel-helper-plugin-utils.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/helper-plugin-utils
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-plugin-utils --dev
|
||||
```
|
||||
77
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/lib/index.js
generated
vendored
Normal file
77
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.declare = declare;
|
||||
|
||||
function declare(builder) {
|
||||
return (api, options, dirname) => {
|
||||
if (!api.assertVersion) {
|
||||
api = Object.assign(copyApiObject(api), {
|
||||
assertVersion(range) {
|
||||
throwVersionError(range, api.version);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return builder(api, options || {}, dirname);
|
||||
};
|
||||
}
|
||||
|
||||
function copyApiObject(api) {
|
||||
let proto = null;
|
||||
|
||||
if (typeof api.version === "string" && /^7\./.test(api.version)) {
|
||||
proto = Object.getPrototypeOf(api);
|
||||
|
||||
if (proto && (!has(proto, "version") || !has(proto, "transform") || !has(proto, "template") || !has(proto, "types"))) {
|
||||
proto = null;
|
||||
}
|
||||
}
|
||||
|
||||
return Object.assign(Object.assign({}, proto), api);
|
||||
}
|
||||
|
||||
function has(obj, key) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
function throwVersionError(range, version) {
|
||||
if (typeof range === "number") {
|
||||
if (!Number.isInteger(range)) {
|
||||
throw new Error("Expected string or integer value.");
|
||||
}
|
||||
|
||||
range = `^${range}.0.0-0`;
|
||||
}
|
||||
|
||||
if (typeof range !== "string") {
|
||||
throw new Error("Expected string or integer value.");
|
||||
}
|
||||
|
||||
const limit = Error.stackTraceLimit;
|
||||
|
||||
if (typeof limit === "number" && limit < 25) {
|
||||
Error.stackTraceLimit = 25;
|
||||
}
|
||||
|
||||
let err;
|
||||
|
||||
if (version.slice(0, 2) === "7.") {
|
||||
err = new Error(`Requires Babel "^7.0.0-beta.41", but was loaded with "${version}". ` + `You'll need to update your @babel/core version.`);
|
||||
} else {
|
||||
err = new Error(`Requires Babel "${range}", but was loaded with "${version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`);
|
||||
}
|
||||
|
||||
if (typeof limit === "number") {
|
||||
Error.stackTraceLimit = limit;
|
||||
}
|
||||
|
||||
throw Object.assign(err, {
|
||||
code: "BABEL_VERSION_UNSUPPORTED",
|
||||
version,
|
||||
range
|
||||
});
|
||||
}
|
||||
53
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/package.json
generated
vendored
Normal file
53
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/package.json
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-plugin-utils@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/helper-plugin-utils@7.10.1",
|
||||
"_id": "@babel/helper-plugin-utils@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-fvoGeXt0bJc7VMWZGCAEBEMo/HAjW2mP8apF5eXK0wSqwLAVHAISCWRoLMBMUs2kqeaG77jltVqu4Hn8Egl3nA==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/helper-plugin-utils",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-plugin-utils@7.10.1",
|
||||
"name": "@babel/helper-plugin-utils",
|
||||
"escapedName": "@babel%2fhelper-plugin-utils",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"author": {
|
||||
"name": "Logan Smyth",
|
||||
"email": "loganfsmyth@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"description": "General utilities for plugins to use",
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/helper-plugin-utils",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-plugin-utils"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
95
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/src/index.js
generated
vendored
Normal file
95
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
export function declare(builder) {
|
||||
return (api, options, dirname) => {
|
||||
if (!api.assertVersion) {
|
||||
// Inject a custom version of 'assertVersion' for Babel 6 and early
|
||||
// versions of Babel 7's beta that didn't have it.
|
||||
api = Object.assign(copyApiObject(api), {
|
||||
assertVersion(range) {
|
||||
throwVersionError(range, api.version);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return builder(api, options || {}, dirname);
|
||||
};
|
||||
}
|
||||
|
||||
function copyApiObject(api) {
|
||||
// Babel >= 7 <= beta.41 passed the API as a new object that had
|
||||
// babel/core as the prototype. While slightly faster, it also
|
||||
// means that the Object.assign copy below fails. Rather than
|
||||
// keep complexity, the Babel 6 behavior has been reverted and this
|
||||
// normalizes all that for Babel 7.
|
||||
let proto = null;
|
||||
if (typeof api.version === "string" && /^7\./.test(api.version)) {
|
||||
proto = Object.getPrototypeOf(api);
|
||||
if (
|
||||
proto &&
|
||||
(!has(proto, "version") ||
|
||||
!has(proto, "transform") ||
|
||||
!has(proto, "template") ||
|
||||
!has(proto, "types"))
|
||||
) {
|
||||
proto = null;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...proto,
|
||||
...api,
|
||||
};
|
||||
}
|
||||
|
||||
function has(obj, key) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
function throwVersionError(range, version) {
|
||||
if (typeof range === "number") {
|
||||
if (!Number.isInteger(range)) {
|
||||
throw new Error("Expected string or integer value.");
|
||||
}
|
||||
range = `^${range}.0.0-0`;
|
||||
}
|
||||
if (typeof range !== "string") {
|
||||
throw new Error("Expected string or integer value.");
|
||||
}
|
||||
|
||||
const limit = Error.stackTraceLimit;
|
||||
|
||||
if (typeof limit === "number" && limit < 25) {
|
||||
// Bump up the limit if needed so that users are more likely
|
||||
// to be able to see what is calling Babel.
|
||||
Error.stackTraceLimit = 25;
|
||||
}
|
||||
|
||||
let err;
|
||||
if (version.slice(0, 2) === "7.") {
|
||||
err = new Error(
|
||||
`Requires Babel "^7.0.0-beta.41", but was loaded with "${version}". ` +
|
||||
`You'll need to update your @babel/core version.`,
|
||||
);
|
||||
} else {
|
||||
err = new Error(
|
||||
`Requires Babel "${range}", but was loaded with "${version}". ` +
|
||||
`If you are sure you have a compatible version of @babel/core, ` +
|
||||
`it is likely that something in your build process is loading the ` +
|
||||
`wrong version. Inspect the stack trace of this error to look for ` +
|
||||
`the first entry that doesn't mention "@babel/core" or "babel-core" ` +
|
||||
`to see what is calling Babel.`,
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof limit === "number") {
|
||||
Error.stackTraceLimit = limit;
|
||||
}
|
||||
|
||||
throw Object.assign(
|
||||
err,
|
||||
({
|
||||
code: "BABEL_VERSION_UNSUPPORTED",
|
||||
version,
|
||||
range,
|
||||
}: any),
|
||||
);
|
||||
}
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-replace-supers/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-replace-supers/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-replace-supers/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-replace-supers/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/helper-replace-supers
|
||||
|
||||
> Helper function to replace supers
|
||||
|
||||
See our website [@babel/helper-replace-supers](https://babeljs.io/docs/en/next/babel-helper-replace-supers.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/helper-replace-supers
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-replace-supers --dev
|
||||
```
|
||||
245
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-replace-supers/lib/index.js
generated
vendored
Normal file
245
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-replace-supers/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,245 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.skipAllButComputedKey = skipAllButComputedKey;
|
||||
exports.default = exports.environmentVisitor = void 0;
|
||||
|
||||
var _traverse = _interopRequireDefault(require("@babel/traverse"));
|
||||
|
||||
var _helperMemberExpressionToFunctions = _interopRequireDefault(require("@babel/helper-member-expression-to-functions"));
|
||||
|
||||
var _helperOptimiseCallExpression = _interopRequireDefault(require("@babel/helper-optimise-call-expression"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) {
|
||||
objectRef = t.cloneNode(objectRef);
|
||||
const targetRef = isStatic || isPrivateMethod ? objectRef : t.memberExpression(objectRef, t.identifier("prototype"));
|
||||
return t.callExpression(file.addHelper("getPrototypeOf"), [targetRef]);
|
||||
}
|
||||
|
||||
function skipAllButComputedKey(path) {
|
||||
if (!path.node.computed) {
|
||||
path.skip();
|
||||
return;
|
||||
}
|
||||
|
||||
const keys = t.VISITOR_KEYS[path.type];
|
||||
|
||||
for (const key of keys) {
|
||||
if (key !== "key") path.skipKey(key);
|
||||
}
|
||||
}
|
||||
|
||||
const environmentVisitor = {
|
||||
TypeAnnotation(path) {
|
||||
path.skip();
|
||||
},
|
||||
|
||||
Function(path) {
|
||||
if (path.isMethod()) return;
|
||||
if (path.isArrowFunctionExpression()) return;
|
||||
path.skip();
|
||||
},
|
||||
|
||||
"Method|ClassProperty|ClassPrivateProperty"(path) {
|
||||
skipAllButComputedKey(path);
|
||||
}
|
||||
|
||||
};
|
||||
exports.environmentVisitor = environmentVisitor;
|
||||
|
||||
const visitor = _traverse.default.visitors.merge([environmentVisitor, {
|
||||
Super(path, state) {
|
||||
const {
|
||||
node,
|
||||
parentPath
|
||||
} = path;
|
||||
if (!parentPath.isMemberExpression({
|
||||
object: node
|
||||
})) return;
|
||||
state.handle(parentPath);
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
const specHandlers = {
|
||||
memoise(superMember, count) {
|
||||
const {
|
||||
scope,
|
||||
node
|
||||
} = superMember;
|
||||
const {
|
||||
computed,
|
||||
property
|
||||
} = node;
|
||||
|
||||
if (!computed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const memo = scope.maybeGenerateMemoised(property);
|
||||
|
||||
if (!memo) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.memoiser.set(property, memo, count);
|
||||
},
|
||||
|
||||
prop(superMember) {
|
||||
const {
|
||||
computed,
|
||||
property
|
||||
} = superMember.node;
|
||||
|
||||
if (this.memoiser.has(property)) {
|
||||
return t.cloneNode(this.memoiser.get(property));
|
||||
}
|
||||
|
||||
if (computed) {
|
||||
return t.cloneNode(property);
|
||||
}
|
||||
|
||||
return t.stringLiteral(property.name);
|
||||
},
|
||||
|
||||
get(superMember) {
|
||||
return this._get(superMember, this._getThisRefs());
|
||||
},
|
||||
|
||||
_get(superMember, thisRefs) {
|
||||
const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod);
|
||||
return t.callExpression(this.file.addHelper("get"), [thisRefs.memo ? t.sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), thisRefs.this]);
|
||||
},
|
||||
|
||||
_getThisRefs() {
|
||||
if (!this.isDerivedConstructor) {
|
||||
return {
|
||||
this: t.thisExpression()
|
||||
};
|
||||
}
|
||||
|
||||
const thisRef = this.scope.generateDeclaredUidIdentifier("thisSuper");
|
||||
return {
|
||||
memo: t.assignmentExpression("=", thisRef, t.thisExpression()),
|
||||
this: t.cloneNode(thisRef)
|
||||
};
|
||||
},
|
||||
|
||||
set(superMember, value) {
|
||||
const thisRefs = this._getThisRefs();
|
||||
|
||||
const proto = getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod);
|
||||
return t.callExpression(this.file.addHelper("set"), [thisRefs.memo ? t.sequenceExpression([thisRefs.memo, proto]) : proto, this.prop(superMember), value, thisRefs.this, t.booleanLiteral(superMember.isInStrictMode())]);
|
||||
},
|
||||
|
||||
destructureSet(superMember) {
|
||||
throw superMember.buildCodeFrameError(`Destructuring to a super field is not supported yet.`);
|
||||
},
|
||||
|
||||
call(superMember, args) {
|
||||
const thisRefs = this._getThisRefs();
|
||||
|
||||
return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), t.cloneNode(thisRefs.this), args, false);
|
||||
}
|
||||
|
||||
};
|
||||
const looseHandlers = Object.assign(Object.assign({}, specHandlers), {}, {
|
||||
prop(superMember) {
|
||||
const {
|
||||
property
|
||||
} = superMember.node;
|
||||
|
||||
if (this.memoiser.has(property)) {
|
||||
return t.cloneNode(this.memoiser.get(property));
|
||||
}
|
||||
|
||||
return t.cloneNode(property);
|
||||
},
|
||||
|
||||
get(superMember) {
|
||||
const {
|
||||
isStatic,
|
||||
superRef
|
||||
} = this;
|
||||
const {
|
||||
computed
|
||||
} = superMember.node;
|
||||
const prop = this.prop(superMember);
|
||||
let object;
|
||||
|
||||
if (isStatic) {
|
||||
object = superRef ? t.cloneNode(superRef) : t.memberExpression(t.identifier("Function"), t.identifier("prototype"));
|
||||
} else {
|
||||
object = superRef ? t.memberExpression(t.cloneNode(superRef), t.identifier("prototype")) : t.memberExpression(t.identifier("Object"), t.identifier("prototype"));
|
||||
}
|
||||
|
||||
return t.memberExpression(object, prop, computed);
|
||||
},
|
||||
|
||||
set(superMember, value) {
|
||||
const {
|
||||
computed
|
||||
} = superMember.node;
|
||||
const prop = this.prop(superMember);
|
||||
return t.assignmentExpression("=", t.memberExpression(t.thisExpression(), prop, computed), value);
|
||||
},
|
||||
|
||||
destructureSet(superMember) {
|
||||
const {
|
||||
computed
|
||||
} = superMember.node;
|
||||
const prop = this.prop(superMember);
|
||||
return t.memberExpression(t.thisExpression(), prop, computed);
|
||||
},
|
||||
|
||||
call(superMember, args) {
|
||||
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args, false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
class ReplaceSupers {
|
||||
constructor(opts) {
|
||||
const path = opts.methodPath;
|
||||
this.methodPath = path;
|
||||
this.isDerivedConstructor = path.isClassMethod({
|
||||
kind: "constructor"
|
||||
}) && !!opts.superRef;
|
||||
this.isStatic = path.isObjectMethod() || path.node.static;
|
||||
this.isPrivateMethod = path.isPrivate() && path.isMethod();
|
||||
this.file = opts.file;
|
||||
this.superRef = opts.superRef;
|
||||
this.isLoose = opts.isLoose;
|
||||
this.opts = opts;
|
||||
}
|
||||
|
||||
getObjectRef() {
|
||||
return t.cloneNode(this.opts.objectRef || this.opts.getObjectRef());
|
||||
}
|
||||
|
||||
replace() {
|
||||
const handler = this.isLoose ? looseHandlers : specHandlers;
|
||||
(0, _helperMemberExpressionToFunctions.default)(this.methodPath, visitor, Object.assign({
|
||||
file: this.file,
|
||||
scope: this.methodPath.scope,
|
||||
isDerivedConstructor: this.isDerivedConstructor,
|
||||
isStatic: this.isStatic,
|
||||
isPrivateMethod: this.isPrivateMethod,
|
||||
getObjectRef: this.getObjectRef.bind(this),
|
||||
superRef: this.superRef
|
||||
}, handler));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = ReplaceSupers;
|
||||
55
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-replace-supers/package.json
generated
vendored
Normal file
55
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-replace-supers/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-replace-supers@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/helper-replace-supers@7.10.1",
|
||||
"_id": "@babel/helper-replace-supers@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-SOwJzEfpuQwInzzQJGjGaiG578UYmyi2Xw668klPWV5n07B73S0a9btjLk/52Mlcxa+5AdIYqws1KyXRfMoB7A==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/helper-replace-supers",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-replace-supers@7.10.1",
|
||||
"name": "@babel/helper-replace-supers",
|
||||
"escapedName": "@babel%2fhelper-replace-supers",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/helper-member-expression-to-functions": "^7.10.1",
|
||||
"@babel/helper-optimise-call-expression": "^7.10.1",
|
||||
"@babel/traverse": "^7.10.1",
|
||||
"@babel/types": "^7.10.1"
|
||||
},
|
||||
"description": "Helper function to replace supers",
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/helper-replace-supers",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-replace-supers"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/helper-split-export-declaration
|
||||
|
||||
>
|
||||
|
||||
See our website [@babel/helper-split-export-declaration](https://babeljs.io/docs/en/next/babel-helper-split-export-declaration.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/helper-split-export-declaration
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-split-export-declaration --dev
|
||||
```
|
||||
62
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration/lib/index.js
generated
vendored
Normal file
62
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = splitExportDeclaration;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function splitExportDeclaration(exportDeclaration) {
|
||||
if (!exportDeclaration.isExportDeclaration()) {
|
||||
throw new Error("Only export declarations can be splitted.");
|
||||
}
|
||||
|
||||
const isDefault = exportDeclaration.isExportDefaultDeclaration();
|
||||
const declaration = exportDeclaration.get("declaration");
|
||||
const isClassDeclaration = declaration.isClassDeclaration();
|
||||
|
||||
if (isDefault) {
|
||||
const standaloneDeclaration = declaration.isFunctionDeclaration() || isClassDeclaration;
|
||||
const scope = declaration.isScope() ? declaration.scope.parent : declaration.scope;
|
||||
let id = declaration.node.id;
|
||||
let needBindingRegistration = false;
|
||||
|
||||
if (!id) {
|
||||
needBindingRegistration = true;
|
||||
id = scope.generateUidIdentifier("default");
|
||||
|
||||
if (standaloneDeclaration || declaration.isFunctionExpression() || declaration.isClassExpression()) {
|
||||
declaration.node.id = t.cloneNode(id);
|
||||
}
|
||||
}
|
||||
|
||||
const updatedDeclaration = standaloneDeclaration ? declaration : t.variableDeclaration("var", [t.variableDeclarator(t.cloneNode(id), declaration.node)]);
|
||||
const updatedExportDeclaration = t.exportNamedDeclaration(null, [t.exportSpecifier(t.cloneNode(id), t.identifier("default"))]);
|
||||
exportDeclaration.insertAfter(updatedExportDeclaration);
|
||||
exportDeclaration.replaceWith(updatedDeclaration);
|
||||
|
||||
if (needBindingRegistration) {
|
||||
scope.registerDeclaration(exportDeclaration);
|
||||
}
|
||||
|
||||
return exportDeclaration;
|
||||
}
|
||||
|
||||
if (exportDeclaration.get("specifiers").length > 0) {
|
||||
throw new Error("It doesn't make sense to split exported specifiers.");
|
||||
}
|
||||
|
||||
const bindingIdentifiers = declaration.getOuterBindingIdentifiers();
|
||||
const specifiers = Object.keys(bindingIdentifiers).map(name => {
|
||||
return t.exportSpecifier(t.identifier(name), t.identifier(name));
|
||||
});
|
||||
const aliasDeclar = t.exportNamedDeclaration(null, specifiers);
|
||||
exportDeclaration.insertAfter(aliasDeclar);
|
||||
exportDeclaration.replaceWith(declaration.node);
|
||||
return exportDeclaration;
|
||||
}
|
||||
53
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration/package.json
generated
vendored
Normal file
53
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration/package.json
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-split-export-declaration@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/helper-split-export-declaration@7.10.1",
|
||||
"_id": "@babel/helper-split-export-declaration@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/helper-split-export-declaration",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-split-export-declaration@7.10.1",
|
||||
"name": "@babel/helper-split-export-declaration",
|
||||
"escapedName": "@babel%2fhelper-split-export-declaration",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin",
|
||||
"/@babel/helper-create-class-features-plugin/@babel/traverse"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.10.1"
|
||||
},
|
||||
"description": ">",
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/helper-split-export-declaration",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-split-export-declaration"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
@@ -1,40 +1,45 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-validator-identifier@7.9.5",
|
||||
"/home/henry/Documents/git/Speedtest-checker"
|
||||
"@babel/helper-validator-identifier@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/helper-validator-identifier@7.9.5",
|
||||
"_id": "@babel/helper-validator-identifier@7.9.5",
|
||||
"_from": "@babel/helper-validator-identifier@7.10.1",
|
||||
"_id": "@babel/helper-validator-identifier@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==",
|
||||
"_integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/helper-validator-identifier",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-validator-identifier@7.9.5",
|
||||
"raw": "@babel/helper-validator-identifier@7.10.1",
|
||||
"name": "@babel/helper-validator-identifier",
|
||||
"escapedName": "@babel%2fhelper-validator-identifier",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.9.5",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.9.5"
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin/@babel/highlight",
|
||||
"/@babel/helper-create-class-features-plugin/@babel/types"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz",
|
||||
"_spec": "7.9.5",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-checker",
|
||||
"_resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"description": "Validate identifier/keywords name",
|
||||
"devDependencies": {
|
||||
"charcodes": "^0.2.0",
|
||||
"unicode-13.0.0": "^0.8.0"
|
||||
},
|
||||
"exports": "./lib/index.js",
|
||||
"gitHead": "5b97e77e030cf3853a147fdff81844ea4026219d",
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"name": "@babel/helper-validator-identifier",
|
||||
@@ -43,7 +48,8 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-validator-identifier"
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-validator-identifier"
|
||||
},
|
||||
"version": "7.9.5"
|
||||
"version": "7.10.1"
|
||||
}
|
||||
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/highlight/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/highlight/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/highlight/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/highlight/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/highlight
|
||||
|
||||
> Syntax highlight JavaScript strings for output in terminals.
|
||||
|
||||
See our website [@babel/highlight](https://babeljs.io/docs/en/next/babel-highlight.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/highlight
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/highlight --dev
|
||||
```
|
||||
107
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/highlight/lib/index.js
generated
vendored
Normal file
107
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/highlight/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.shouldHighlight = shouldHighlight;
|
||||
exports.getChalk = getChalk;
|
||||
exports.default = highlight;
|
||||
|
||||
var _jsTokens = _interopRequireWildcard(require("js-tokens"));
|
||||
|
||||
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
|
||||
|
||||
var _chalk = _interopRequireDefault(require("chalk"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function getDefs(chalk) {
|
||||
return {
|
||||
keyword: chalk.cyan,
|
||||
capitalized: chalk.yellow,
|
||||
jsx_tag: chalk.yellow,
|
||||
punctuator: chalk.yellow,
|
||||
number: chalk.magenta,
|
||||
string: chalk.green,
|
||||
regex: chalk.magenta,
|
||||
comment: chalk.grey,
|
||||
invalid: chalk.white.bgRed.bold
|
||||
};
|
||||
}
|
||||
|
||||
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||
const JSX_TAG = /^[a-z][\w-]*$/i;
|
||||
const BRACKET = /^[()[\]{}]$/;
|
||||
|
||||
function getTokenType(match) {
|
||||
const [offset, text] = match.slice(-2);
|
||||
const token = (0, _jsTokens.matchToToken)(match);
|
||||
|
||||
if (token.type === "name") {
|
||||
if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) {
|
||||
return "keyword";
|
||||
}
|
||||
|
||||
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
|
||||
return "jsx_tag";
|
||||
}
|
||||
|
||||
if (token.value[0] !== token.value[0].toLowerCase()) {
|
||||
return "capitalized";
|
||||
}
|
||||
}
|
||||
|
||||
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
||||
return "bracket";
|
||||
}
|
||||
|
||||
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
||||
return "punctuator";
|
||||
}
|
||||
|
||||
return token.type;
|
||||
}
|
||||
|
||||
function highlightTokens(defs, text) {
|
||||
return text.replace(_jsTokens.default, function (...args) {
|
||||
const type = getTokenType(args);
|
||||
const colorize = defs[type];
|
||||
|
||||
if (colorize) {
|
||||
return args[0].split(NEWLINE).map(str => colorize(str)).join("\n");
|
||||
} else {
|
||||
return args[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function shouldHighlight(options) {
|
||||
return _chalk.default.supportsColor || options.forceColor;
|
||||
}
|
||||
|
||||
function getChalk(options) {
|
||||
let chalk = _chalk.default;
|
||||
|
||||
if (options.forceColor) {
|
||||
chalk = new _chalk.default.constructor({
|
||||
enabled: true,
|
||||
level: 1
|
||||
});
|
||||
}
|
||||
|
||||
return chalk;
|
||||
}
|
||||
|
||||
function highlight(code, options = {}) {
|
||||
if (shouldHighlight(options)) {
|
||||
const chalk = getChalk(options);
|
||||
const defs = getDefs(chalk);
|
||||
return highlightTokens(defs, code);
|
||||
} else {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
61
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/highlight/package.json
generated
vendored
Normal file
61
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/highlight/package.json
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/highlight@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/highlight@7.10.1",
|
||||
"_id": "@babel/highlight@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/highlight",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/highlight@7.10.1",
|
||||
"name": "@babel/highlight",
|
||||
"escapedName": "@babel%2fhighlight",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin/@babel/code-frame"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"author": {
|
||||
"name": "suchipi",
|
||||
"email": "me@suchipi.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": "^7.10.1",
|
||||
"chalk": "^2.0.0",
|
||||
"js-tokens": "^4.0.0"
|
||||
},
|
||||
"description": "Syntax highlight JavaScript strings for output in terminals.",
|
||||
"devDependencies": {
|
||||
"strip-ansi": "^4.0.0"
|
||||
},
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/highlight",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-highlight"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
1073
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/CHANGELOG.md
generated
vendored
Normal file
1073
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/CHANGELOG.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/LICENSE
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/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/next/babel-parser.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/bin/babel-parser.js
generated
vendored
Executable file
15
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/bin/babel-parser.js
generated
vendored
Executable 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, " "));
|
||||
}
|
||||
12868
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/lib/index.js
generated
vendored
Normal file
12868
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/lib/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/lib/index.js.map
generated
vendored
Normal file
1
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
80
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/package.json
generated
vendored
Normal file
80
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/package.json
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/parser@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/parser@7.10.1",
|
||||
"_id": "@babel/parser@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/parser",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/parser@7.10.1",
|
||||
"name": "@babel/parser",
|
||||
"escapedName": "@babel%2fparser",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin/@babel/template",
|
||||
"/@babel/helper-create-class-features-plugin/@babel/traverse"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"author": {
|
||||
"name": "Sebastian McKenzie",
|
||||
"email": "sebmck@gmail.com"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"description": "A JavaScript parser",
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.10.1",
|
||||
"@babel/helper-fixtures": "^7.10.1",
|
||||
"@babel/helper-validator-identifier": "^7.10.1",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"lib",
|
||||
"typings"
|
||||
],
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"keywords": [
|
||||
"babel",
|
||||
"javascript",
|
||||
"parser",
|
||||
"tc39",
|
||||
"ecmascript",
|
||||
"@babel/parser"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/parser",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-parser"
|
||||
},
|
||||
"types": "typings/babel-parser.d.ts",
|
||||
"version": "7.10.1"
|
||||
}
|
||||
148
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/typings/babel-parser.d.ts
generated
vendored
Normal file
148
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/parser/typings/babel-parser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
// Type definitions for @babel/parser
|
||||
// Project: https://github.com/babel/babel/tree/master/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.
|
||||
*/
|
||||
export function parse(input: string, options?: ParserOptions): import('@babel/types').File;
|
||||
|
||||
/**
|
||||
* Parse the provided code as a single expression.
|
||||
*/
|
||||
export function parseExpression(input: string, options?: ParserOptions): import('@babel/types').Expression;
|
||||
|
||||
export 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;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
export type ParserPlugin =
|
||||
'asyncGenerators' |
|
||||
'bigInt' |
|
||||
'classPrivateMethods' |
|
||||
'classPrivateProperties' |
|
||||
'classProperties' |
|
||||
'decorators' |
|
||||
'decorators-legacy' |
|
||||
'doExpressions' |
|
||||
'dynamicImport' |
|
||||
'estree' |
|
||||
'exportDefaultFrom' |
|
||||
'exportNamespaceFrom' | // deprecated
|
||||
'flow' |
|
||||
'flowComments' |
|
||||
'functionBind' |
|
||||
'functionSent' |
|
||||
'importMeta' |
|
||||
'jsx' |
|
||||
'logicalAssignment' |
|
||||
'moduleAttributes' |
|
||||
'nullishCoalescingOperator' |
|
||||
'numericSeparator' |
|
||||
'objectRestSpread' |
|
||||
'optionalCatchBinding' |
|
||||
'optionalChaining' |
|
||||
'partialApplication' |
|
||||
'pipelineOperator' |
|
||||
'placeholders' |
|
||||
'privateIn' |
|
||||
'throwExpressions' |
|
||||
'topLevelAwait' |
|
||||
'typescript' |
|
||||
'v8intrinsic' |
|
||||
ParserPluginWithOptions;
|
||||
|
||||
export type ParserPluginWithOptions =
|
||||
['decorators', DecoratorsPluginOptions] |
|
||||
['pipelineOperator', PipelineOperatorPluginOptions] |
|
||||
['flow', FlowPluginOptions];
|
||||
|
||||
export interface DecoratorsPluginOptions {
|
||||
decoratorsBeforeExport?: boolean;
|
||||
}
|
||||
|
||||
export interface PipelineOperatorPluginOptions {
|
||||
proposal: 'minimal' | 'smart';
|
||||
}
|
||||
|
||||
export interface FlowPluginOptions {
|
||||
all?: boolean;
|
||||
}
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/template
|
||||
|
||||
> Generate an AST from a string template.
|
||||
|
||||
See our website [@babel/template](https://babeljs.io/docs/en/next/babel-template.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20template%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/template
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/template --dev
|
||||
```
|
||||
83
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/builder.js
generated
vendored
Normal file
83
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/builder.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createTemplateBuilder;
|
||||
|
||||
var _options = require("./options");
|
||||
|
||||
var _string = _interopRequireDefault(require("./string"));
|
||||
|
||||
var _literal = _interopRequireDefault(require("./literal"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const NO_PLACEHOLDER = (0, _options.validate)({
|
||||
placeholderPattern: false
|
||||
});
|
||||
|
||||
function createTemplateBuilder(formatter, defaultOpts) {
|
||||
const templateFnCache = new WeakMap();
|
||||
const templateAstCache = new WeakMap();
|
||||
const cachedOpts = defaultOpts || (0, _options.validate)(null);
|
||||
return Object.assign((tpl, ...args) => {
|
||||
if (typeof tpl === "string") {
|
||||
if (args.length > 1) throw new Error("Unexpected extra params.");
|
||||
return extendedTrace((0, _string.default)(formatter, tpl, (0, _options.merge)(cachedOpts, (0, _options.validate)(args[0]))));
|
||||
} else if (Array.isArray(tpl)) {
|
||||
let builder = templateFnCache.get(tpl);
|
||||
|
||||
if (!builder) {
|
||||
builder = (0, _literal.default)(formatter, tpl, cachedOpts);
|
||||
templateFnCache.set(tpl, builder);
|
||||
}
|
||||
|
||||
return extendedTrace(builder(args));
|
||||
} else if (typeof tpl === "object" && tpl) {
|
||||
if (args.length > 0) throw new Error("Unexpected extra params.");
|
||||
return createTemplateBuilder(formatter, (0, _options.merge)(cachedOpts, (0, _options.validate)(tpl)));
|
||||
}
|
||||
|
||||
throw new Error(`Unexpected template param ${typeof tpl}`);
|
||||
}, {
|
||||
ast: (tpl, ...args) => {
|
||||
if (typeof tpl === "string") {
|
||||
if (args.length > 1) throw new Error("Unexpected extra params.");
|
||||
return (0, _string.default)(formatter, tpl, (0, _options.merge)((0, _options.merge)(cachedOpts, (0, _options.validate)(args[0])), NO_PLACEHOLDER))();
|
||||
} else if (Array.isArray(tpl)) {
|
||||
let builder = templateAstCache.get(tpl);
|
||||
|
||||
if (!builder) {
|
||||
builder = (0, _literal.default)(formatter, tpl, (0, _options.merge)(cachedOpts, NO_PLACEHOLDER));
|
||||
templateAstCache.set(tpl, builder);
|
||||
}
|
||||
|
||||
return builder(args)();
|
||||
}
|
||||
|
||||
throw new Error(`Unexpected template param ${typeof tpl}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function extendedTrace(fn) {
|
||||
let rootStack = "";
|
||||
|
||||
try {
|
||||
throw new Error();
|
||||
} catch (error) {
|
||||
if (error.stack) {
|
||||
rootStack = error.stack.split("\n").slice(3).join("\n");
|
||||
}
|
||||
}
|
||||
|
||||
return arg => {
|
||||
try {
|
||||
return fn(arg);
|
||||
} catch (err) {
|
||||
err.stack += `\n =============\n${rootStack}`;
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
}
|
||||
63
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/formatters.js
generated
vendored
Normal file
63
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/formatters.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.program = exports.expression = exports.statement = exports.statements = exports.smart = void 0;
|
||||
|
||||
function makeStatementFormatter(fn) {
|
||||
return {
|
||||
code: str => `/* @babel/template */;\n${str}`,
|
||||
validate: () => {},
|
||||
unwrap: ast => {
|
||||
return fn(ast.program.body.slice(1));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const smart = makeStatementFormatter(body => {
|
||||
if (body.length > 1) {
|
||||
return body;
|
||||
} else {
|
||||
return body[0];
|
||||
}
|
||||
});
|
||||
exports.smart = smart;
|
||||
const statements = makeStatementFormatter(body => body);
|
||||
exports.statements = statements;
|
||||
const statement = makeStatementFormatter(body => {
|
||||
if (body.length === 0) {
|
||||
throw new Error("Found nothing to return.");
|
||||
}
|
||||
|
||||
if (body.length > 1) {
|
||||
throw new Error("Found multiple statements but wanted one");
|
||||
}
|
||||
|
||||
return body[0];
|
||||
});
|
||||
exports.statement = statement;
|
||||
const expression = {
|
||||
code: str => `(\n${str}\n)`,
|
||||
validate: ({
|
||||
program
|
||||
}) => {
|
||||
if (program.body.length > 1) {
|
||||
throw new Error("Found multiple statements but wanted one");
|
||||
}
|
||||
|
||||
const expression = program.body[0].expression;
|
||||
|
||||
if (expression.start === 0) {
|
||||
throw new Error("Parse result included parens.");
|
||||
}
|
||||
},
|
||||
unwrap: ast => ast.program.body[0].expression
|
||||
};
|
||||
exports.expression = expression;
|
||||
const program = {
|
||||
code: str => str,
|
||||
validate: () => {},
|
||||
unwrap: ast => ast.program
|
||||
};
|
||||
exports.program = program;
|
||||
38
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/index.js
generated
vendored
Normal file
38
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = exports.program = exports.expression = exports.statements = exports.statement = exports.smart = void 0;
|
||||
|
||||
var formatters = _interopRequireWildcard(require("./formatters"));
|
||||
|
||||
var _builder = _interopRequireDefault(require("./builder"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const smart = (0, _builder.default)(formatters.smart);
|
||||
exports.smart = smart;
|
||||
const statement = (0, _builder.default)(formatters.statement);
|
||||
exports.statement = statement;
|
||||
const statements = (0, _builder.default)(formatters.statements);
|
||||
exports.statements = statements;
|
||||
const expression = (0, _builder.default)(formatters.expression);
|
||||
exports.expression = expression;
|
||||
const program = (0, _builder.default)(formatters.program);
|
||||
exports.program = program;
|
||||
|
||||
var _default = Object.assign(smart.bind(undefined), {
|
||||
smart,
|
||||
statement,
|
||||
statements,
|
||||
expression,
|
||||
program,
|
||||
ast: smart.ast
|
||||
});
|
||||
|
||||
exports.default = _default;
|
||||
82
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/literal.js
generated
vendored
Normal file
82
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/literal.js
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = literalTemplate;
|
||||
|
||||
var _options = require("./options");
|
||||
|
||||
var _parse = _interopRequireDefault(require("./parse"));
|
||||
|
||||
var _populate = _interopRequireDefault(require("./populate"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function literalTemplate(formatter, tpl, opts) {
|
||||
const {
|
||||
metadata,
|
||||
names
|
||||
} = buildLiteralData(formatter, tpl, opts);
|
||||
return arg => {
|
||||
const defaultReplacements = arg.reduce((acc, replacement, i) => {
|
||||
acc[names[i]] = replacement;
|
||||
return acc;
|
||||
}, {});
|
||||
return arg => {
|
||||
const replacements = (0, _options.normalizeReplacements)(arg);
|
||||
|
||||
if (replacements) {
|
||||
Object.keys(replacements).forEach(key => {
|
||||
if (Object.prototype.hasOwnProperty.call(defaultReplacements, key)) {
|
||||
throw new Error("Unexpected replacement overlap.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return formatter.unwrap((0, _populate.default)(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
function buildLiteralData(formatter, tpl, opts) {
|
||||
let names;
|
||||
let nameSet;
|
||||
let metadata;
|
||||
let prefix = "";
|
||||
|
||||
do {
|
||||
prefix += "$";
|
||||
const result = buildTemplateCode(tpl, prefix);
|
||||
names = result.names;
|
||||
nameSet = new Set(names);
|
||||
metadata = (0, _parse.default)(formatter, formatter.code(result.code), {
|
||||
parser: opts.parser,
|
||||
placeholderWhitelist: new Set(result.names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])),
|
||||
placeholderPattern: opts.placeholderPattern,
|
||||
preserveComments: opts.preserveComments,
|
||||
syntacticPlaceholders: opts.syntacticPlaceholders
|
||||
});
|
||||
} while (metadata.placeholders.some(placeholder => placeholder.isDuplicate && nameSet.has(placeholder.name)));
|
||||
|
||||
return {
|
||||
metadata,
|
||||
names
|
||||
};
|
||||
}
|
||||
|
||||
function buildTemplateCode(tpl, prefix) {
|
||||
const names = [];
|
||||
let code = tpl[0];
|
||||
|
||||
for (let i = 1; i < tpl.length; i++) {
|
||||
const value = `${prefix}${i - 1}`;
|
||||
names.push(value);
|
||||
code += value + tpl[i];
|
||||
}
|
||||
|
||||
return {
|
||||
names,
|
||||
code
|
||||
};
|
||||
}
|
||||
82
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/options.js
generated
vendored
Normal file
82
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/options.js
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.merge = merge;
|
||||
exports.validate = validate;
|
||||
exports.normalizeReplacements = normalizeReplacements;
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function merge(a, b) {
|
||||
const {
|
||||
placeholderWhitelist = a.placeholderWhitelist,
|
||||
placeholderPattern = a.placeholderPattern,
|
||||
preserveComments = a.preserveComments,
|
||||
syntacticPlaceholders = a.syntacticPlaceholders
|
||||
} = b;
|
||||
return {
|
||||
parser: Object.assign(Object.assign({}, a.parser), b.parser),
|
||||
placeholderWhitelist,
|
||||
placeholderPattern,
|
||||
preserveComments,
|
||||
syntacticPlaceholders
|
||||
};
|
||||
}
|
||||
|
||||
function validate(opts) {
|
||||
if (opts != null && typeof opts !== "object") {
|
||||
throw new Error("Unknown template options.");
|
||||
}
|
||||
|
||||
const _ref = opts || {},
|
||||
{
|
||||
placeholderWhitelist,
|
||||
placeholderPattern,
|
||||
preserveComments,
|
||||
syntacticPlaceholders
|
||||
} = _ref,
|
||||
parser = _objectWithoutPropertiesLoose(_ref, ["placeholderWhitelist", "placeholderPattern", "preserveComments", "syntacticPlaceholders"]);
|
||||
|
||||
if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) {
|
||||
throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");
|
||||
}
|
||||
|
||||
if (placeholderPattern != null && !(placeholderPattern instanceof RegExp) && placeholderPattern !== false) {
|
||||
throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");
|
||||
}
|
||||
|
||||
if (preserveComments != null && typeof preserveComments !== "boolean") {
|
||||
throw new Error("'.preserveComments' must be a boolean, null, or undefined");
|
||||
}
|
||||
|
||||
if (syntacticPlaceholders != null && typeof syntacticPlaceholders !== "boolean") {
|
||||
throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined");
|
||||
}
|
||||
|
||||
if (syntacticPlaceholders === true && (placeholderWhitelist != null || placeholderPattern != null)) {
|
||||
throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'");
|
||||
}
|
||||
|
||||
return {
|
||||
parser,
|
||||
placeholderWhitelist: placeholderWhitelist || undefined,
|
||||
placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern,
|
||||
preserveComments: preserveComments == null ? undefined : preserveComments,
|
||||
syntacticPlaceholders: syntacticPlaceholders == null ? undefined : syntacticPlaceholders
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeReplacements(replacements) {
|
||||
if (Array.isArray(replacements)) {
|
||||
return replacements.reduce((acc, replacement, i) => {
|
||||
acc["$" + i] = replacement;
|
||||
return acc;
|
||||
}, {});
|
||||
} else if (typeof replacements === "object" || replacements == null) {
|
||||
return replacements || undefined;
|
||||
}
|
||||
|
||||
throw new Error("Template replacements must be an array, object, null, or undefined");
|
||||
}
|
||||
173
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/parse.js
generated
vendored
Normal file
173
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/parse.js
generated
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = parseAndBuildMetadata;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _parser = require("@babel/parser");
|
||||
|
||||
var _codeFrame = require("@babel/code-frame");
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const PATTERN = /^[_$A-Z0-9]+$/;
|
||||
|
||||
function parseAndBuildMetadata(formatter, code, opts) {
|
||||
const ast = parseWithCodeFrame(code, opts.parser);
|
||||
const {
|
||||
placeholderWhitelist,
|
||||
placeholderPattern,
|
||||
preserveComments,
|
||||
syntacticPlaceholders
|
||||
} = opts;
|
||||
t.removePropertiesDeep(ast, {
|
||||
preserveComments
|
||||
});
|
||||
formatter.validate(ast);
|
||||
const syntactic = {
|
||||
placeholders: [],
|
||||
placeholderNames: new Set()
|
||||
};
|
||||
const legacy = {
|
||||
placeholders: [],
|
||||
placeholderNames: new Set()
|
||||
};
|
||||
const isLegacyRef = {
|
||||
value: undefined
|
||||
};
|
||||
t.traverse(ast, placeholderVisitorHandler, {
|
||||
syntactic,
|
||||
legacy,
|
||||
isLegacyRef,
|
||||
placeholderWhitelist,
|
||||
placeholderPattern,
|
||||
syntacticPlaceholders
|
||||
});
|
||||
return Object.assign({
|
||||
ast
|
||||
}, isLegacyRef.value ? legacy : syntactic);
|
||||
}
|
||||
|
||||
function placeholderVisitorHandler(node, ancestors, state) {
|
||||
var _state$placeholderWhi;
|
||||
|
||||
let name;
|
||||
|
||||
if (t.isPlaceholder(node)) {
|
||||
if (state.syntacticPlaceholders === false) {
|
||||
throw new Error("%%foo%%-style placeholders can't be used when " + "'.syntacticPlaceholders' is false.");
|
||||
} else {
|
||||
name = node.name.name;
|
||||
state.isLegacyRef.value = false;
|
||||
}
|
||||
} else if (state.isLegacyRef.value === false || state.syntacticPlaceholders) {
|
||||
return;
|
||||
} else if (t.isIdentifier(node) || t.isJSXIdentifier(node)) {
|
||||
name = node.name;
|
||||
state.isLegacyRef.value = true;
|
||||
} else if (t.isStringLiteral(node)) {
|
||||
name = node.value;
|
||||
state.isLegacyRef.value = true;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!state.isLegacyRef.value && (state.placeholderPattern != null || state.placeholderWhitelist != null)) {
|
||||
throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'");
|
||||
}
|
||||
|
||||
if (state.isLegacyRef.value && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && !((_state$placeholderWhi = state.placeholderWhitelist) == null ? void 0 : _state$placeholderWhi.has(name))) {
|
||||
return;
|
||||
}
|
||||
|
||||
ancestors = ancestors.slice();
|
||||
const {
|
||||
node: parent,
|
||||
key
|
||||
} = ancestors[ancestors.length - 1];
|
||||
let type;
|
||||
|
||||
if (t.isStringLiteral(node) || t.isPlaceholder(node, {
|
||||
expectedNode: "StringLiteral"
|
||||
})) {
|
||||
type = "string";
|
||||
} else if (t.isNewExpression(parent) && key === "arguments" || t.isCallExpression(parent) && key === "arguments" || t.isFunction(parent) && key === "params") {
|
||||
type = "param";
|
||||
} else if (t.isExpressionStatement(parent) && !t.isPlaceholder(node)) {
|
||||
type = "statement";
|
||||
ancestors = ancestors.slice(0, -1);
|
||||
} else if (t.isStatement(node) && t.isPlaceholder(node)) {
|
||||
type = "statement";
|
||||
} else {
|
||||
type = "other";
|
||||
}
|
||||
|
||||
const {
|
||||
placeholders,
|
||||
placeholderNames
|
||||
} = state.isLegacyRef.value ? state.legacy : state.syntactic;
|
||||
placeholders.push({
|
||||
name,
|
||||
type,
|
||||
resolve: ast => resolveAncestors(ast, ancestors),
|
||||
isDuplicate: placeholderNames.has(name)
|
||||
});
|
||||
placeholderNames.add(name);
|
||||
}
|
||||
|
||||
function resolveAncestors(ast, ancestors) {
|
||||
let parent = ast;
|
||||
|
||||
for (let i = 0; i < ancestors.length - 1; i++) {
|
||||
const {
|
||||
key,
|
||||
index
|
||||
} = ancestors[i];
|
||||
|
||||
if (index === undefined) {
|
||||
parent = parent[key];
|
||||
} else {
|
||||
parent = parent[key][index];
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
key,
|
||||
index
|
||||
} = ancestors[ancestors.length - 1];
|
||||
return {
|
||||
parent,
|
||||
key,
|
||||
index
|
||||
};
|
||||
}
|
||||
|
||||
function parseWithCodeFrame(code, parserOpts) {
|
||||
parserOpts = Object.assign(Object.assign({
|
||||
allowReturnOutsideFunction: true,
|
||||
allowSuperOutsideMethod: true,
|
||||
sourceType: "module"
|
||||
}, parserOpts), {}, {
|
||||
plugins: (parserOpts.plugins || []).concat("placeholders")
|
||||
});
|
||||
|
||||
try {
|
||||
return (0, _parser.parse)(code, parserOpts);
|
||||
} catch (err) {
|
||||
const loc = err.loc;
|
||||
|
||||
if (loc) {
|
||||
err.message += "\n" + (0, _codeFrame.codeFrameColumns)(code, {
|
||||
start: loc
|
||||
});
|
||||
err.code = "BABEL_TEMPLATE_PARSE_ERROR";
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
127
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/populate.js
generated
vendored
Normal file
127
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/populate.js
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = populatePlaceholders;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function populatePlaceholders(metadata, replacements) {
|
||||
const ast = t.cloneNode(metadata.ast);
|
||||
|
||||
if (replacements) {
|
||||
metadata.placeholders.forEach(placeholder => {
|
||||
if (!Object.prototype.hasOwnProperty.call(replacements, placeholder.name)) {
|
||||
const placeholderName = placeholder.name;
|
||||
throw new Error(`Error: No substitution given for "${placeholderName}". If this is not meant to be a
|
||||
placeholder you may want to consider passing one of the following options to @babel/template:
|
||||
- { placeholderPattern: false, placeholderWhitelist: new Set(['${placeholderName}'])}
|
||||
- { placeholderPattern: /^${placeholderName}$/ }`);
|
||||
}
|
||||
});
|
||||
Object.keys(replacements).forEach(key => {
|
||||
if (!metadata.placeholderNames.has(key)) {
|
||||
throw new Error(`Unknown substitution "${key}" given`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
metadata.placeholders.slice().reverse().forEach(placeholder => {
|
||||
try {
|
||||
applyReplacement(placeholder, ast, replacements && replacements[placeholder.name] || null);
|
||||
} catch (e) {
|
||||
e.message = `@babel/template placeholder "${placeholder.name}": ${e.message}`;
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
return ast;
|
||||
}
|
||||
|
||||
function applyReplacement(placeholder, ast, replacement) {
|
||||
if (placeholder.isDuplicate) {
|
||||
if (Array.isArray(replacement)) {
|
||||
replacement = replacement.map(node => t.cloneNode(node));
|
||||
} else if (typeof replacement === "object") {
|
||||
replacement = t.cloneNode(replacement);
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
parent,
|
||||
key,
|
||||
index
|
||||
} = placeholder.resolve(ast);
|
||||
|
||||
if (placeholder.type === "string") {
|
||||
if (typeof replacement === "string") {
|
||||
replacement = t.stringLiteral(replacement);
|
||||
}
|
||||
|
||||
if (!replacement || !t.isStringLiteral(replacement)) {
|
||||
throw new Error("Expected string substitution");
|
||||
}
|
||||
} else if (placeholder.type === "statement") {
|
||||
if (index === undefined) {
|
||||
if (!replacement) {
|
||||
replacement = t.emptyStatement();
|
||||
} else if (Array.isArray(replacement)) {
|
||||
replacement = t.blockStatement(replacement);
|
||||
} else if (typeof replacement === "string") {
|
||||
replacement = t.expressionStatement(t.identifier(replacement));
|
||||
} else if (!t.isStatement(replacement)) {
|
||||
replacement = t.expressionStatement(replacement);
|
||||
}
|
||||
} else {
|
||||
if (replacement && !Array.isArray(replacement)) {
|
||||
if (typeof replacement === "string") {
|
||||
replacement = t.identifier(replacement);
|
||||
}
|
||||
|
||||
if (!t.isStatement(replacement)) {
|
||||
replacement = t.expressionStatement(replacement);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (placeholder.type === "param") {
|
||||
if (typeof replacement === "string") {
|
||||
replacement = t.identifier(replacement);
|
||||
}
|
||||
|
||||
if (index === undefined) throw new Error("Assertion failure.");
|
||||
} else {
|
||||
if (typeof replacement === "string") {
|
||||
replacement = t.identifier(replacement);
|
||||
}
|
||||
|
||||
if (Array.isArray(replacement)) {
|
||||
throw new Error("Cannot replace single expression with an array.");
|
||||
}
|
||||
}
|
||||
|
||||
if (index === undefined) {
|
||||
t.validate(parent, key, replacement);
|
||||
parent[key] = replacement;
|
||||
} else {
|
||||
const items = parent[key].slice();
|
||||
|
||||
if (placeholder.type === "statement" || placeholder.type === "param") {
|
||||
if (replacement == null) {
|
||||
items.splice(index, 1);
|
||||
} else if (Array.isArray(replacement)) {
|
||||
items.splice(index, 1, ...replacement);
|
||||
} else {
|
||||
items[index] = replacement;
|
||||
}
|
||||
} else {
|
||||
items[index] = replacement;
|
||||
}
|
||||
|
||||
t.validate(parent, key, items);
|
||||
parent[key] = items;
|
||||
}
|
||||
}
|
||||
24
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/string.js
generated
vendored
Normal file
24
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/lib/string.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = stringTemplate;
|
||||
|
||||
var _options = require("./options");
|
||||
|
||||
var _parse = _interopRequireDefault(require("./parse"));
|
||||
|
||||
var _populate = _interopRequireDefault(require("./populate"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function stringTemplate(formatter, code, opts) {
|
||||
code = formatter.code(code);
|
||||
let metadata;
|
||||
return arg => {
|
||||
const replacements = (0, _options.normalizeReplacements)(arg);
|
||||
if (!metadata) metadata = (0, _parse.default)(formatter, code, opts);
|
||||
return formatter.unwrap((0, _populate.default)(metadata, replacements));
|
||||
};
|
||||
}
|
||||
58
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/package.json
generated
vendored
Normal file
58
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/template/package.json
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/template@7.10.1",
|
||||
"/home/henry/Documents/git/Speedtest-tracker-docker/conf/site"
|
||||
]
|
||||
],
|
||||
"_from": "@babel/template@7.10.1",
|
||||
"_id": "@babel/template@7.10.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==",
|
||||
"_location": "/@babel/helper-create-class-features-plugin/@babel/template",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/template@7.10.1",
|
||||
"name": "@babel/template",
|
||||
"escapedName": "@babel%2ftemplate",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/helper-create-class-features-plugin/@babel/helper-function-name"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz",
|
||||
"_spec": "7.10.1",
|
||||
"_where": "/home/henry/Documents/git/Speedtest-tracker-docker/conf/site",
|
||||
"author": {
|
||||
"name": "Sebastian McKenzie",
|
||||
"email": "sebmck@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.10.1",
|
||||
"@babel/parser": "^7.10.1",
|
||||
"@babel/types": "^7.10.1"
|
||||
},
|
||||
"description": "Generate an AST from a string template.",
|
||||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/template",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-template"
|
||||
},
|
||||
"version": "7.10.1"
|
||||
}
|
||||
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/LICENSE
generated
vendored
Normal file
22
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/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
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/README.md
generated
vendored
Normal file
19
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/traverse
|
||||
|
||||
> The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes
|
||||
|
||||
See our website [@babel/traverse](https://babeljs.io/docs/en/next/babel-traverse.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20traverse%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/traverse
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/traverse --dev
|
||||
```
|
||||
26
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/cache.js
generated
vendored
Normal file
26
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/cache.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.clear = clear;
|
||||
exports.clearPath = clearPath;
|
||||
exports.clearScope = clearScope;
|
||||
exports.scope = exports.path = void 0;
|
||||
let path = new WeakMap();
|
||||
exports.path = path;
|
||||
let scope = new WeakMap();
|
||||
exports.scope = scope;
|
||||
|
||||
function clear() {
|
||||
clearPath();
|
||||
clearScope();
|
||||
}
|
||||
|
||||
function clearPath() {
|
||||
exports.path = path = new WeakMap();
|
||||
}
|
||||
|
||||
function clearScope() {
|
||||
exports.scope = scope = new WeakMap();
|
||||
}
|
||||
146
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/context.js
generated
vendored
Normal file
146
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/context.js
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _path = _interopRequireDefault(require("./path"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const testing = process.env.NODE_ENV === "test";
|
||||
|
||||
class TraversalContext {
|
||||
constructor(scope, opts, state, parentPath) {
|
||||
this.queue = null;
|
||||
this.parentPath = parentPath;
|
||||
this.scope = scope;
|
||||
this.state = state;
|
||||
this.opts = opts;
|
||||
}
|
||||
|
||||
shouldVisit(node) {
|
||||
const opts = this.opts;
|
||||
if (opts.enter || opts.exit) return true;
|
||||
if (opts[node.type]) return true;
|
||||
const keys = t.VISITOR_KEYS[node.type];
|
||||
if (!(keys == null ? void 0 : keys.length)) return false;
|
||||
|
||||
for (const key of keys) {
|
||||
if (node[key]) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
create(node, obj, key, listKey) {
|
||||
return _path.default.get({
|
||||
parentPath: this.parentPath,
|
||||
parent: node,
|
||||
container: obj,
|
||||
key: key,
|
||||
listKey
|
||||
});
|
||||
}
|
||||
|
||||
maybeQueue(path, notPriority) {
|
||||
if (this.trap) {
|
||||
throw new Error("Infinite cycle detected");
|
||||
}
|
||||
|
||||
if (this.queue) {
|
||||
if (notPriority) {
|
||||
this.queue.push(path);
|
||||
} else {
|
||||
this.priorityQueue.push(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
visitMultiple(container, parent, listKey) {
|
||||
if (container.length === 0) return false;
|
||||
const queue = [];
|
||||
|
||||
for (let key = 0; key < container.length; key++) {
|
||||
const node = container[key];
|
||||
|
||||
if (node && this.shouldVisit(node)) {
|
||||
queue.push(this.create(parent, container, key, listKey));
|
||||
}
|
||||
}
|
||||
|
||||
return this.visitQueue(queue);
|
||||
}
|
||||
|
||||
visitSingle(node, key) {
|
||||
if (this.shouldVisit(node[key])) {
|
||||
return this.visitQueue([this.create(node, node, key)]);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
visitQueue(queue) {
|
||||
this.queue = queue;
|
||||
this.priorityQueue = [];
|
||||
const visited = [];
|
||||
let stop = false;
|
||||
|
||||
for (const path of queue) {
|
||||
path.resync();
|
||||
|
||||
if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
|
||||
path.pushContext(this);
|
||||
}
|
||||
|
||||
if (path.key === null) continue;
|
||||
|
||||
if (testing && queue.length >= 10000) {
|
||||
this.trap = true;
|
||||
}
|
||||
|
||||
if (visited.indexOf(path.node) >= 0) continue;
|
||||
visited.push(path.node);
|
||||
|
||||
if (path.visit()) {
|
||||
stop = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.priorityQueue.length) {
|
||||
stop = this.visitQueue(this.priorityQueue);
|
||||
this.priorityQueue = [];
|
||||
this.queue = queue;
|
||||
if (stop) break;
|
||||
}
|
||||
}
|
||||
|
||||
for (const path of queue) {
|
||||
path.popContext();
|
||||
}
|
||||
|
||||
this.queue = null;
|
||||
return stop;
|
||||
}
|
||||
|
||||
visit(node, key) {
|
||||
const nodes = node[key];
|
||||
if (!nodes) return false;
|
||||
|
||||
if (Array.isArray(nodes)) {
|
||||
return this.visitMultiple(nodes, node, key);
|
||||
} else {
|
||||
return this.visitSingle(node, key);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = TraversalContext;
|
||||
23
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/hub.js
generated
vendored
Normal file
23
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/hub.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
class Hub {
|
||||
getCode() {}
|
||||
|
||||
getScope() {}
|
||||
|
||||
addHelper() {
|
||||
throw new Error("Helpers are not supported by the default hub.");
|
||||
}
|
||||
|
||||
buildError(node, msg, Error = TypeError) {
|
||||
return new Error(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = Hub;
|
||||
120
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/index.js
generated
vendored
Normal file
120
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = traverse;
|
||||
Object.defineProperty(exports, "NodePath", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _path.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "Scope", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _scope.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "Hub", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _hub.default;
|
||||
}
|
||||
});
|
||||
exports.visitors = void 0;
|
||||
|
||||
var _context = _interopRequireDefault(require("./context"));
|
||||
|
||||
var visitors = _interopRequireWildcard(require("./visitors"));
|
||||
|
||||
exports.visitors = visitors;
|
||||
|
||||
var _includes = _interopRequireDefault(require("lodash/includes"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var cache = _interopRequireWildcard(require("./cache"));
|
||||
|
||||
var _path = _interopRequireDefault(require("./path"));
|
||||
|
||||
var _scope = _interopRequireDefault(require("./scope"));
|
||||
|
||||
var _hub = _interopRequireDefault(require("./hub"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function traverse(parent, opts, scope, state, parentPath) {
|
||||
if (!parent) return;
|
||||
if (!opts) opts = {};
|
||||
|
||||
if (!opts.noScope && !scope) {
|
||||
if (parent.type !== "Program" && parent.type !== "File") {
|
||||
throw new Error("You must pass a scope and parentPath unless traversing a Program/File. " + `Instead of that you tried to traverse a ${parent.type} node without ` + "passing scope and parentPath.");
|
||||
}
|
||||
}
|
||||
|
||||
if (!t.VISITOR_KEYS[parent.type]) {
|
||||
return;
|
||||
}
|
||||
|
||||
visitors.explode(opts);
|
||||
traverse.node(parent, opts, scope, state, parentPath);
|
||||
}
|
||||
|
||||
traverse.visitors = visitors;
|
||||
traverse.verify = visitors.verify;
|
||||
traverse.explode = visitors.explode;
|
||||
|
||||
traverse.cheap = function (node, enter) {
|
||||
return t.traverseFast(node, enter);
|
||||
};
|
||||
|
||||
traverse.node = function (node, opts, scope, state, parentPath, skipKeys) {
|
||||
const keys = t.VISITOR_KEYS[node.type];
|
||||
if (!keys) return;
|
||||
const context = new _context.default(scope, opts, state, parentPath);
|
||||
|
||||
for (const key of keys) {
|
||||
if (skipKeys && skipKeys[key]) continue;
|
||||
if (context.visit(node, key)) return;
|
||||
}
|
||||
};
|
||||
|
||||
traverse.clearNode = function (node, opts) {
|
||||
t.removeProperties(node, opts);
|
||||
cache.path.delete(node);
|
||||
};
|
||||
|
||||
traverse.removeProperties = function (tree, opts) {
|
||||
t.traverseFast(tree, traverse.clearNode, opts);
|
||||
return tree;
|
||||
};
|
||||
|
||||
function hasBlacklistedType(path, state) {
|
||||
if (path.node.type === state.type) {
|
||||
state.has = true;
|
||||
path.stop();
|
||||
}
|
||||
}
|
||||
|
||||
traverse.hasType = function (tree, type, blacklistTypes) {
|
||||
if ((0, _includes.default)(blacklistTypes, tree.type)) return false;
|
||||
if (tree.type === type) return true;
|
||||
const state = {
|
||||
has: false,
|
||||
type: type
|
||||
};
|
||||
traverse(tree, {
|
||||
noScope: true,
|
||||
blacklist: blacklistTypes,
|
||||
enter: hasBlacklistedType
|
||||
}, null, state);
|
||||
return state.has;
|
||||
};
|
||||
|
||||
traverse.cache = cache;
|
||||
182
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/ancestry.js
generated
vendored
Normal file
182
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/ancestry.js
generated
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findParent = findParent;
|
||||
exports.find = find;
|
||||
exports.getFunctionParent = getFunctionParent;
|
||||
exports.getStatementParent = getStatementParent;
|
||||
exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom;
|
||||
exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom;
|
||||
exports.getAncestry = getAncestry;
|
||||
exports.isAncestor = isAncestor;
|
||||
exports.isDescendant = isDescendant;
|
||||
exports.inType = inType;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _index = _interopRequireDefault(require("./index"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function findParent(callback) {
|
||||
let path = this;
|
||||
|
||||
while (path = path.parentPath) {
|
||||
if (callback(path)) return path;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function find(callback) {
|
||||
let path = this;
|
||||
|
||||
do {
|
||||
if (callback(path)) return path;
|
||||
} while (path = path.parentPath);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getFunctionParent() {
|
||||
return this.findParent(p => p.isFunction());
|
||||
}
|
||||
|
||||
function getStatementParent() {
|
||||
let path = this;
|
||||
|
||||
do {
|
||||
if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
|
||||
break;
|
||||
} else {
|
||||
path = path.parentPath;
|
||||
}
|
||||
} while (path);
|
||||
|
||||
if (path && (path.isProgram() || path.isFile())) {
|
||||
throw new Error("File/Program node, we can't possibly find a statement parent to this");
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
function getEarliestCommonAncestorFrom(paths) {
|
||||
return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) {
|
||||
let earliest;
|
||||
const keys = t.VISITOR_KEYS[deepest.type];
|
||||
|
||||
for (const ancestry of ancestries) {
|
||||
const path = ancestry[i + 1];
|
||||
|
||||
if (!earliest) {
|
||||
earliest = path;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (path.listKey && earliest.listKey === path.listKey) {
|
||||
if (path.key < earliest.key) {
|
||||
earliest = path;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
const earliestKeyIndex = keys.indexOf(earliest.parentKey);
|
||||
const currentKeyIndex = keys.indexOf(path.parentKey);
|
||||
|
||||
if (earliestKeyIndex > currentKeyIndex) {
|
||||
earliest = path;
|
||||
}
|
||||
}
|
||||
|
||||
return earliest;
|
||||
});
|
||||
}
|
||||
|
||||
function getDeepestCommonAncestorFrom(paths, filter) {
|
||||
if (!paths.length) {
|
||||
return this;
|
||||
}
|
||||
|
||||
if (paths.length === 1) {
|
||||
return paths[0];
|
||||
}
|
||||
|
||||
let minDepth = Infinity;
|
||||
let lastCommonIndex, lastCommon;
|
||||
const ancestries = paths.map(path => {
|
||||
const ancestry = [];
|
||||
|
||||
do {
|
||||
ancestry.unshift(path);
|
||||
} while ((path = path.parentPath) && path !== this);
|
||||
|
||||
if (ancestry.length < minDepth) {
|
||||
minDepth = ancestry.length;
|
||||
}
|
||||
|
||||
return ancestry;
|
||||
});
|
||||
const first = ancestries[0];
|
||||
|
||||
depthLoop: for (let i = 0; i < minDepth; i++) {
|
||||
const shouldMatch = first[i];
|
||||
|
||||
for (const ancestry of ancestries) {
|
||||
if (ancestry[i] !== shouldMatch) {
|
||||
break depthLoop;
|
||||
}
|
||||
}
|
||||
|
||||
lastCommonIndex = i;
|
||||
lastCommon = shouldMatch;
|
||||
}
|
||||
|
||||
if (lastCommon) {
|
||||
if (filter) {
|
||||
return filter(lastCommon, lastCommonIndex, ancestries);
|
||||
} else {
|
||||
return lastCommon;
|
||||
}
|
||||
} else {
|
||||
throw new Error("Couldn't find intersection");
|
||||
}
|
||||
}
|
||||
|
||||
function getAncestry() {
|
||||
let path = this;
|
||||
const paths = [];
|
||||
|
||||
do {
|
||||
paths.push(path);
|
||||
} while (path = path.parentPath);
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
function isAncestor(maybeDescendant) {
|
||||
return maybeDescendant.isDescendant(this);
|
||||
}
|
||||
|
||||
function isDescendant(maybeAncestor) {
|
||||
return !!this.findParent(parent => parent === maybeAncestor);
|
||||
}
|
||||
|
||||
function inType() {
|
||||
let path = this;
|
||||
|
||||
while (path) {
|
||||
for (const type of arguments) {
|
||||
if (path.node.type === type) return true;
|
||||
}
|
||||
|
||||
path = path.parentPath;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
41
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/comments.js
generated
vendored
Normal file
41
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/comments.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.shareCommentsWithSiblings = shareCommentsWithSiblings;
|
||||
exports.addComment = addComment;
|
||||
exports.addComments = addComments;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function shareCommentsWithSiblings() {
|
||||
if (typeof this.key === "string") return;
|
||||
const node = this.node;
|
||||
if (!node) return;
|
||||
const trailing = node.trailingComments;
|
||||
const leading = node.leadingComments;
|
||||
if (!trailing && !leading) return;
|
||||
const prev = this.getSibling(this.key - 1);
|
||||
const next = this.getSibling(this.key + 1);
|
||||
const hasPrev = Boolean(prev.node);
|
||||
const hasNext = Boolean(next.node);
|
||||
|
||||
if (hasPrev && !hasNext) {
|
||||
prev.addComments("trailing", trailing);
|
||||
} else if (hasNext && !hasPrev) {
|
||||
next.addComments("leading", leading);
|
||||
}
|
||||
}
|
||||
|
||||
function addComment(type, content, line) {
|
||||
t.addComment(this.node, type, content, line);
|
||||
}
|
||||
|
||||
function addComments(type, comments) {
|
||||
t.addComments(this.node, type, comments);
|
||||
}
|
||||
251
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/context.js
generated
vendored
Normal file
251
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/context.js
generated
vendored
Normal file
@@ -0,0 +1,251 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.call = call;
|
||||
exports._call = _call;
|
||||
exports.isBlacklisted = isBlacklisted;
|
||||
exports.visit = visit;
|
||||
exports.skip = skip;
|
||||
exports.skipKey = skipKey;
|
||||
exports.stop = stop;
|
||||
exports.setScope = setScope;
|
||||
exports.setContext = setContext;
|
||||
exports.resync = resync;
|
||||
exports._resyncParent = _resyncParent;
|
||||
exports._resyncKey = _resyncKey;
|
||||
exports._resyncList = _resyncList;
|
||||
exports._resyncRemoved = _resyncRemoved;
|
||||
exports.popContext = popContext;
|
||||
exports.pushContext = pushContext;
|
||||
exports.setup = setup;
|
||||
exports.setKey = setKey;
|
||||
exports.requeue = requeue;
|
||||
exports._getQueueContexts = _getQueueContexts;
|
||||
|
||||
var _index = _interopRequireDefault(require("../index"));
|
||||
|
||||
var _index2 = require("./index");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function call(key) {
|
||||
const opts = this.opts;
|
||||
this.debug(key);
|
||||
|
||||
if (this.node) {
|
||||
if (this._call(opts[key])) return true;
|
||||
}
|
||||
|
||||
if (this.node) {
|
||||
return this._call(opts[this.node.type] && opts[this.node.type][key]);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function _call(fns) {
|
||||
if (!fns) return false;
|
||||
|
||||
for (const fn of fns) {
|
||||
if (!fn) continue;
|
||||
const node = this.node;
|
||||
if (!node) return true;
|
||||
const ret = fn.call(this.state, this, this.state);
|
||||
|
||||
if (ret && typeof ret === "object" && typeof ret.then === "function") {
|
||||
throw new Error(`You appear to be using a plugin with an async traversal visitor, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
throw new Error(`Unexpected return value from visitor method ${fn}`);
|
||||
}
|
||||
|
||||
if (this.node !== node) return true;
|
||||
if (this._traverseFlags > 0) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isBlacklisted() {
|
||||
const blacklist = this.opts.blacklist;
|
||||
return blacklist && blacklist.indexOf(this.node.type) > -1;
|
||||
}
|
||||
|
||||
function visit() {
|
||||
if (!this.node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isBlacklisted()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.opts.shouldSkip && this.opts.shouldSkip(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.shouldSkip || this.call("enter") || this.shouldSkip) {
|
||||
this.debug("Skip...");
|
||||
return this.shouldStop;
|
||||
}
|
||||
|
||||
this.debug("Recursing into...");
|
||||
|
||||
_index.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys);
|
||||
|
||||
this.call("exit");
|
||||
return this.shouldStop;
|
||||
}
|
||||
|
||||
function skip() {
|
||||
this.shouldSkip = true;
|
||||
}
|
||||
|
||||
function skipKey(key) {
|
||||
if (this.skipKeys == null) {
|
||||
this.skipKeys = {};
|
||||
}
|
||||
|
||||
this.skipKeys[key] = true;
|
||||
}
|
||||
|
||||
function stop() {
|
||||
this._traverseFlags |= _index2.SHOULD_SKIP | _index2.SHOULD_STOP;
|
||||
}
|
||||
|
||||
function setScope() {
|
||||
if (this.opts && this.opts.noScope) return;
|
||||
let path = this.parentPath;
|
||||
let target;
|
||||
|
||||
while (path && !target) {
|
||||
if (path.opts && path.opts.noScope) return;
|
||||
target = path.scope;
|
||||
path = path.parentPath;
|
||||
}
|
||||
|
||||
this.scope = this.getScope(target);
|
||||
if (this.scope) this.scope.init();
|
||||
}
|
||||
|
||||
function setContext(context) {
|
||||
if (this.skipKeys != null) {
|
||||
this.skipKeys = {};
|
||||
}
|
||||
|
||||
this._traverseFlags = 0;
|
||||
|
||||
if (context) {
|
||||
this.context = context;
|
||||
this.state = context.state;
|
||||
this.opts = context.opts;
|
||||
}
|
||||
|
||||
this.setScope();
|
||||
return this;
|
||||
}
|
||||
|
||||
function resync() {
|
||||
if (this.removed) return;
|
||||
|
||||
this._resyncParent();
|
||||
|
||||
this._resyncList();
|
||||
|
||||
this._resyncKey();
|
||||
}
|
||||
|
||||
function _resyncParent() {
|
||||
if (this.parentPath) {
|
||||
this.parent = this.parentPath.node;
|
||||
}
|
||||
}
|
||||
|
||||
function _resyncKey() {
|
||||
if (!this.container) return;
|
||||
if (this.node === this.container[this.key]) return;
|
||||
|
||||
if (Array.isArray(this.container)) {
|
||||
for (let i = 0; i < this.container.length; i++) {
|
||||
if (this.container[i] === this.node) {
|
||||
return this.setKey(i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (const key of Object.keys(this.container)) {
|
||||
if (this.container[key] === this.node) {
|
||||
return this.setKey(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.key = null;
|
||||
}
|
||||
|
||||
function _resyncList() {
|
||||
if (!this.parent || !this.inList) return;
|
||||
const newContainer = this.parent[this.listKey];
|
||||
if (this.container === newContainer) return;
|
||||
this.container = newContainer || null;
|
||||
}
|
||||
|
||||
function _resyncRemoved() {
|
||||
if (this.key == null || !this.container || this.container[this.key] !== this.node) {
|
||||
this._markRemoved();
|
||||
}
|
||||
}
|
||||
|
||||
function popContext() {
|
||||
this.contexts.pop();
|
||||
|
||||
if (this.contexts.length > 0) {
|
||||
this.setContext(this.contexts[this.contexts.length - 1]);
|
||||
} else {
|
||||
this.setContext(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
function pushContext(context) {
|
||||
this.contexts.push(context);
|
||||
this.setContext(context);
|
||||
}
|
||||
|
||||
function setup(parentPath, container, listKey, key) {
|
||||
this.listKey = listKey;
|
||||
this.container = container;
|
||||
this.parentPath = parentPath || this.parentPath;
|
||||
this.setKey(key);
|
||||
}
|
||||
|
||||
function setKey(key) {
|
||||
var _this$node;
|
||||
|
||||
this.key = key;
|
||||
this.node = this.container[this.key];
|
||||
this.type = (_this$node = this.node) == null ? void 0 : _this$node.type;
|
||||
}
|
||||
|
||||
function requeue(pathToQueue = this) {
|
||||
if (pathToQueue.removed) return;
|
||||
const contexts = this.contexts;
|
||||
|
||||
for (const context of contexts) {
|
||||
context.maybeQueue(pathToQueue);
|
||||
}
|
||||
}
|
||||
|
||||
function _getQueueContexts() {
|
||||
let path = this;
|
||||
let contexts = this.contexts;
|
||||
|
||||
while (!contexts.length) {
|
||||
path = path.parentPath;
|
||||
if (!path) break;
|
||||
contexts = path.contexts;
|
||||
}
|
||||
|
||||
return contexts;
|
||||
}
|
||||
428
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/conversion.js
generated
vendored
Normal file
428
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/conversion.js
generated
vendored
Normal file
@@ -0,0 +1,428 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.toComputedKey = toComputedKey;
|
||||
exports.ensureBlock = ensureBlock;
|
||||
exports.arrowFunctionToShadowed = arrowFunctionToShadowed;
|
||||
exports.unwrapFunctionEnvironment = unwrapFunctionEnvironment;
|
||||
exports.arrowFunctionToExpression = arrowFunctionToExpression;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _helperFunctionName = _interopRequireDefault(require("@babel/helper-function-name"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function toComputedKey() {
|
||||
const node = this.node;
|
||||
let key;
|
||||
|
||||
if (this.isMemberExpression()) {
|
||||
key = node.property;
|
||||
} else if (this.isProperty() || this.isMethod()) {
|
||||
key = node.key;
|
||||
} else {
|
||||
throw new ReferenceError("todo");
|
||||
}
|
||||
|
||||
if (!node.computed) {
|
||||
if (t.isIdentifier(key)) key = t.stringLiteral(key.name);
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
function ensureBlock() {
|
||||
const body = this.get("body");
|
||||
const bodyNode = body.node;
|
||||
|
||||
if (Array.isArray(body)) {
|
||||
throw new Error("Can't convert array path to a block statement");
|
||||
}
|
||||
|
||||
if (!bodyNode) {
|
||||
throw new Error("Can't convert node without a body");
|
||||
}
|
||||
|
||||
if (body.isBlockStatement()) {
|
||||
return bodyNode;
|
||||
}
|
||||
|
||||
const statements = [];
|
||||
let stringPath = "body";
|
||||
let key;
|
||||
let listKey;
|
||||
|
||||
if (body.isStatement()) {
|
||||
listKey = "body";
|
||||
key = 0;
|
||||
statements.push(body.node);
|
||||
} else {
|
||||
stringPath += ".body.0";
|
||||
|
||||
if (this.isFunction()) {
|
||||
key = "argument";
|
||||
statements.push(t.returnStatement(body.node));
|
||||
} else {
|
||||
key = "expression";
|
||||
statements.push(t.expressionStatement(body.node));
|
||||
}
|
||||
}
|
||||
|
||||
this.node.body = t.blockStatement(statements);
|
||||
const parentPath = this.get(stringPath);
|
||||
body.setup(parentPath, listKey ? parentPath.node[listKey] : parentPath.node, listKey, key);
|
||||
return this.node;
|
||||
}
|
||||
|
||||
function arrowFunctionToShadowed() {
|
||||
if (!this.isArrowFunctionExpression()) return;
|
||||
this.arrowFunctionToExpression();
|
||||
}
|
||||
|
||||
function unwrapFunctionEnvironment() {
|
||||
if (!this.isArrowFunctionExpression() && !this.isFunctionExpression() && !this.isFunctionDeclaration()) {
|
||||
throw this.buildCodeFrameError("Can only unwrap the environment of a function.");
|
||||
}
|
||||
|
||||
hoistFunctionEnvironment(this);
|
||||
}
|
||||
|
||||
function arrowFunctionToExpression({
|
||||
allowInsertArrow = true,
|
||||
specCompliant = false
|
||||
} = {}) {
|
||||
if (!this.isArrowFunctionExpression()) {
|
||||
throw this.buildCodeFrameError("Cannot convert non-arrow function to a function expression.");
|
||||
}
|
||||
|
||||
const thisBinding = hoistFunctionEnvironment(this, specCompliant, allowInsertArrow);
|
||||
this.ensureBlock();
|
||||
this.node.type = "FunctionExpression";
|
||||
|
||||
if (specCompliant) {
|
||||
const checkBinding = thisBinding ? null : this.parentPath.scope.generateUidIdentifier("arrowCheckId");
|
||||
|
||||
if (checkBinding) {
|
||||
this.parentPath.scope.push({
|
||||
id: checkBinding,
|
||||
init: t.objectExpression([])
|
||||
});
|
||||
}
|
||||
|
||||
this.get("body").unshiftContainer("body", t.expressionStatement(t.callExpression(this.hub.addHelper("newArrowCheck"), [t.thisExpression(), checkBinding ? t.identifier(checkBinding.name) : t.identifier(thisBinding)])));
|
||||
this.replaceWith(t.callExpression(t.memberExpression((0, _helperFunctionName.default)(this, true) || this.node, t.identifier("bind")), [checkBinding ? t.identifier(checkBinding.name) : t.thisExpression()]));
|
||||
}
|
||||
}
|
||||
|
||||
function hoistFunctionEnvironment(fnPath, specCompliant = false, allowInsertArrow = true) {
|
||||
const thisEnvFn = fnPath.findParent(p => {
|
||||
return p.isFunction() && !p.isArrowFunctionExpression() || p.isProgram() || p.isClassProperty({
|
||||
static: false
|
||||
});
|
||||
});
|
||||
const inConstructor = (thisEnvFn == null ? void 0 : thisEnvFn.node.kind) === "constructor";
|
||||
|
||||
if (thisEnvFn.isClassProperty()) {
|
||||
throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property");
|
||||
}
|
||||
|
||||
const {
|
||||
thisPaths,
|
||||
argumentsPaths,
|
||||
newTargetPaths,
|
||||
superProps,
|
||||
superCalls
|
||||
} = getScopeInformation(fnPath);
|
||||
|
||||
if (inConstructor && superCalls.length > 0) {
|
||||
if (!allowInsertArrow) {
|
||||
throw superCalls[0].buildCodeFrameError("Unable to handle nested super() usage in arrow");
|
||||
}
|
||||
|
||||
const allSuperCalls = [];
|
||||
thisEnvFn.traverse({
|
||||
Function(child) {
|
||||
if (child.isArrowFunctionExpression()) return;
|
||||
child.skip();
|
||||
},
|
||||
|
||||
ClassProperty(child) {
|
||||
child.skip();
|
||||
},
|
||||
|
||||
CallExpression(child) {
|
||||
if (!child.get("callee").isSuper()) return;
|
||||
allSuperCalls.push(child);
|
||||
}
|
||||
|
||||
});
|
||||
const superBinding = getSuperBinding(thisEnvFn);
|
||||
allSuperCalls.forEach(superCall => {
|
||||
const callee = t.identifier(superBinding);
|
||||
callee.loc = superCall.node.callee.loc;
|
||||
superCall.get("callee").replaceWith(callee);
|
||||
});
|
||||
}
|
||||
|
||||
if (argumentsPaths.length > 0) {
|
||||
const argumentsBinding = getBinding(thisEnvFn, "arguments", () => t.identifier("arguments"));
|
||||
argumentsPaths.forEach(argumentsChild => {
|
||||
const argsRef = t.identifier(argumentsBinding);
|
||||
argsRef.loc = argumentsChild.node.loc;
|
||||
argumentsChild.replaceWith(argsRef);
|
||||
});
|
||||
}
|
||||
|
||||
if (newTargetPaths.length > 0) {
|
||||
const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => t.metaProperty(t.identifier("new"), t.identifier("target")));
|
||||
newTargetPaths.forEach(targetChild => {
|
||||
const targetRef = t.identifier(newTargetBinding);
|
||||
targetRef.loc = targetChild.node.loc;
|
||||
targetChild.replaceWith(targetRef);
|
||||
});
|
||||
}
|
||||
|
||||
if (superProps.length > 0) {
|
||||
if (!allowInsertArrow) {
|
||||
throw superProps[0].buildCodeFrameError("Unable to handle nested super.prop usage");
|
||||
}
|
||||
|
||||
const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []);
|
||||
flatSuperProps.forEach(superProp => {
|
||||
const key = superProp.node.computed ? "" : superProp.get("property").node.name;
|
||||
const isAssignment = superProp.parentPath.isAssignmentExpression({
|
||||
left: superProp.node
|
||||
});
|
||||
const isCall = superProp.parentPath.isCallExpression({
|
||||
callee: superProp.node
|
||||
});
|
||||
const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);
|
||||
const args = [];
|
||||
|
||||
if (superProp.node.computed) {
|
||||
args.push(superProp.get("property").node);
|
||||
}
|
||||
|
||||
if (isAssignment) {
|
||||
const value = superProp.parentPath.node.right;
|
||||
args.push(value);
|
||||
}
|
||||
|
||||
const call = t.callExpression(t.identifier(superBinding), args);
|
||||
|
||||
if (isCall) {
|
||||
superProp.parentPath.unshiftContainer("arguments", t.thisExpression());
|
||||
superProp.replaceWith(t.memberExpression(call, t.identifier("call")));
|
||||
thisPaths.push(superProp.parentPath.get("arguments.0"));
|
||||
} else if (isAssignment) {
|
||||
superProp.parentPath.replaceWith(call);
|
||||
} else {
|
||||
superProp.replaceWith(call);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let thisBinding;
|
||||
|
||||
if (thisPaths.length > 0 || specCompliant) {
|
||||
thisBinding = getThisBinding(thisEnvFn, inConstructor);
|
||||
|
||||
if (!specCompliant || inConstructor && hasSuperClass(thisEnvFn)) {
|
||||
thisPaths.forEach(thisChild => {
|
||||
const thisRef = thisChild.isJSX() ? t.jsxIdentifier(thisBinding) : t.identifier(thisBinding);
|
||||
thisRef.loc = thisChild.node.loc;
|
||||
thisChild.replaceWith(thisRef);
|
||||
});
|
||||
if (specCompliant) thisBinding = null;
|
||||
}
|
||||
}
|
||||
|
||||
return thisBinding;
|
||||
}
|
||||
|
||||
function standardizeSuperProperty(superProp) {
|
||||
if (superProp.parentPath.isAssignmentExpression() && superProp.parentPath.node.operator !== "=") {
|
||||
const assignmentPath = superProp.parentPath;
|
||||
const op = assignmentPath.node.operator.slice(0, -1);
|
||||
const value = assignmentPath.node.right;
|
||||
assignmentPath.node.operator = "=";
|
||||
|
||||
if (superProp.node.computed) {
|
||||
const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
|
||||
assignmentPath.get("left").replaceWith(t.memberExpression(superProp.node.object, t.assignmentExpression("=", tmp, superProp.node.property), true));
|
||||
assignmentPath.get("right").replaceWith(t.binaryExpression(op, t.memberExpression(superProp.node.object, t.identifier(tmp.name), true), value));
|
||||
} else {
|
||||
assignmentPath.get("left").replaceWith(t.memberExpression(superProp.node.object, superProp.node.property));
|
||||
assignmentPath.get("right").replaceWith(t.binaryExpression(op, t.memberExpression(superProp.node.object, t.identifier(superProp.node.property.name)), value));
|
||||
}
|
||||
|
||||
return [assignmentPath.get("left"), assignmentPath.get("right").get("left")];
|
||||
} else if (superProp.parentPath.isUpdateExpression()) {
|
||||
const updateExpr = superProp.parentPath;
|
||||
const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
|
||||
const computedKey = superProp.node.computed ? superProp.scope.generateDeclaredUidIdentifier("prop") : null;
|
||||
const parts = [t.assignmentExpression("=", tmp, t.memberExpression(superProp.node.object, computedKey ? t.assignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), t.assignmentExpression("=", t.memberExpression(superProp.node.object, computedKey ? t.identifier(computedKey.name) : superProp.node.property, superProp.node.computed), t.binaryExpression("+", t.identifier(tmp.name), t.numericLiteral(1)))];
|
||||
|
||||
if (!superProp.parentPath.node.prefix) {
|
||||
parts.push(t.identifier(tmp.name));
|
||||
}
|
||||
|
||||
updateExpr.replaceWith(t.sequenceExpression(parts));
|
||||
const left = updateExpr.get("expressions.0.right");
|
||||
const right = updateExpr.get("expressions.1.left");
|
||||
return [left, right];
|
||||
}
|
||||
|
||||
return [superProp];
|
||||
}
|
||||
|
||||
function hasSuperClass(thisEnvFn) {
|
||||
return thisEnvFn.isClassMethod() && !!thisEnvFn.parentPath.parentPath.node.superClass;
|
||||
}
|
||||
|
||||
function getThisBinding(thisEnvFn, inConstructor) {
|
||||
return getBinding(thisEnvFn, "this", thisBinding => {
|
||||
if (!inConstructor || !hasSuperClass(thisEnvFn)) return t.thisExpression();
|
||||
const supers = new WeakSet();
|
||||
thisEnvFn.traverse({
|
||||
Function(child) {
|
||||
if (child.isArrowFunctionExpression()) return;
|
||||
child.skip();
|
||||
},
|
||||
|
||||
ClassProperty(child) {
|
||||
child.skip();
|
||||
},
|
||||
|
||||
CallExpression(child) {
|
||||
if (!child.get("callee").isSuper()) return;
|
||||
if (supers.has(child.node)) return;
|
||||
supers.add(child.node);
|
||||
child.replaceWithMultiple([child.node, t.assignmentExpression("=", t.identifier(thisBinding), t.identifier("this"))]);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getSuperBinding(thisEnvFn) {
|
||||
return getBinding(thisEnvFn, "supercall", () => {
|
||||
const argsBinding = thisEnvFn.scope.generateUidIdentifier("args");
|
||||
return t.arrowFunctionExpression([t.restElement(argsBinding)], t.callExpression(t.super(), [t.spreadElement(t.identifier(argsBinding.name))]));
|
||||
});
|
||||
}
|
||||
|
||||
function getSuperPropBinding(thisEnvFn, isAssignment, propName) {
|
||||
const op = isAssignment ? "set" : "get";
|
||||
return getBinding(thisEnvFn, `superprop_${op}:${propName || ""}`, () => {
|
||||
const argsList = [];
|
||||
let fnBody;
|
||||
|
||||
if (propName) {
|
||||
fnBody = t.memberExpression(t.super(), t.identifier(propName));
|
||||
} else {
|
||||
const method = thisEnvFn.scope.generateUidIdentifier("prop");
|
||||
argsList.unshift(method);
|
||||
fnBody = t.memberExpression(t.super(), t.identifier(method.name), true);
|
||||
}
|
||||
|
||||
if (isAssignment) {
|
||||
const valueIdent = thisEnvFn.scope.generateUidIdentifier("value");
|
||||
argsList.push(valueIdent);
|
||||
fnBody = t.assignmentExpression("=", fnBody, t.identifier(valueIdent.name));
|
||||
}
|
||||
|
||||
return t.arrowFunctionExpression(argsList, fnBody);
|
||||
});
|
||||
}
|
||||
|
||||
function getBinding(thisEnvFn, key, init) {
|
||||
const cacheKey = "binding:" + key;
|
||||
let data = thisEnvFn.getData(cacheKey);
|
||||
|
||||
if (!data) {
|
||||
const id = thisEnvFn.scope.generateUidIdentifier(key);
|
||||
data = id.name;
|
||||
thisEnvFn.setData(cacheKey, data);
|
||||
thisEnvFn.scope.push({
|
||||
id: id,
|
||||
init: init(data)
|
||||
});
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function getScopeInformation(fnPath) {
|
||||
const thisPaths = [];
|
||||
const argumentsPaths = [];
|
||||
const newTargetPaths = [];
|
||||
const superProps = [];
|
||||
const superCalls = [];
|
||||
fnPath.traverse({
|
||||
ClassProperty(child) {
|
||||
child.skip();
|
||||
},
|
||||
|
||||
Function(child) {
|
||||
if (child.isArrowFunctionExpression()) return;
|
||||
child.skip();
|
||||
},
|
||||
|
||||
ThisExpression(child) {
|
||||
thisPaths.push(child);
|
||||
},
|
||||
|
||||
JSXIdentifier(child) {
|
||||
if (child.node.name !== "this") return;
|
||||
|
||||
if (!child.parentPath.isJSXMemberExpression({
|
||||
object: child.node
|
||||
}) && !child.parentPath.isJSXOpeningElement({
|
||||
name: child.node
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
|
||||
thisPaths.push(child);
|
||||
},
|
||||
|
||||
CallExpression(child) {
|
||||
if (child.get("callee").isSuper()) superCalls.push(child);
|
||||
},
|
||||
|
||||
MemberExpression(child) {
|
||||
if (child.get("object").isSuper()) superProps.push(child);
|
||||
},
|
||||
|
||||
ReferencedIdentifier(child) {
|
||||
if (child.node.name !== "arguments") return;
|
||||
argumentsPaths.push(child);
|
||||
},
|
||||
|
||||
MetaProperty(child) {
|
||||
if (!child.get("meta").isIdentifier({
|
||||
name: "new"
|
||||
})) return;
|
||||
if (!child.get("property").isIdentifier({
|
||||
name: "target"
|
||||
})) return;
|
||||
newTargetPaths.push(child);
|
||||
}
|
||||
|
||||
});
|
||||
return {
|
||||
thisPaths,
|
||||
argumentsPaths,
|
||||
newTargetPaths,
|
||||
superProps,
|
||||
superCalls
|
||||
};
|
||||
}
|
||||
404
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/evaluation.js
generated
vendored
Normal file
404
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/evaluation.js
generated
vendored
Normal file
@@ -0,0 +1,404 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.evaluateTruthy = evaluateTruthy;
|
||||
exports.evaluate = evaluate;
|
||||
const VALID_CALLEES = ["String", "Number", "Math"];
|
||||
const INVALID_METHODS = ["random"];
|
||||
|
||||
function evaluateTruthy() {
|
||||
const res = this.evaluate();
|
||||
if (res.confident) return !!res.value;
|
||||
}
|
||||
|
||||
function deopt(path, state) {
|
||||
if (!state.confident) return;
|
||||
state.deoptPath = path;
|
||||
state.confident = false;
|
||||
}
|
||||
|
||||
function evaluateCached(path, state) {
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
const {
|
||||
seen
|
||||
} = state;
|
||||
|
||||
if (seen.has(node)) {
|
||||
const existing = seen.get(node);
|
||||
|
||||
if (existing.resolved) {
|
||||
return existing.value;
|
||||
} else {
|
||||
deopt(path, state);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
const item = {
|
||||
resolved: false
|
||||
};
|
||||
seen.set(node, item);
|
||||
|
||||
const val = _evaluate(path, state);
|
||||
|
||||
if (state.confident) {
|
||||
item.resolved = true;
|
||||
item.value = val;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
function _evaluate(path, state) {
|
||||
if (!state.confident) return;
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
|
||||
if (path.isSequenceExpression()) {
|
||||
const exprs = path.get("expressions");
|
||||
return evaluateCached(exprs[exprs.length - 1], state);
|
||||
}
|
||||
|
||||
if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) {
|
||||
return node.value;
|
||||
}
|
||||
|
||||
if (path.isNullLiteral()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (path.isTemplateLiteral()) {
|
||||
return evaluateQuasis(path, node.quasis, state);
|
||||
}
|
||||
|
||||
if (path.isTaggedTemplateExpression() && path.get("tag").isMemberExpression()) {
|
||||
const object = path.get("tag.object");
|
||||
const {
|
||||
node: {
|
||||
name
|
||||
}
|
||||
} = object;
|
||||
const property = path.get("tag.property");
|
||||
|
||||
if (object.isIdentifier() && name === "String" && !path.scope.getBinding(name, true) && property.isIdentifier && property.node.name === "raw") {
|
||||
return evaluateQuasis(path, node.quasi.quasis, state, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (path.isConditionalExpression()) {
|
||||
const testResult = evaluateCached(path.get("test"), state);
|
||||
if (!state.confident) return;
|
||||
|
||||
if (testResult) {
|
||||
return evaluateCached(path.get("consequent"), state);
|
||||
} else {
|
||||
return evaluateCached(path.get("alternate"), state);
|
||||
}
|
||||
}
|
||||
|
||||
if (path.isExpressionWrapper()) {
|
||||
return evaluateCached(path.get("expression"), state);
|
||||
}
|
||||
|
||||
if (path.isMemberExpression() && !path.parentPath.isCallExpression({
|
||||
callee: node
|
||||
})) {
|
||||
const property = path.get("property");
|
||||
const object = path.get("object");
|
||||
|
||||
if (object.isLiteral() && property.isIdentifier()) {
|
||||
const value = object.node.value;
|
||||
const type = typeof value;
|
||||
|
||||
if (type === "number" || type === "string") {
|
||||
return value[property.node.name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (path.isReferencedIdentifier()) {
|
||||
const binding = path.scope.getBinding(node.name);
|
||||
|
||||
if (binding && binding.constantViolations.length > 0) {
|
||||
return deopt(binding.path, state);
|
||||
}
|
||||
|
||||
if (binding && path.node.start < binding.path.node.end) {
|
||||
return deopt(binding.path, state);
|
||||
}
|
||||
|
||||
if (binding == null ? void 0 : binding.hasValue) {
|
||||
return binding.value;
|
||||
} else {
|
||||
if (node.name === "undefined") {
|
||||
return binding ? deopt(binding.path, state) : undefined;
|
||||
} else if (node.name === "Infinity") {
|
||||
return binding ? deopt(binding.path, state) : Infinity;
|
||||
} else if (node.name === "NaN") {
|
||||
return binding ? deopt(binding.path, state) : NaN;
|
||||
}
|
||||
|
||||
const resolved = path.resolve();
|
||||
|
||||
if (resolved === path) {
|
||||
return deopt(path, state);
|
||||
} else {
|
||||
return evaluateCached(resolved, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (path.isUnaryExpression({
|
||||
prefix: true
|
||||
})) {
|
||||
if (node.operator === "void") {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const argument = path.get("argument");
|
||||
|
||||
if (node.operator === "typeof" && (argument.isFunction() || argument.isClass())) {
|
||||
return "function";
|
||||
}
|
||||
|
||||
const arg = evaluateCached(argument, state);
|
||||
if (!state.confident) return;
|
||||
|
||||
switch (node.operator) {
|
||||
case "!":
|
||||
return !arg;
|
||||
|
||||
case "+":
|
||||
return +arg;
|
||||
|
||||
case "-":
|
||||
return -arg;
|
||||
|
||||
case "~":
|
||||
return ~arg;
|
||||
|
||||
case "typeof":
|
||||
return typeof arg;
|
||||
}
|
||||
}
|
||||
|
||||
if (path.isArrayExpression()) {
|
||||
const arr = [];
|
||||
const elems = path.get("elements");
|
||||
|
||||
for (const elem of elems) {
|
||||
const elemValue = elem.evaluate();
|
||||
|
||||
if (elemValue.confident) {
|
||||
arr.push(elemValue.value);
|
||||
} else {
|
||||
return deopt(elem, state);
|
||||
}
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
if (path.isObjectExpression()) {
|
||||
const obj = {};
|
||||
const props = path.get("properties");
|
||||
|
||||
for (const prop of props) {
|
||||
if (prop.isObjectMethod() || prop.isSpreadElement()) {
|
||||
return deopt(prop, state);
|
||||
}
|
||||
|
||||
const keyPath = prop.get("key");
|
||||
let key = keyPath;
|
||||
|
||||
if (prop.node.computed) {
|
||||
key = key.evaluate();
|
||||
|
||||
if (!key.confident) {
|
||||
return deopt(keyPath, state);
|
||||
}
|
||||
|
||||
key = key.value;
|
||||
} else if (key.isIdentifier()) {
|
||||
key = key.node.name;
|
||||
} else {
|
||||
key = key.node.value;
|
||||
}
|
||||
|
||||
const valuePath = prop.get("value");
|
||||
let value = valuePath.evaluate();
|
||||
|
||||
if (!value.confident) {
|
||||
return deopt(valuePath, state);
|
||||
}
|
||||
|
||||
value = value.value;
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
if (path.isLogicalExpression()) {
|
||||
const wasConfident = state.confident;
|
||||
const left = evaluateCached(path.get("left"), state);
|
||||
const leftConfident = state.confident;
|
||||
state.confident = wasConfident;
|
||||
const right = evaluateCached(path.get("right"), state);
|
||||
const rightConfident = state.confident;
|
||||
|
||||
switch (node.operator) {
|
||||
case "||":
|
||||
state.confident = leftConfident && (!!left || rightConfident);
|
||||
if (!state.confident) return;
|
||||
return left || right;
|
||||
|
||||
case "&&":
|
||||
state.confident = leftConfident && (!left || rightConfident);
|
||||
if (!state.confident) return;
|
||||
return left && right;
|
||||
}
|
||||
}
|
||||
|
||||
if (path.isBinaryExpression()) {
|
||||
const left = evaluateCached(path.get("left"), state);
|
||||
if (!state.confident) return;
|
||||
const right = evaluateCached(path.get("right"), state);
|
||||
if (!state.confident) return;
|
||||
|
||||
switch (node.operator) {
|
||||
case "-":
|
||||
return left - right;
|
||||
|
||||
case "+":
|
||||
return left + right;
|
||||
|
||||
case "/":
|
||||
return left / right;
|
||||
|
||||
case "*":
|
||||
return left * right;
|
||||
|
||||
case "%":
|
||||
return left % right;
|
||||
|
||||
case "**":
|
||||
return Math.pow(left, right);
|
||||
|
||||
case "<":
|
||||
return left < right;
|
||||
|
||||
case ">":
|
||||
return left > right;
|
||||
|
||||
case "<=":
|
||||
return left <= right;
|
||||
|
||||
case ">=":
|
||||
return left >= right;
|
||||
|
||||
case "==":
|
||||
return left == right;
|
||||
|
||||
case "!=":
|
||||
return left != right;
|
||||
|
||||
case "===":
|
||||
return left === right;
|
||||
|
||||
case "!==":
|
||||
return left !== right;
|
||||
|
||||
case "|":
|
||||
return left | right;
|
||||
|
||||
case "&":
|
||||
return left & right;
|
||||
|
||||
case "^":
|
||||
return left ^ right;
|
||||
|
||||
case "<<":
|
||||
return left << right;
|
||||
|
||||
case ">>":
|
||||
return left >> right;
|
||||
|
||||
case ">>>":
|
||||
return left >>> right;
|
||||
}
|
||||
}
|
||||
|
||||
if (path.isCallExpression()) {
|
||||
const callee = path.get("callee");
|
||||
let context;
|
||||
let func;
|
||||
|
||||
if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name, true) && VALID_CALLEES.indexOf(callee.node.name) >= 0) {
|
||||
func = global[node.callee.name];
|
||||
}
|
||||
|
||||
if (callee.isMemberExpression()) {
|
||||
const object = callee.get("object");
|
||||
const property = callee.get("property");
|
||||
|
||||
if (object.isIdentifier() && property.isIdentifier() && VALID_CALLEES.indexOf(object.node.name) >= 0 && INVALID_METHODS.indexOf(property.node.name) < 0) {
|
||||
context = global[object.node.name];
|
||||
func = context[property.node.name];
|
||||
}
|
||||
|
||||
if (object.isLiteral() && property.isIdentifier()) {
|
||||
const type = typeof object.node.value;
|
||||
|
||||
if (type === "string" || type === "number") {
|
||||
context = object.node.value;
|
||||
func = context[property.node.name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (func) {
|
||||
const args = path.get("arguments").map(arg => evaluateCached(arg, state));
|
||||
if (!state.confident) return;
|
||||
return func.apply(context, args);
|
||||
}
|
||||
}
|
||||
|
||||
deopt(path, state);
|
||||
}
|
||||
|
||||
function evaluateQuasis(path, quasis, state, raw = false) {
|
||||
let str = "";
|
||||
let i = 0;
|
||||
const exprs = path.get("expressions");
|
||||
|
||||
for (const elem of quasis) {
|
||||
if (!state.confident) break;
|
||||
str += raw ? elem.value.raw : elem.value.cooked;
|
||||
const expr = exprs[i++];
|
||||
if (expr) str += String(evaluateCached(expr, state));
|
||||
}
|
||||
|
||||
if (!state.confident) return;
|
||||
return str;
|
||||
}
|
||||
|
||||
function evaluate() {
|
||||
const state = {
|
||||
confident: true,
|
||||
deoptPath: null,
|
||||
seen: new Map()
|
||||
};
|
||||
let value = evaluateCached(this, state);
|
||||
if (!state.confident) value = undefined;
|
||||
return {
|
||||
confident: state.confident,
|
||||
deopt: state.deoptPath,
|
||||
value: value
|
||||
};
|
||||
}
|
||||
287
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/family.js
generated
vendored
Normal file
287
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/family.js
generated
vendored
Normal file
@@ -0,0 +1,287 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getOpposite = getOpposite;
|
||||
exports.getCompletionRecords = getCompletionRecords;
|
||||
exports.getSibling = getSibling;
|
||||
exports.getPrevSibling = getPrevSibling;
|
||||
exports.getNextSibling = getNextSibling;
|
||||
exports.getAllNextSiblings = getAllNextSiblings;
|
||||
exports.getAllPrevSiblings = getAllPrevSiblings;
|
||||
exports.get = get;
|
||||
exports._getKey = _getKey;
|
||||
exports._getPattern = _getPattern;
|
||||
exports.getBindingIdentifiers = getBindingIdentifiers;
|
||||
exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
|
||||
exports.getBindingIdentifierPaths = getBindingIdentifierPaths;
|
||||
exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;
|
||||
|
||||
var _index = _interopRequireDefault(require("./index"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function getOpposite() {
|
||||
if (this.key === "left") {
|
||||
return this.getSibling("right");
|
||||
} else if (this.key === "right") {
|
||||
return this.getSibling("left");
|
||||
}
|
||||
}
|
||||
|
||||
function addCompletionRecords(path, paths) {
|
||||
if (path) return paths.concat(path.getCompletionRecords());
|
||||
return paths;
|
||||
}
|
||||
|
||||
function completionRecordForSwitch(cases, paths) {
|
||||
let isLastCaseWithConsequent = true;
|
||||
|
||||
for (let i = cases.length - 1; i >= 0; i--) {
|
||||
const switchCase = cases[i];
|
||||
const consequent = switchCase.get("consequent");
|
||||
let breakStatement;
|
||||
|
||||
findBreak: for (const statement of consequent) {
|
||||
if (statement.isBlockStatement()) {
|
||||
for (const statementInBlock of statement.get("body")) {
|
||||
if (statementInBlock.isBreakStatement()) {
|
||||
breakStatement = statementInBlock;
|
||||
break findBreak;
|
||||
}
|
||||
}
|
||||
} else if (statement.isBreakStatement()) {
|
||||
breakStatement = statement;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (breakStatement) {
|
||||
while (breakStatement.key === 0 && breakStatement.parentPath.isBlockStatement()) {
|
||||
breakStatement = breakStatement.parentPath;
|
||||
}
|
||||
|
||||
const prevSibling = breakStatement.getPrevSibling();
|
||||
|
||||
if (breakStatement.key > 0 && (prevSibling.isExpressionStatement() || prevSibling.isBlockStatement())) {
|
||||
paths = addCompletionRecords(prevSibling, paths);
|
||||
breakStatement.remove();
|
||||
} else {
|
||||
breakStatement.replaceWith(breakStatement.scope.buildUndefinedNode());
|
||||
paths = addCompletionRecords(breakStatement, paths);
|
||||
}
|
||||
} else if (isLastCaseWithConsequent) {
|
||||
const statementFinder = statement => !statement.isBlockStatement() || statement.get("body").some(statementFinder);
|
||||
|
||||
const hasConsequent = consequent.some(statementFinder);
|
||||
|
||||
if (hasConsequent) {
|
||||
paths = addCompletionRecords(consequent[consequent.length - 1], paths);
|
||||
isLastCaseWithConsequent = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
function getCompletionRecords() {
|
||||
let paths = [];
|
||||
|
||||
if (this.isIfStatement()) {
|
||||
paths = addCompletionRecords(this.get("consequent"), paths);
|
||||
paths = addCompletionRecords(this.get("alternate"), paths);
|
||||
} else if (this.isDoExpression() || this.isFor() || this.isWhile()) {
|
||||
paths = addCompletionRecords(this.get("body"), paths);
|
||||
} else if (this.isProgram() || this.isBlockStatement()) {
|
||||
paths = addCompletionRecords(this.get("body").pop(), paths);
|
||||
} else if (this.isFunction()) {
|
||||
return this.get("body").getCompletionRecords();
|
||||
} else if (this.isTryStatement()) {
|
||||
paths = addCompletionRecords(this.get("block"), paths);
|
||||
paths = addCompletionRecords(this.get("handler"), paths);
|
||||
} else if (this.isCatchClause()) {
|
||||
paths = addCompletionRecords(this.get("body"), paths);
|
||||
} else if (this.isSwitchStatement()) {
|
||||
paths = completionRecordForSwitch(this.get("cases"), paths);
|
||||
} else {
|
||||
paths.push(this);
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
function getSibling(key) {
|
||||
return _index.default.get({
|
||||
parentPath: this.parentPath,
|
||||
parent: this.parent,
|
||||
container: this.container,
|
||||
listKey: this.listKey,
|
||||
key: key
|
||||
});
|
||||
}
|
||||
|
||||
function getPrevSibling() {
|
||||
return this.getSibling(this.key - 1);
|
||||
}
|
||||
|
||||
function getNextSibling() {
|
||||
return this.getSibling(this.key + 1);
|
||||
}
|
||||
|
||||
function getAllNextSiblings() {
|
||||
let _key = this.key;
|
||||
let sibling = this.getSibling(++_key);
|
||||
const siblings = [];
|
||||
|
||||
while (sibling.node) {
|
||||
siblings.push(sibling);
|
||||
sibling = this.getSibling(++_key);
|
||||
}
|
||||
|
||||
return siblings;
|
||||
}
|
||||
|
||||
function getAllPrevSiblings() {
|
||||
let _key = this.key;
|
||||
let sibling = this.getSibling(--_key);
|
||||
const siblings = [];
|
||||
|
||||
while (sibling.node) {
|
||||
siblings.push(sibling);
|
||||
sibling = this.getSibling(--_key);
|
||||
}
|
||||
|
||||
return siblings;
|
||||
}
|
||||
|
||||
function get(key, context) {
|
||||
if (context === true) context = this.context;
|
||||
const parts = key.split(".");
|
||||
|
||||
if (parts.length === 1) {
|
||||
return this._getKey(key, context);
|
||||
} else {
|
||||
return this._getPattern(parts, context);
|
||||
}
|
||||
}
|
||||
|
||||
function _getKey(key, context) {
|
||||
const node = this.node;
|
||||
const container = node[key];
|
||||
|
||||
if (Array.isArray(container)) {
|
||||
return container.map((_, i) => {
|
||||
return _index.default.get({
|
||||
listKey: key,
|
||||
parentPath: this,
|
||||
parent: node,
|
||||
container: container,
|
||||
key: i
|
||||
}).setContext(context);
|
||||
});
|
||||
} else {
|
||||
return _index.default.get({
|
||||
parentPath: this,
|
||||
parent: node,
|
||||
container: node,
|
||||
key: key
|
||||
}).setContext(context);
|
||||
}
|
||||
}
|
||||
|
||||
function _getPattern(parts, context) {
|
||||
let path = this;
|
||||
|
||||
for (const part of parts) {
|
||||
if (part === ".") {
|
||||
path = path.parentPath;
|
||||
} else {
|
||||
if (Array.isArray(path)) {
|
||||
path = path[part];
|
||||
} else {
|
||||
path = path.get(part, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
function getBindingIdentifiers(duplicates) {
|
||||
return t.getBindingIdentifiers(this.node, duplicates);
|
||||
}
|
||||
|
||||
function getOuterBindingIdentifiers(duplicates) {
|
||||
return t.getOuterBindingIdentifiers(this.node, duplicates);
|
||||
}
|
||||
|
||||
function getBindingIdentifierPaths(duplicates = false, outerOnly = false) {
|
||||
const path = this;
|
||||
let search = [].concat(path);
|
||||
const ids = Object.create(null);
|
||||
|
||||
while (search.length) {
|
||||
const id = search.shift();
|
||||
if (!id) continue;
|
||||
if (!id.node) continue;
|
||||
const keys = t.getBindingIdentifiers.keys[id.node.type];
|
||||
|
||||
if (id.isIdentifier()) {
|
||||
if (duplicates) {
|
||||
const _ids = ids[id.node.name] = ids[id.node.name] || [];
|
||||
|
||||
_ids.push(id);
|
||||
} else {
|
||||
ids[id.node.name] = id;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (id.isExportDeclaration()) {
|
||||
const declaration = id.get("declaration");
|
||||
|
||||
if (declaration.isDeclaration()) {
|
||||
search.push(declaration);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (outerOnly) {
|
||||
if (id.isFunctionDeclaration()) {
|
||||
search.push(id.get("id"));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (id.isFunctionExpression()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (keys) {
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
const child = id.get(key);
|
||||
|
||||
if (Array.isArray(child) || child.node) {
|
||||
search = search.concat(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
function getOuterBindingIdentifierPaths(duplicates) {
|
||||
return this.getBindingIdentifierPaths(duplicates, true);
|
||||
}
|
||||
256
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/index.js
generated
vendored
Normal file
256
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/index.js
generated
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = exports.SHOULD_SKIP = exports.SHOULD_STOP = exports.REMOVED = void 0;
|
||||
|
||||
var virtualTypes = _interopRequireWildcard(require("./lib/virtual-types"));
|
||||
|
||||
var _debug = _interopRequireDefault(require("debug"));
|
||||
|
||||
var _index = _interopRequireDefault(require("../index"));
|
||||
|
||||
var _scope = _interopRequireDefault(require("../scope"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _cache = require("../cache");
|
||||
|
||||
var _generator = _interopRequireDefault(require("@babel/generator"));
|
||||
|
||||
var NodePath_ancestry = _interopRequireWildcard(require("./ancestry"));
|
||||
|
||||
var NodePath_inference = _interopRequireWildcard(require("./inference"));
|
||||
|
||||
var NodePath_replacement = _interopRequireWildcard(require("./replacement"));
|
||||
|
||||
var NodePath_evaluation = _interopRequireWildcard(require("./evaluation"));
|
||||
|
||||
var NodePath_conversion = _interopRequireWildcard(require("./conversion"));
|
||||
|
||||
var NodePath_introspection = _interopRequireWildcard(require("./introspection"));
|
||||
|
||||
var NodePath_context = _interopRequireWildcard(require("./context"));
|
||||
|
||||
var NodePath_removal = _interopRequireWildcard(require("./removal"));
|
||||
|
||||
var NodePath_modification = _interopRequireWildcard(require("./modification"));
|
||||
|
||||
var NodePath_family = _interopRequireWildcard(require("./family"));
|
||||
|
||||
var NodePath_comments = _interopRequireWildcard(require("./comments"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const debug = (0, _debug.default)("babel");
|
||||
const REMOVED = 1 << 0;
|
||||
exports.REMOVED = REMOVED;
|
||||
const SHOULD_STOP = 1 << 1;
|
||||
exports.SHOULD_STOP = SHOULD_STOP;
|
||||
const SHOULD_SKIP = 1 << 2;
|
||||
exports.SHOULD_SKIP = SHOULD_SKIP;
|
||||
|
||||
class NodePath {
|
||||
constructor(hub, parent) {
|
||||
this.parent = parent;
|
||||
this.hub = hub;
|
||||
this.contexts = [];
|
||||
this.data = null;
|
||||
this._traverseFlags = 0;
|
||||
this.state = null;
|
||||
this.opts = null;
|
||||
this.skipKeys = null;
|
||||
this.parentPath = null;
|
||||
this.context = null;
|
||||
this.container = null;
|
||||
this.listKey = null;
|
||||
this.key = null;
|
||||
this.node = null;
|
||||
this.scope = null;
|
||||
this.type = null;
|
||||
}
|
||||
|
||||
static get({
|
||||
hub,
|
||||
parentPath,
|
||||
parent,
|
||||
container,
|
||||
listKey,
|
||||
key
|
||||
}) {
|
||||
if (!hub && parentPath) {
|
||||
hub = parentPath.hub;
|
||||
}
|
||||
|
||||
if (!parent) {
|
||||
throw new Error("To get a node path the parent needs to exist");
|
||||
}
|
||||
|
||||
const targetNode = container[key];
|
||||
const paths = _cache.path.get(parent) || [];
|
||||
|
||||
if (!_cache.path.has(parent)) {
|
||||
_cache.path.set(parent, paths);
|
||||
}
|
||||
|
||||
let path;
|
||||
|
||||
for (let i = 0; i < paths.length; i++) {
|
||||
const pathCheck = paths[i];
|
||||
|
||||
if (pathCheck.node === targetNode) {
|
||||
path = pathCheck;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!path) {
|
||||
path = new NodePath(hub, parent);
|
||||
paths.push(path);
|
||||
}
|
||||
|
||||
path.setup(parentPath, container, listKey, key);
|
||||
return path;
|
||||
}
|
||||
|
||||
getScope(scope) {
|
||||
return this.isScope() ? new _scope.default(this) : scope;
|
||||
}
|
||||
|
||||
setData(key, val) {
|
||||
if (this.data == null) {
|
||||
this.data = Object.create(null);
|
||||
}
|
||||
|
||||
return this.data[key] = val;
|
||||
}
|
||||
|
||||
getData(key, def) {
|
||||
if (this.data == null) {
|
||||
this.data = Object.create(null);
|
||||
}
|
||||
|
||||
let val = this.data[key];
|
||||
if (val === undefined && def !== undefined) val = this.data[key] = def;
|
||||
return val;
|
||||
}
|
||||
|
||||
buildCodeFrameError(msg, Error = SyntaxError) {
|
||||
return this.hub.buildError(this.node, msg, Error);
|
||||
}
|
||||
|
||||
traverse(visitor, state) {
|
||||
(0, _index.default)(this.node, visitor, this.scope, state, this);
|
||||
}
|
||||
|
||||
set(key, node) {
|
||||
t.validate(this.node, key, node);
|
||||
this.node[key] = node;
|
||||
}
|
||||
|
||||
getPathLocation() {
|
||||
const parts = [];
|
||||
let path = this;
|
||||
|
||||
do {
|
||||
let key = path.key;
|
||||
if (path.inList) key = `${path.listKey}[${key}]`;
|
||||
parts.unshift(key);
|
||||
} while (path = path.parentPath);
|
||||
|
||||
return parts.join(".");
|
||||
}
|
||||
|
||||
debug(message) {
|
||||
if (!debug.enabled) return;
|
||||
debug(`${this.getPathLocation()} ${this.type}: ${message}`);
|
||||
}
|
||||
|
||||
toString() {
|
||||
return (0, _generator.default)(this.node).code;
|
||||
}
|
||||
|
||||
get inList() {
|
||||
return !!this.listKey;
|
||||
}
|
||||
|
||||
set inList(inList) {
|
||||
if (!inList) {
|
||||
this.listKey = null;
|
||||
}
|
||||
}
|
||||
|
||||
get parentKey() {
|
||||
return this.listKey || this.key;
|
||||
}
|
||||
|
||||
get shouldSkip() {
|
||||
return !!(this._traverseFlags & SHOULD_SKIP);
|
||||
}
|
||||
|
||||
set shouldSkip(v) {
|
||||
if (v) {
|
||||
this._traverseFlags |= SHOULD_SKIP;
|
||||
} else {
|
||||
this._traverseFlags &= ~SHOULD_SKIP;
|
||||
}
|
||||
}
|
||||
|
||||
get shouldStop() {
|
||||
return !!(this._traverseFlags & SHOULD_STOP);
|
||||
}
|
||||
|
||||
set shouldStop(v) {
|
||||
if (v) {
|
||||
this._traverseFlags |= SHOULD_STOP;
|
||||
} else {
|
||||
this._traverseFlags &= ~SHOULD_STOP;
|
||||
}
|
||||
}
|
||||
|
||||
get removed() {
|
||||
return !!(this._traverseFlags & REMOVED);
|
||||
}
|
||||
|
||||
set removed(v) {
|
||||
if (v) {
|
||||
this._traverseFlags |= REMOVED;
|
||||
} else {
|
||||
this._traverseFlags &= ~REMOVED;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = NodePath;
|
||||
Object.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments);
|
||||
|
||||
for (const type of t.TYPES) {
|
||||
const typeKey = `is${type}`;
|
||||
const fn = t[typeKey];
|
||||
|
||||
NodePath.prototype[typeKey] = function (opts) {
|
||||
return fn(this.node, opts);
|
||||
};
|
||||
|
||||
NodePath.prototype[`assert${type}`] = function (opts) {
|
||||
if (!fn(this.node, opts)) {
|
||||
throw new TypeError(`Expected node path of type ${type}`);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
for (const type of Object.keys(virtualTypes)) {
|
||||
if (type[0] === "_") continue;
|
||||
if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type);
|
||||
const virtualType = virtualTypes[type];
|
||||
|
||||
NodePath.prototype[`is${type}`] = function (opts) {
|
||||
return virtualType.checkPath(this, opts);
|
||||
};
|
||||
}
|
||||
128
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
Normal file
128
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getTypeAnnotation = getTypeAnnotation;
|
||||
exports._getTypeAnnotation = _getTypeAnnotation;
|
||||
exports.isBaseType = isBaseType;
|
||||
exports.couldBeBaseType = couldBeBaseType;
|
||||
exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches;
|
||||
exports.isGenericType = isGenericType;
|
||||
|
||||
var inferers = _interopRequireWildcard(require("./inferers"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function getTypeAnnotation() {
|
||||
if (this.typeAnnotation) return this.typeAnnotation;
|
||||
let type = this._getTypeAnnotation() || t.anyTypeAnnotation();
|
||||
if (t.isTypeAnnotation(type)) type = type.typeAnnotation;
|
||||
return this.typeAnnotation = type;
|
||||
}
|
||||
|
||||
function _getTypeAnnotation() {
|
||||
var _inferer;
|
||||
|
||||
const node = this.node;
|
||||
|
||||
if (!node) {
|
||||
if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
|
||||
const declar = this.parentPath.parentPath;
|
||||
const declarParent = declar.parentPath;
|
||||
|
||||
if (declar.key === "left" && declarParent.isForInStatement()) {
|
||||
return t.stringTypeAnnotation();
|
||||
}
|
||||
|
||||
if (declar.key === "left" && declarParent.isForOfStatement()) {
|
||||
return t.anyTypeAnnotation();
|
||||
}
|
||||
|
||||
return t.voidTypeAnnotation();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (node.typeAnnotation) {
|
||||
return node.typeAnnotation;
|
||||
}
|
||||
|
||||
let inferer = inferers[node.type];
|
||||
|
||||
if (inferer) {
|
||||
return inferer.call(this, node);
|
||||
}
|
||||
|
||||
inferer = inferers[this.parentPath.type];
|
||||
|
||||
if ((_inferer = inferer) == null ? void 0 : _inferer.validParent) {
|
||||
return this.parentPath.getTypeAnnotation();
|
||||
}
|
||||
}
|
||||
|
||||
function isBaseType(baseName, soft) {
|
||||
return _isBaseType(baseName, this.getTypeAnnotation(), soft);
|
||||
}
|
||||
|
||||
function _isBaseType(baseName, type, soft) {
|
||||
if (baseName === "string") {
|
||||
return t.isStringTypeAnnotation(type);
|
||||
} else if (baseName === "number") {
|
||||
return t.isNumberTypeAnnotation(type);
|
||||
} else if (baseName === "boolean") {
|
||||
return t.isBooleanTypeAnnotation(type);
|
||||
} else if (baseName === "any") {
|
||||
return t.isAnyTypeAnnotation(type);
|
||||
} else if (baseName === "mixed") {
|
||||
return t.isMixedTypeAnnotation(type);
|
||||
} else if (baseName === "empty") {
|
||||
return t.isEmptyTypeAnnotation(type);
|
||||
} else if (baseName === "void") {
|
||||
return t.isVoidTypeAnnotation(type);
|
||||
} else {
|
||||
if (soft) {
|
||||
return false;
|
||||
} else {
|
||||
throw new Error(`Unknown base type ${baseName}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function couldBeBaseType(name) {
|
||||
const type = this.getTypeAnnotation();
|
||||
if (t.isAnyTypeAnnotation(type)) return true;
|
||||
|
||||
if (t.isUnionTypeAnnotation(type)) {
|
||||
for (const type2 of type.types) {
|
||||
if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return _isBaseType(name, type, true);
|
||||
}
|
||||
}
|
||||
|
||||
function baseTypeStrictlyMatches(right) {
|
||||
const left = this.getTypeAnnotation();
|
||||
right = right.getTypeAnnotation();
|
||||
|
||||
if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) {
|
||||
return right.type === left.type;
|
||||
}
|
||||
}
|
||||
|
||||
function isGenericType(genericName) {
|
||||
const type = this.getTypeAnnotation();
|
||||
return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, {
|
||||
name: genericName
|
||||
});
|
||||
}
|
||||
199
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
generated
vendored
Normal file
199
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
generated
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _default(node) {
|
||||
if (!this.isReferenced()) return;
|
||||
const binding = this.scope.getBinding(node.name);
|
||||
|
||||
if (binding) {
|
||||
if (binding.identifier.typeAnnotation) {
|
||||
return binding.identifier.typeAnnotation;
|
||||
} else {
|
||||
return getTypeAnnotationBindingConstantViolations(binding, this, node.name);
|
||||
}
|
||||
}
|
||||
|
||||
if (node.name === "undefined") {
|
||||
return t.voidTypeAnnotation();
|
||||
} else if (node.name === "NaN" || node.name === "Infinity") {
|
||||
return t.numberTypeAnnotation();
|
||||
} else if (node.name === "arguments") {}
|
||||
}
|
||||
|
||||
function getTypeAnnotationBindingConstantViolations(binding, path, name) {
|
||||
const types = [];
|
||||
const functionConstantViolations = [];
|
||||
let constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations);
|
||||
const testType = getConditionalAnnotation(binding, path, name);
|
||||
|
||||
if (testType) {
|
||||
const testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
|
||||
constantViolations = constantViolations.filter(path => testConstantViolations.indexOf(path) < 0);
|
||||
types.push(testType.typeAnnotation);
|
||||
}
|
||||
|
||||
if (constantViolations.length) {
|
||||
constantViolations = constantViolations.concat(functionConstantViolations);
|
||||
|
||||
for (const violation of constantViolations) {
|
||||
types.push(violation.getTypeAnnotation());
|
||||
}
|
||||
}
|
||||
|
||||
if (!types.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (t.isTSTypeAnnotation(types[0]) && t.createTSUnionType) {
|
||||
return t.createTSUnionType(types);
|
||||
}
|
||||
|
||||
if (t.createFlowUnionType) {
|
||||
return t.createFlowUnionType(types);
|
||||
}
|
||||
|
||||
return t.createUnionTypeAnnotation(types);
|
||||
}
|
||||
|
||||
function getConstantViolationsBefore(binding, path, functions) {
|
||||
const violations = binding.constantViolations.slice();
|
||||
violations.unshift(binding.path);
|
||||
return violations.filter(violation => {
|
||||
violation = violation.resolve();
|
||||
|
||||
const status = violation._guessExecutionStatusRelativeTo(path);
|
||||
|
||||
if (functions && status === "unknown") functions.push(violation);
|
||||
return status === "before";
|
||||
});
|
||||
}
|
||||
|
||||
function inferAnnotationFromBinaryExpression(name, path) {
|
||||
const operator = path.node.operator;
|
||||
const right = path.get("right").resolve();
|
||||
const left = path.get("left").resolve();
|
||||
let target;
|
||||
|
||||
if (left.isIdentifier({
|
||||
name
|
||||
})) {
|
||||
target = right;
|
||||
} else if (right.isIdentifier({
|
||||
name
|
||||
})) {
|
||||
target = left;
|
||||
}
|
||||
|
||||
if (target) {
|
||||
if (operator === "===") {
|
||||
return target.getTypeAnnotation();
|
||||
}
|
||||
|
||||
if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.numberTypeAnnotation();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (operator !== "===" && operator !== "==") return;
|
||||
let typeofPath;
|
||||
let typePath;
|
||||
|
||||
if (left.isUnaryExpression({
|
||||
operator: "typeof"
|
||||
})) {
|
||||
typeofPath = left;
|
||||
typePath = right;
|
||||
} else if (right.isUnaryExpression({
|
||||
operator: "typeof"
|
||||
})) {
|
||||
typeofPath = right;
|
||||
typePath = left;
|
||||
}
|
||||
|
||||
if (!typeofPath) return;
|
||||
if (!typeofPath.get("argument").isIdentifier({
|
||||
name
|
||||
})) return;
|
||||
typePath = typePath.resolve();
|
||||
if (!typePath.isLiteral()) return;
|
||||
const typeValue = typePath.node.value;
|
||||
if (typeof typeValue !== "string") return;
|
||||
return t.createTypeAnnotationBasedOnTypeof(typeValue);
|
||||
}
|
||||
|
||||
function getParentConditionalPath(binding, path, name) {
|
||||
let parentPath;
|
||||
|
||||
while (parentPath = path.parentPath) {
|
||||
if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {
|
||||
if (path.key === "test") {
|
||||
return;
|
||||
}
|
||||
|
||||
return parentPath;
|
||||
}
|
||||
|
||||
if (parentPath.isFunction()) {
|
||||
if (parentPath.parentPath.scope.getBinding(name) !== binding) return;
|
||||
}
|
||||
|
||||
path = parentPath;
|
||||
}
|
||||
}
|
||||
|
||||
function getConditionalAnnotation(binding, path, name) {
|
||||
const ifStatement = getParentConditionalPath(binding, path, name);
|
||||
if (!ifStatement) return;
|
||||
const test = ifStatement.get("test");
|
||||
const paths = [test];
|
||||
const types = [];
|
||||
|
||||
for (let i = 0; i < paths.length; i++) {
|
||||
const path = paths[i];
|
||||
|
||||
if (path.isLogicalExpression()) {
|
||||
if (path.node.operator === "&&") {
|
||||
paths.push(path.get("left"));
|
||||
paths.push(path.get("right"));
|
||||
}
|
||||
} else if (path.isBinaryExpression()) {
|
||||
const type = inferAnnotationFromBinaryExpression(name, path);
|
||||
if (type) types.push(type);
|
||||
}
|
||||
}
|
||||
|
||||
if (types.length) {
|
||||
if (t.isTSTypeAnnotation(types[0]) && t.createTSUnionType) {
|
||||
return {
|
||||
typeAnnotation: t.createTSUnionType(types),
|
||||
ifStatement
|
||||
};
|
||||
}
|
||||
|
||||
if (t.createFlowUnionType) {
|
||||
return {
|
||||
typeAnnotation: t.createFlowUnionType(types),
|
||||
ifStatement
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
typeAnnotation: t.createUnionTypeAnnotation(types),
|
||||
ifStatement
|
||||
};
|
||||
}
|
||||
|
||||
return getConditionalAnnotation(ifStatement, name);
|
||||
}
|
||||
243
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/inference/inferers.js
generated
vendored
Normal file
243
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/inference/inferers.js
generated
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.VariableDeclarator = VariableDeclarator;
|
||||
exports.TypeCastExpression = TypeCastExpression;
|
||||
exports.NewExpression = NewExpression;
|
||||
exports.TemplateLiteral = TemplateLiteral;
|
||||
exports.UnaryExpression = UnaryExpression;
|
||||
exports.BinaryExpression = BinaryExpression;
|
||||
exports.LogicalExpression = LogicalExpression;
|
||||
exports.ConditionalExpression = ConditionalExpression;
|
||||
exports.SequenceExpression = SequenceExpression;
|
||||
exports.ParenthesizedExpression = ParenthesizedExpression;
|
||||
exports.AssignmentExpression = AssignmentExpression;
|
||||
exports.UpdateExpression = UpdateExpression;
|
||||
exports.StringLiteral = StringLiteral;
|
||||
exports.NumericLiteral = NumericLiteral;
|
||||
exports.BooleanLiteral = BooleanLiteral;
|
||||
exports.NullLiteral = NullLiteral;
|
||||
exports.RegExpLiteral = RegExpLiteral;
|
||||
exports.ObjectExpression = ObjectExpression;
|
||||
exports.ArrayExpression = ArrayExpression;
|
||||
exports.RestElement = RestElement;
|
||||
exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = Func;
|
||||
exports.CallExpression = CallExpression;
|
||||
exports.TaggedTemplateExpression = TaggedTemplateExpression;
|
||||
Object.defineProperty(exports, "Identifier", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _infererReference.default;
|
||||
}
|
||||
});
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
var _infererReference = _interopRequireDefault(require("./inferer-reference"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function VariableDeclarator() {
|
||||
var _type;
|
||||
|
||||
const id = this.get("id");
|
||||
if (!id.isIdentifier()) return;
|
||||
const init = this.get("init");
|
||||
let type = init.getTypeAnnotation();
|
||||
|
||||
if (((_type = type) == null ? void 0 : _type.type) === "AnyTypeAnnotation") {
|
||||
if (init.isCallExpression() && init.get("callee").isIdentifier({
|
||||
name: "Array"
|
||||
}) && !init.scope.hasBinding("Array", true)) {
|
||||
type = ArrayExpression();
|
||||
}
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
function TypeCastExpression(node) {
|
||||
return node.typeAnnotation;
|
||||
}
|
||||
|
||||
TypeCastExpression.validParent = true;
|
||||
|
||||
function NewExpression(node) {
|
||||
if (this.get("callee").isIdentifier()) {
|
||||
return t.genericTypeAnnotation(node.callee);
|
||||
}
|
||||
}
|
||||
|
||||
function TemplateLiteral() {
|
||||
return t.stringTypeAnnotation();
|
||||
}
|
||||
|
||||
function UnaryExpression(node) {
|
||||
const operator = node.operator;
|
||||
|
||||
if (operator === "void") {
|
||||
return t.voidTypeAnnotation();
|
||||
} else if (t.NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.numberTypeAnnotation();
|
||||
} else if (t.STRING_UNARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.stringTypeAnnotation();
|
||||
} else if (t.BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.booleanTypeAnnotation();
|
||||
}
|
||||
}
|
||||
|
||||
function BinaryExpression(node) {
|
||||
const operator = node.operator;
|
||||
|
||||
if (t.NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.numberTypeAnnotation();
|
||||
} else if (t.BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) {
|
||||
return t.booleanTypeAnnotation();
|
||||
} else if (operator === "+") {
|
||||
const right = this.get("right");
|
||||
const left = this.get("left");
|
||||
|
||||
if (left.isBaseType("number") && right.isBaseType("number")) {
|
||||
return t.numberTypeAnnotation();
|
||||
} else if (left.isBaseType("string") || right.isBaseType("string")) {
|
||||
return t.stringTypeAnnotation();
|
||||
}
|
||||
|
||||
return t.unionTypeAnnotation([t.stringTypeAnnotation(), t.numberTypeAnnotation()]);
|
||||
}
|
||||
}
|
||||
|
||||
function LogicalExpression() {
|
||||
const argumentTypes = [this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()];
|
||||
|
||||
if (t.isTSTypeAnnotation(argumentTypes[0]) && t.createTSUnionType) {
|
||||
return t.createTSUnionType(argumentTypes);
|
||||
}
|
||||
|
||||
if (t.createFlowUnionType) {
|
||||
return t.createFlowUnionType(argumentTypes);
|
||||
}
|
||||
|
||||
return t.createUnionTypeAnnotation(argumentTypes);
|
||||
}
|
||||
|
||||
function ConditionalExpression() {
|
||||
const argumentTypes = [this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()];
|
||||
|
||||
if (t.isTSTypeAnnotation(argumentTypes[0]) && t.createTSUnionType) {
|
||||
return t.createTSUnionType(argumentTypes);
|
||||
}
|
||||
|
||||
if (t.createFlowUnionType) {
|
||||
return t.createFlowUnionType(argumentTypes);
|
||||
}
|
||||
|
||||
return t.createUnionTypeAnnotation(argumentTypes);
|
||||
}
|
||||
|
||||
function SequenceExpression() {
|
||||
return this.get("expressions").pop().getTypeAnnotation();
|
||||
}
|
||||
|
||||
function ParenthesizedExpression() {
|
||||
return this.get("expression").getTypeAnnotation();
|
||||
}
|
||||
|
||||
function AssignmentExpression() {
|
||||
return this.get("right").getTypeAnnotation();
|
||||
}
|
||||
|
||||
function UpdateExpression(node) {
|
||||
const operator = node.operator;
|
||||
|
||||
if (operator === "++" || operator === "--") {
|
||||
return t.numberTypeAnnotation();
|
||||
}
|
||||
}
|
||||
|
||||
function StringLiteral() {
|
||||
return t.stringTypeAnnotation();
|
||||
}
|
||||
|
||||
function NumericLiteral() {
|
||||
return t.numberTypeAnnotation();
|
||||
}
|
||||
|
||||
function BooleanLiteral() {
|
||||
return t.booleanTypeAnnotation();
|
||||
}
|
||||
|
||||
function NullLiteral() {
|
||||
return t.nullLiteralTypeAnnotation();
|
||||
}
|
||||
|
||||
function RegExpLiteral() {
|
||||
return t.genericTypeAnnotation(t.identifier("RegExp"));
|
||||
}
|
||||
|
||||
function ObjectExpression() {
|
||||
return t.genericTypeAnnotation(t.identifier("Object"));
|
||||
}
|
||||
|
||||
function ArrayExpression() {
|
||||
return t.genericTypeAnnotation(t.identifier("Array"));
|
||||
}
|
||||
|
||||
function RestElement() {
|
||||
return ArrayExpression();
|
||||
}
|
||||
|
||||
RestElement.validParent = true;
|
||||
|
||||
function Func() {
|
||||
return t.genericTypeAnnotation(t.identifier("Function"));
|
||||
}
|
||||
|
||||
const isArrayFrom = t.buildMatchMemberExpression("Array.from");
|
||||
const isObjectKeys = t.buildMatchMemberExpression("Object.keys");
|
||||
const isObjectValues = t.buildMatchMemberExpression("Object.values");
|
||||
const isObjectEntries = t.buildMatchMemberExpression("Object.entries");
|
||||
|
||||
function CallExpression() {
|
||||
const {
|
||||
callee
|
||||
} = this.node;
|
||||
|
||||
if (isObjectKeys(callee)) {
|
||||
return t.arrayTypeAnnotation(t.stringTypeAnnotation());
|
||||
} else if (isArrayFrom(callee) || isObjectValues(callee)) {
|
||||
return t.arrayTypeAnnotation(t.anyTypeAnnotation());
|
||||
} else if (isObjectEntries(callee)) {
|
||||
return t.arrayTypeAnnotation(t.tupleTypeAnnotation([t.stringTypeAnnotation(), t.anyTypeAnnotation()]));
|
||||
}
|
||||
|
||||
return resolveCall(this.get("callee"));
|
||||
}
|
||||
|
||||
function TaggedTemplateExpression() {
|
||||
return resolveCall(this.get("tag"));
|
||||
}
|
||||
|
||||
function resolveCall(callee) {
|
||||
callee = callee.resolve();
|
||||
|
||||
if (callee.isFunction()) {
|
||||
if (callee.is("async")) {
|
||||
if (callee.is("generator")) {
|
||||
return t.genericTypeAnnotation(t.identifier("AsyncIterator"));
|
||||
} else {
|
||||
return t.genericTypeAnnotation(t.identifier("Promise"));
|
||||
}
|
||||
} else {
|
||||
if (callee.node.returnType) {
|
||||
return callee.node.returnType;
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
}
|
||||
423
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/introspection.js
generated
vendored
Normal file
423
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/introspection.js
generated
vendored
Normal file
@@ -0,0 +1,423 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.matchesPattern = matchesPattern;
|
||||
exports.has = has;
|
||||
exports.isStatic = isStatic;
|
||||
exports.isnt = isnt;
|
||||
exports.equals = equals;
|
||||
exports.isNodeType = isNodeType;
|
||||
exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;
|
||||
exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;
|
||||
exports.isCompletionRecord = isCompletionRecord;
|
||||
exports.isStatementOrBlock = isStatementOrBlock;
|
||||
exports.referencesImport = referencesImport;
|
||||
exports.getSource = getSource;
|
||||
exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore;
|
||||
exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;
|
||||
exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions;
|
||||
exports.resolve = resolve;
|
||||
exports._resolve = _resolve;
|
||||
exports.isConstantExpression = isConstantExpression;
|
||||
exports.isInStrictMode = isInStrictMode;
|
||||
exports.is = void 0;
|
||||
|
||||
var _includes = _interopRequireDefault(require("lodash/includes"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function matchesPattern(pattern, allowPartial) {
|
||||
return t.matchesPattern(this.node, pattern, allowPartial);
|
||||
}
|
||||
|
||||
function has(key) {
|
||||
const val = this.node && this.node[key];
|
||||
|
||||
if (val && Array.isArray(val)) {
|
||||
return !!val.length;
|
||||
} else {
|
||||
return !!val;
|
||||
}
|
||||
}
|
||||
|
||||
function isStatic() {
|
||||
return this.scope.isStatic(this.node);
|
||||
}
|
||||
|
||||
const is = has;
|
||||
exports.is = is;
|
||||
|
||||
function isnt(key) {
|
||||
return !this.has(key);
|
||||
}
|
||||
|
||||
function equals(key, value) {
|
||||
return this.node[key] === value;
|
||||
}
|
||||
|
||||
function isNodeType(type) {
|
||||
return t.isType(this.type, type);
|
||||
}
|
||||
|
||||
function canHaveVariableDeclarationOrExpression() {
|
||||
return (this.key === "init" || this.key === "left") && this.parentPath.isFor();
|
||||
}
|
||||
|
||||
function canSwapBetweenExpressionAndStatement(replacement) {
|
||||
if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isExpression()) {
|
||||
return t.isBlockStatement(replacement);
|
||||
} else if (this.isBlockStatement()) {
|
||||
return t.isExpression(replacement);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isCompletionRecord(allowInsideFunction) {
|
||||
let path = this;
|
||||
let first = true;
|
||||
|
||||
do {
|
||||
const container = path.container;
|
||||
|
||||
if (path.isFunction() && !first) {
|
||||
return !!allowInsideFunction;
|
||||
}
|
||||
|
||||
first = false;
|
||||
|
||||
if (Array.isArray(container) && path.key !== container.length - 1) {
|
||||
return false;
|
||||
}
|
||||
} while ((path = path.parentPath) && !path.isProgram());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function isStatementOrBlock() {
|
||||
if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {
|
||||
return false;
|
||||
} else {
|
||||
return (0, _includes.default)(t.STATEMENT_OR_BLOCK_KEYS, this.key);
|
||||
}
|
||||
}
|
||||
|
||||
function referencesImport(moduleSource, importName) {
|
||||
if (!this.isReferencedIdentifier()) return false;
|
||||
const binding = this.scope.getBinding(this.node.name);
|
||||
if (!binding || binding.kind !== "module") return false;
|
||||
const path = binding.path;
|
||||
const parent = path.parentPath;
|
||||
if (!parent.isImportDeclaration()) return false;
|
||||
|
||||
if (parent.node.source.value === moduleSource) {
|
||||
if (!importName) return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (path.isImportDefaultSpecifier() && importName === "default") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (path.isImportNamespaceSpecifier() && importName === "*") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (path.isImportSpecifier() && path.node.imported.name === importName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getSource() {
|
||||
const node = this.node;
|
||||
|
||||
if (node.end) {
|
||||
const code = this.hub.getCode();
|
||||
if (code) return code.slice(node.start, node.end);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function willIMaybeExecuteBefore(target) {
|
||||
return this._guessExecutionStatusRelativeTo(target) !== "after";
|
||||
}
|
||||
|
||||
function getOuterFunction(path) {
|
||||
return (path.scope.getFunctionParent() || path.scope.getProgramParent()).path;
|
||||
}
|
||||
|
||||
function isExecutionUncertain(type, key) {
|
||||
switch (type) {
|
||||
case "LogicalExpression":
|
||||
return key === "right";
|
||||
|
||||
case "ConditionalExpression":
|
||||
case "IfStatement":
|
||||
return key === "consequent" || key === "alternate";
|
||||
|
||||
case "WhileStatement":
|
||||
case "DoWhileStatement":
|
||||
case "ForInStatement":
|
||||
case "ForOfStatement":
|
||||
return key === "body";
|
||||
|
||||
case "ForStatement":
|
||||
return key === "body" || key === "update";
|
||||
|
||||
case "SwitchStatement":
|
||||
return key === "cases";
|
||||
|
||||
case "TryStatement":
|
||||
return key === "handler";
|
||||
|
||||
case "AssignmentPattern":
|
||||
return key === "right";
|
||||
|
||||
case "OptionalMemberExpression":
|
||||
return key === "property";
|
||||
|
||||
case "OptionalCallExpression":
|
||||
return key === "arguments";
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isExecutionUncertainInList(paths, maxIndex) {
|
||||
for (let i = 0; i < maxIndex; i++) {
|
||||
const path = paths[i];
|
||||
|
||||
if (isExecutionUncertain(path.parent.type, path.parentKey)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function _guessExecutionStatusRelativeTo(target) {
|
||||
const funcParent = {
|
||||
this: getOuterFunction(this),
|
||||
target: getOuterFunction(target)
|
||||
};
|
||||
|
||||
if (funcParent.target.node !== funcParent.this.node) {
|
||||
return this._guessExecutionStatusRelativeToDifferentFunctions(funcParent.target);
|
||||
}
|
||||
|
||||
const paths = {
|
||||
target: target.getAncestry(),
|
||||
this: this.getAncestry()
|
||||
};
|
||||
if (paths.target.indexOf(this) >= 0) return "after";
|
||||
if (paths.this.indexOf(target) >= 0) return "before";
|
||||
let commonPath;
|
||||
const commonIndex = {
|
||||
target: 0,
|
||||
this: 0
|
||||
};
|
||||
|
||||
while (!commonPath && commonIndex.this < paths.this.length) {
|
||||
const path = paths.this[commonIndex.this];
|
||||
commonIndex.target = paths.target.indexOf(path);
|
||||
|
||||
if (commonIndex.target >= 0) {
|
||||
commonPath = path;
|
||||
} else {
|
||||
commonIndex.this++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!commonPath) {
|
||||
throw new Error("Internal Babel error - The two compared nodes" + " don't appear to belong to the same program.");
|
||||
}
|
||||
|
||||
if (isExecutionUncertainInList(paths.this, commonIndex.this - 1) || isExecutionUncertainInList(paths.target, commonIndex.target - 1)) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
const divergence = {
|
||||
this: paths.this[commonIndex.this - 1],
|
||||
target: paths.target[commonIndex.target - 1]
|
||||
};
|
||||
|
||||
if (divergence.target.listKey && divergence.this.listKey && divergence.target.container === divergence.this.container) {
|
||||
return divergence.target.key > divergence.this.key ? "before" : "after";
|
||||
}
|
||||
|
||||
const keys = t.VISITOR_KEYS[commonPath.type];
|
||||
const keyPosition = {
|
||||
this: keys.indexOf(divergence.this.parentKey),
|
||||
target: keys.indexOf(divergence.target.parentKey)
|
||||
};
|
||||
return keyPosition.target > keyPosition.this ? "before" : "after";
|
||||
}
|
||||
|
||||
const executionOrderCheckedNodes = new WeakSet();
|
||||
|
||||
function _guessExecutionStatusRelativeToDifferentFunctions(target) {
|
||||
if (!target.isFunctionDeclaration() || target.parentPath.isExportDeclaration()) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
const binding = target.scope.getBinding(target.node.id.name);
|
||||
if (!binding.references) return "before";
|
||||
const referencePaths = binding.referencePaths;
|
||||
let allStatus;
|
||||
|
||||
for (const path of referencePaths) {
|
||||
const childOfFunction = !!path.find(path => path.node === target.node);
|
||||
if (childOfFunction) continue;
|
||||
|
||||
if (path.key !== "callee" || !path.parentPath.isCallExpression()) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
if (executionOrderCheckedNodes.has(path.node)) continue;
|
||||
executionOrderCheckedNodes.add(path.node);
|
||||
|
||||
const status = this._guessExecutionStatusRelativeTo(path);
|
||||
|
||||
executionOrderCheckedNodes.delete(path.node);
|
||||
|
||||
if (allStatus && allStatus !== status) {
|
||||
return "unknown";
|
||||
} else {
|
||||
allStatus = status;
|
||||
}
|
||||
}
|
||||
|
||||
return allStatus;
|
||||
}
|
||||
|
||||
function resolve(dangerous, resolved) {
|
||||
return this._resolve(dangerous, resolved) || this;
|
||||
}
|
||||
|
||||
function _resolve(dangerous, resolved) {
|
||||
if (resolved && resolved.indexOf(this) >= 0) return;
|
||||
resolved = resolved || [];
|
||||
resolved.push(this);
|
||||
|
||||
if (this.isVariableDeclarator()) {
|
||||
if (this.get("id").isIdentifier()) {
|
||||
return this.get("init").resolve(dangerous, resolved);
|
||||
} else {}
|
||||
} else if (this.isReferencedIdentifier()) {
|
||||
const binding = this.scope.getBinding(this.node.name);
|
||||
if (!binding) return;
|
||||
if (!binding.constant) return;
|
||||
if (binding.kind === "module") return;
|
||||
|
||||
if (binding.path !== this) {
|
||||
const ret = binding.path.resolve(dangerous, resolved);
|
||||
if (this.find(parent => parent.node === ret.node)) return;
|
||||
return ret;
|
||||
}
|
||||
} else if (this.isTypeCastExpression()) {
|
||||
return this.get("expression").resolve(dangerous, resolved);
|
||||
} else if (dangerous && this.isMemberExpression()) {
|
||||
const targetKey = this.toComputedKey();
|
||||
if (!t.isLiteral(targetKey)) return;
|
||||
const targetName = targetKey.value;
|
||||
const target = this.get("object").resolve(dangerous, resolved);
|
||||
|
||||
if (target.isObjectExpression()) {
|
||||
const props = target.get("properties");
|
||||
|
||||
for (const prop of props) {
|
||||
if (!prop.isProperty()) continue;
|
||||
const key = prop.get("key");
|
||||
let match = prop.isnt("computed") && key.isIdentifier({
|
||||
name: targetName
|
||||
});
|
||||
match = match || key.isLiteral({
|
||||
value: targetName
|
||||
});
|
||||
if (match) return prop.get("value").resolve(dangerous, resolved);
|
||||
}
|
||||
} else if (target.isArrayExpression() && !isNaN(+targetName)) {
|
||||
const elems = target.get("elements");
|
||||
const elem = elems[targetName];
|
||||
if (elem) return elem.resolve(dangerous, resolved);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isConstantExpression() {
|
||||
if (this.isIdentifier()) {
|
||||
const binding = this.scope.getBinding(this.node.name);
|
||||
if (!binding) return false;
|
||||
return binding.constant;
|
||||
}
|
||||
|
||||
if (this.isLiteral()) {
|
||||
if (this.isRegExpLiteral()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isTemplateLiteral()) {
|
||||
return this.get("expressions").every(expression => expression.isConstantExpression());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.isUnaryExpression()) {
|
||||
if (this.get("operator").node !== "void") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.get("argument").isConstantExpression();
|
||||
}
|
||||
|
||||
if (this.isBinaryExpression()) {
|
||||
return this.get("left").isConstantExpression() && this.get("right").isConstantExpression();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isInStrictMode() {
|
||||
const start = this.isProgram() ? this : this.parentPath;
|
||||
const strictParent = start.find(path => {
|
||||
if (path.isProgram({
|
||||
sourceType: "module"
|
||||
})) return true;
|
||||
if (path.isClass()) return true;
|
||||
if (!path.isProgram() && !path.isFunction()) return false;
|
||||
|
||||
if (path.isArrowFunctionExpression() && !path.get("body").isBlockStatement()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let {
|
||||
node
|
||||
} = path;
|
||||
if (path.isFunction()) node = node.body;
|
||||
|
||||
for (const directive of node.directives) {
|
||||
if (directive.value.value === "use strict") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
return !!strictParent;
|
||||
}
|
||||
193
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/lib/hoister.js
generated
vendored
Normal file
193
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/lib/hoister.js
generated
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const referenceVisitor = {
|
||||
ReferencedIdentifier(path, state) {
|
||||
if (path.isJSXIdentifier() && t.react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (path.node.name === "this") {
|
||||
let scope = path.scope;
|
||||
|
||||
do {
|
||||
if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) {
|
||||
break;
|
||||
}
|
||||
} while (scope = scope.parent);
|
||||
|
||||
if (scope) state.breakOnScopePaths.push(scope.path);
|
||||
}
|
||||
|
||||
const binding = path.scope.getBinding(path.node.name);
|
||||
if (!binding) return;
|
||||
|
||||
for (const violation of binding.constantViolations) {
|
||||
if (violation.scope !== binding.path.scope) {
|
||||
state.mutableBinding = true;
|
||||
path.stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (binding !== state.scope.getBinding(path.node.name)) return;
|
||||
state.bindings[path.node.name] = binding;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class PathHoister {
|
||||
constructor(path, scope) {
|
||||
this.breakOnScopePaths = [];
|
||||
this.bindings = {};
|
||||
this.mutableBinding = false;
|
||||
this.scopes = [];
|
||||
this.scope = scope;
|
||||
this.path = path;
|
||||
this.attachAfter = false;
|
||||
}
|
||||
|
||||
isCompatibleScope(scope) {
|
||||
for (const key of Object.keys(this.bindings)) {
|
||||
const binding = this.bindings[key];
|
||||
|
||||
if (!scope.bindingIdentifierEquals(key, binding.identifier)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
getCompatibleScopes() {
|
||||
let scope = this.path.scope;
|
||||
|
||||
do {
|
||||
if (this.isCompatibleScope(scope)) {
|
||||
this.scopes.push(scope);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.breakOnScopePaths.indexOf(scope.path) >= 0) {
|
||||
break;
|
||||
}
|
||||
} while (scope = scope.parent);
|
||||
}
|
||||
|
||||
getAttachmentPath() {
|
||||
let path = this._getAttachmentPath();
|
||||
|
||||
if (!path) return;
|
||||
let targetScope = path.scope;
|
||||
|
||||
if (targetScope.path === path) {
|
||||
targetScope = path.scope.parent;
|
||||
}
|
||||
|
||||
if (targetScope.path.isProgram() || targetScope.path.isFunction()) {
|
||||
for (const name of Object.keys(this.bindings)) {
|
||||
if (!targetScope.hasOwnBinding(name)) continue;
|
||||
const binding = this.bindings[name];
|
||||
|
||||
if (binding.kind === "param" || binding.path.parentKey === "params") {
|
||||
continue;
|
||||
}
|
||||
|
||||
const bindingParentPath = this.getAttachmentParentForPath(binding.path);
|
||||
|
||||
if (bindingParentPath.key >= path.key) {
|
||||
this.attachAfter = true;
|
||||
path = binding.path;
|
||||
|
||||
for (const violationPath of binding.constantViolations) {
|
||||
if (this.getAttachmentParentForPath(violationPath).key > path.key) {
|
||||
path = violationPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
_getAttachmentPath() {
|
||||
const scopes = this.scopes;
|
||||
const scope = scopes.pop();
|
||||
if (!scope) return;
|
||||
|
||||
if (scope.path.isFunction()) {
|
||||
if (this.hasOwnParamBindings(scope)) {
|
||||
if (this.scope === scope) return;
|
||||
const bodies = scope.path.get("body").get("body");
|
||||
|
||||
for (let i = 0; i < bodies.length; i++) {
|
||||
if (bodies[i].node._blockHoist) continue;
|
||||
return bodies[i];
|
||||
}
|
||||
} else {
|
||||
return this.getNextScopeAttachmentParent();
|
||||
}
|
||||
} else if (scope.path.isProgram()) {
|
||||
return this.getNextScopeAttachmentParent();
|
||||
}
|
||||
}
|
||||
|
||||
getNextScopeAttachmentParent() {
|
||||
const scope = this.scopes.pop();
|
||||
if (scope) return this.getAttachmentParentForPath(scope.path);
|
||||
}
|
||||
|
||||
getAttachmentParentForPath(path) {
|
||||
do {
|
||||
if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
|
||||
return path;
|
||||
}
|
||||
} while (path = path.parentPath);
|
||||
}
|
||||
|
||||
hasOwnParamBindings(scope) {
|
||||
for (const name of Object.keys(this.bindings)) {
|
||||
if (!scope.hasOwnBinding(name)) continue;
|
||||
const binding = this.bindings[name];
|
||||
if (binding.kind === "param" && binding.constant) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
run() {
|
||||
this.path.traverse(referenceVisitor, this);
|
||||
if (this.mutableBinding) return;
|
||||
this.getCompatibleScopes();
|
||||
const attachTo = this.getAttachmentPath();
|
||||
if (!attachTo) return;
|
||||
if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;
|
||||
let uid = attachTo.scope.generateUidIdentifier("ref");
|
||||
const declarator = t.variableDeclarator(uid, this.path.node);
|
||||
const insertFn = this.attachAfter ? "insertAfter" : "insertBefore";
|
||||
const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration("var", [declarator])]);
|
||||
const parent = this.path.parentPath;
|
||||
|
||||
if (parent.isJSXElement() && this.path.container === parent.node.children) {
|
||||
uid = t.JSXExpressionContainer(uid);
|
||||
}
|
||||
|
||||
this.path.replaceWith(t.cloneNode(uid));
|
||||
return attachTo.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = PathHoister;
|
||||
38
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
generated
vendored
Normal file
38
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.hooks = void 0;
|
||||
const hooks = [function (self, parent) {
|
||||
const removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement();
|
||||
|
||||
if (removeParent) {
|
||||
parent.remove();
|
||||
return true;
|
||||
}
|
||||
}, function (self, parent) {
|
||||
if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {
|
||||
parent.replaceWith(parent.node.expressions[0]);
|
||||
return true;
|
||||
}
|
||||
}, function (self, parent) {
|
||||
if (parent.isBinary()) {
|
||||
if (self.key === "left") {
|
||||
parent.replaceWith(parent.node.right);
|
||||
} else {
|
||||
parent.replaceWith(parent.node.left);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}, function (self, parent) {
|
||||
if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) {
|
||||
self.replaceWith({
|
||||
type: "BlockStatement",
|
||||
body: []
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}];
|
||||
exports.hooks = hooks;
|
||||
210
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/lib/virtual-types.js
generated
vendored
Normal file
210
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/lib/virtual-types.js
generated
vendored
Normal file
@@ -0,0 +1,210 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ForAwaitStatement = exports.NumericLiteralTypeAnnotation = exports.ExistentialTypeParam = exports.SpreadProperty = exports.RestProperty = exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = void 0;
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const ReferencedIdentifier = {
|
||||
types: ["Identifier", "JSXIdentifier"],
|
||||
|
||||
checkPath(path, opts) {
|
||||
const {
|
||||
node,
|
||||
parent
|
||||
} = path;
|
||||
|
||||
if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {
|
||||
if (t.isJSXIdentifier(node, opts)) {
|
||||
if (t.react.isCompatTag(node.name)) return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return t.isReferenced(node, parent, path.parentPath.parent);
|
||||
}
|
||||
|
||||
};
|
||||
exports.ReferencedIdentifier = ReferencedIdentifier;
|
||||
const ReferencedMemberExpression = {
|
||||
types: ["MemberExpression"],
|
||||
|
||||
checkPath({
|
||||
node,
|
||||
parent
|
||||
}) {
|
||||
return t.isMemberExpression(node) && t.isReferenced(node, parent);
|
||||
}
|
||||
|
||||
};
|
||||
exports.ReferencedMemberExpression = ReferencedMemberExpression;
|
||||
const BindingIdentifier = {
|
||||
types: ["Identifier"],
|
||||
|
||||
checkPath(path) {
|
||||
const {
|
||||
node,
|
||||
parent
|
||||
} = path;
|
||||
const grandparent = path.parentPath.parent;
|
||||
return t.isIdentifier(node) && t.isBinding(node, parent, grandparent);
|
||||
}
|
||||
|
||||
};
|
||||
exports.BindingIdentifier = BindingIdentifier;
|
||||
const Statement = {
|
||||
types: ["Statement"],
|
||||
|
||||
checkPath({
|
||||
node,
|
||||
parent
|
||||
}) {
|
||||
if (t.isStatement(node)) {
|
||||
if (t.isVariableDeclaration(node)) {
|
||||
if (t.isForXStatement(parent, {
|
||||
left: node
|
||||
})) return false;
|
||||
if (t.isForStatement(parent, {
|
||||
init: node
|
||||
})) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
exports.Statement = Statement;
|
||||
const Expression = {
|
||||
types: ["Expression"],
|
||||
|
||||
checkPath(path) {
|
||||
if (path.isIdentifier()) {
|
||||
return path.isReferencedIdentifier();
|
||||
} else {
|
||||
return t.isExpression(path.node);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
exports.Expression = Expression;
|
||||
const Scope = {
|
||||
types: ["Scopable", "Pattern"],
|
||||
|
||||
checkPath(path) {
|
||||
return t.isScope(path.node, path.parent);
|
||||
}
|
||||
|
||||
};
|
||||
exports.Scope = Scope;
|
||||
const Referenced = {
|
||||
checkPath(path) {
|
||||
return t.isReferenced(path.node, path.parent);
|
||||
}
|
||||
|
||||
};
|
||||
exports.Referenced = Referenced;
|
||||
const BlockScoped = {
|
||||
checkPath(path) {
|
||||
return t.isBlockScoped(path.node);
|
||||
}
|
||||
|
||||
};
|
||||
exports.BlockScoped = BlockScoped;
|
||||
const Var = {
|
||||
types: ["VariableDeclaration"],
|
||||
|
||||
checkPath(path) {
|
||||
return t.isVar(path.node);
|
||||
}
|
||||
|
||||
};
|
||||
exports.Var = Var;
|
||||
const User = {
|
||||
checkPath(path) {
|
||||
return path.node && !!path.node.loc;
|
||||
}
|
||||
|
||||
};
|
||||
exports.User = User;
|
||||
const Generated = {
|
||||
checkPath(path) {
|
||||
return !path.isUser();
|
||||
}
|
||||
|
||||
};
|
||||
exports.Generated = Generated;
|
||||
const Pure = {
|
||||
checkPath(path, opts) {
|
||||
return path.scope.isPure(path.node, opts);
|
||||
}
|
||||
|
||||
};
|
||||
exports.Pure = Pure;
|
||||
const Flow = {
|
||||
types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"],
|
||||
|
||||
checkPath({
|
||||
node
|
||||
}) {
|
||||
if (t.isFlow(node)) {
|
||||
return true;
|
||||
} else if (t.isImportDeclaration(node)) {
|
||||
return node.importKind === "type" || node.importKind === "typeof";
|
||||
} else if (t.isExportDeclaration(node)) {
|
||||
return node.exportKind === "type";
|
||||
} else if (t.isImportSpecifier(node)) {
|
||||
return node.importKind === "type" || node.importKind === "typeof";
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
exports.Flow = Flow;
|
||||
const RestProperty = {
|
||||
types: ["RestElement"],
|
||||
|
||||
checkPath(path) {
|
||||
return path.parentPath && path.parentPath.isObjectPattern();
|
||||
}
|
||||
|
||||
};
|
||||
exports.RestProperty = RestProperty;
|
||||
const SpreadProperty = {
|
||||
types: ["RestElement"],
|
||||
|
||||
checkPath(path) {
|
||||
return path.parentPath && path.parentPath.isObjectExpression();
|
||||
}
|
||||
|
||||
};
|
||||
exports.SpreadProperty = SpreadProperty;
|
||||
const ExistentialTypeParam = {
|
||||
types: ["ExistsTypeAnnotation"]
|
||||
};
|
||||
exports.ExistentialTypeParam = ExistentialTypeParam;
|
||||
const NumericLiteralTypeAnnotation = {
|
||||
types: ["NumberLiteralTypeAnnotation"]
|
||||
};
|
||||
exports.NumericLiteralTypeAnnotation = NumericLiteralTypeAnnotation;
|
||||
const ForAwaitStatement = {
|
||||
types: ["ForOfStatement"],
|
||||
|
||||
checkPath({
|
||||
node
|
||||
}) {
|
||||
return node.await === true;
|
||||
}
|
||||
|
||||
};
|
||||
exports.ForAwaitStatement = ForAwaitStatement;
|
||||
216
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/modification.js
generated
vendored
Normal file
216
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/modification.js
generated
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.insertBefore = insertBefore;
|
||||
exports._containerInsert = _containerInsert;
|
||||
exports._containerInsertBefore = _containerInsertBefore;
|
||||
exports._containerInsertAfter = _containerInsertAfter;
|
||||
exports.insertAfter = insertAfter;
|
||||
exports.updateSiblingKeys = updateSiblingKeys;
|
||||
exports._verifyNodeList = _verifyNodeList;
|
||||
exports.unshiftContainer = unshiftContainer;
|
||||
exports.pushContainer = pushContainer;
|
||||
exports.hoist = hoist;
|
||||
|
||||
var _cache = require("../cache");
|
||||
|
||||
var _hoister = _interopRequireDefault(require("./lib/hoister"));
|
||||
|
||||
var _index = _interopRequireDefault(require("./index"));
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function insertBefore(nodes) {
|
||||
this._assertUnremoved();
|
||||
|
||||
nodes = this._verifyNodeList(nodes);
|
||||
const {
|
||||
parentPath
|
||||
} = this;
|
||||
|
||||
if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
|
||||
return parentPath.insertBefore(nodes);
|
||||
} else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
|
||||
if (this.node) nodes.push(this.node);
|
||||
return this.replaceExpressionWithStatements(nodes);
|
||||
} else if (Array.isArray(this.container)) {
|
||||
return this._containerInsertBefore(nodes);
|
||||
} else if (this.isStatementOrBlock()) {
|
||||
const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null);
|
||||
this.replaceWith(t.blockStatement(shouldInsertCurrentNode ? [this.node] : []));
|
||||
return this.unshiftContainer("body", nodes);
|
||||
} else {
|
||||
throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
|
||||
}
|
||||
}
|
||||
|
||||
function _containerInsert(from, nodes) {
|
||||
this.updateSiblingKeys(from, nodes.length);
|
||||
const paths = [];
|
||||
this.container.splice(from, 0, ...nodes);
|
||||
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
const to = from + i;
|
||||
const path = this.getSibling(to);
|
||||
paths.push(path);
|
||||
|
||||
if (this.context && this.context.queue) {
|
||||
path.pushContext(this.context);
|
||||
}
|
||||
}
|
||||
|
||||
const contexts = this._getQueueContexts();
|
||||
|
||||
for (const path of paths) {
|
||||
path.setScope();
|
||||
path.debug("Inserted.");
|
||||
|
||||
for (const context of contexts) {
|
||||
context.maybeQueue(path, true);
|
||||
}
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
function _containerInsertBefore(nodes) {
|
||||
return this._containerInsert(this.key, nodes);
|
||||
}
|
||||
|
||||
function _containerInsertAfter(nodes) {
|
||||
return this._containerInsert(this.key + 1, nodes);
|
||||
}
|
||||
|
||||
function insertAfter(nodes) {
|
||||
this._assertUnremoved();
|
||||
|
||||
nodes = this._verifyNodeList(nodes);
|
||||
const {
|
||||
parentPath
|
||||
} = this;
|
||||
|
||||
if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
|
||||
return parentPath.insertAfter(nodes.map(node => {
|
||||
return t.isExpression(node) ? t.expressionStatement(node) : node;
|
||||
}));
|
||||
} else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
|
||||
if (this.node) {
|
||||
let {
|
||||
scope
|
||||
} = this;
|
||||
|
||||
if (parentPath.isMethod({
|
||||
computed: true,
|
||||
key: this.node
|
||||
})) {
|
||||
scope = scope.parent;
|
||||
}
|
||||
|
||||
const temp = scope.generateDeclaredUidIdentifier();
|
||||
nodes.unshift(t.expressionStatement(t.assignmentExpression("=", t.cloneNode(temp), this.node)));
|
||||
nodes.push(t.expressionStatement(t.cloneNode(temp)));
|
||||
}
|
||||
|
||||
return this.replaceExpressionWithStatements(nodes);
|
||||
} else if (Array.isArray(this.container)) {
|
||||
return this._containerInsertAfter(nodes);
|
||||
} else if (this.isStatementOrBlock()) {
|
||||
const shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null);
|
||||
this.replaceWith(t.blockStatement(shouldInsertCurrentNode ? [this.node] : []));
|
||||
return this.pushContainer("body", nodes);
|
||||
} else {
|
||||
throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
|
||||
}
|
||||
}
|
||||
|
||||
function updateSiblingKeys(fromIndex, incrementBy) {
|
||||
if (!this.parent) return;
|
||||
|
||||
const paths = _cache.path.get(this.parent);
|
||||
|
||||
for (let i = 0; i < paths.length; i++) {
|
||||
const path = paths[i];
|
||||
|
||||
if (path.key >= fromIndex) {
|
||||
path.key += incrementBy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _verifyNodeList(nodes) {
|
||||
if (!nodes) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (nodes.constructor !== Array) {
|
||||
nodes = [nodes];
|
||||
}
|
||||
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
const node = nodes[i];
|
||||
let msg;
|
||||
|
||||
if (!node) {
|
||||
msg = "has falsy node";
|
||||
} else if (typeof node !== "object") {
|
||||
msg = "contains a non-object node";
|
||||
} else if (!node.type) {
|
||||
msg = "without a type";
|
||||
} else if (node instanceof _index.default) {
|
||||
msg = "has a NodePath when it expected a raw object";
|
||||
}
|
||||
|
||||
if (msg) {
|
||||
const type = Array.isArray(node) ? "array" : typeof node;
|
||||
throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`);
|
||||
}
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
function unshiftContainer(listKey, nodes) {
|
||||
this._assertUnremoved();
|
||||
|
||||
nodes = this._verifyNodeList(nodes);
|
||||
|
||||
const path = _index.default.get({
|
||||
parentPath: this,
|
||||
parent: this.node,
|
||||
container: this.node[listKey],
|
||||
listKey,
|
||||
key: 0
|
||||
});
|
||||
|
||||
return path._containerInsertBefore(nodes);
|
||||
}
|
||||
|
||||
function pushContainer(listKey, nodes) {
|
||||
this._assertUnremoved();
|
||||
|
||||
nodes = this._verifyNodeList(nodes);
|
||||
const container = this.node[listKey];
|
||||
|
||||
const path = _index.default.get({
|
||||
parentPath: this,
|
||||
parent: this.node,
|
||||
container: container,
|
||||
listKey,
|
||||
key: container.length
|
||||
});
|
||||
|
||||
return path.replaceWithMultiple(nodes);
|
||||
}
|
||||
|
||||
function hoist(scope = this.scope) {
|
||||
const hoister = new _hoister.default(this, scope);
|
||||
return hoister.run();
|
||||
}
|
||||
70
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/removal.js
generated
vendored
Normal file
70
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/removal.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.remove = remove;
|
||||
exports._removeFromScope = _removeFromScope;
|
||||
exports._callRemovalHooks = _callRemovalHooks;
|
||||
exports._remove = _remove;
|
||||
exports._markRemoved = _markRemoved;
|
||||
exports._assertUnremoved = _assertUnremoved;
|
||||
|
||||
var _removalHooks = require("./lib/removal-hooks");
|
||||
|
||||
var _index = require("./index");
|
||||
|
||||
function remove() {
|
||||
var _this$opts;
|
||||
|
||||
this._assertUnremoved();
|
||||
|
||||
this.resync();
|
||||
|
||||
if (!((_this$opts = this.opts) == null ? void 0 : _this$opts.noScope)) {
|
||||
this._removeFromScope();
|
||||
}
|
||||
|
||||
if (this._callRemovalHooks()) {
|
||||
this._markRemoved();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.shareCommentsWithSiblings();
|
||||
|
||||
this._remove();
|
||||
|
||||
this._markRemoved();
|
||||
}
|
||||
|
||||
function _removeFromScope() {
|
||||
const bindings = this.getBindingIdentifiers();
|
||||
Object.keys(bindings).forEach(name => this.scope.removeBinding(name));
|
||||
}
|
||||
|
||||
function _callRemovalHooks() {
|
||||
for (const fn of _removalHooks.hooks) {
|
||||
if (fn(this, this.parentPath)) return true;
|
||||
}
|
||||
}
|
||||
|
||||
function _remove() {
|
||||
if (Array.isArray(this.container)) {
|
||||
this.container.splice(this.key, 1);
|
||||
this.updateSiblingKeys(this.key, -1);
|
||||
} else {
|
||||
this._replaceWith(null);
|
||||
}
|
||||
}
|
||||
|
||||
function _markRemoved() {
|
||||
this._traverseFlags |= _index.SHOULD_SKIP | _index.REMOVED;
|
||||
this.node = null;
|
||||
}
|
||||
|
||||
function _assertUnremoved() {
|
||||
if (this.removed) {
|
||||
throw this.buildCodeFrameError("NodePath has been removed so is read-only.");
|
||||
}
|
||||
}
|
||||
244
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/replacement.js
generated
vendored
Normal file
244
conf/site/node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/traverse/lib/path/replacement.js
generated
vendored
Normal file
@@ -0,0 +1,244 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.replaceWithMultiple = replaceWithMultiple;
|
||||
exports.replaceWithSourceString = replaceWithSourceString;
|
||||
exports.replaceWith = replaceWith;
|
||||
exports._replaceWith = _replaceWith;
|
||||
exports.replaceExpressionWithStatements = replaceExpressionWithStatements;
|
||||
exports.replaceInline = replaceInline;
|
||||
|
||||
var _codeFrame = require("@babel/code-frame");
|
||||
|
||||
var _index = _interopRequireDefault(require("../index"));
|
||||
|
||||
var _index2 = _interopRequireDefault(require("./index"));
|
||||
|
||||
var _parser = require("@babel/parser");
|
||||
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const hoistVariablesVisitor = {
|
||||
Function(path) {
|
||||
path.skip();
|
||||
},
|
||||
|
||||
VariableDeclaration(path) {
|
||||
if (path.node.kind !== "var") return;
|
||||
const bindings = path.getBindingIdentifiers();
|
||||
|
||||
for (const key of Object.keys(bindings)) {
|
||||
path.scope.push({
|
||||
id: bindings[key]
|
||||
});
|
||||
}
|
||||
|
||||
const exprs = [];
|
||||
|
||||
for (const declar of path.node.declarations) {
|
||||
if (declar.init) {
|
||||
exprs.push(t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init)));
|
||||
}
|
||||
}
|
||||
|
||||
path.replaceWithMultiple(exprs);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function replaceWithMultiple(nodes) {
|
||||
this.resync();
|
||||
nodes = this._verifyNodeList(nodes);
|
||||
t.inheritLeadingComments(nodes[0], this.node);
|
||||
t.inheritTrailingComments(nodes[nodes.length - 1], this.node);
|
||||
this.node = this.container[this.key] = null;
|
||||
const paths = this.insertAfter(nodes);
|
||||
|
||||
if (this.node) {
|
||||
this.requeue();
|
||||
} else {
|
||||
this.remove();
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
function replaceWithSourceString(replacement) {
|
||||
this.resync();
|
||||
|
||||
try {
|
||||
replacement = `(${replacement})`;
|
||||
replacement = (0, _parser.parse)(replacement);
|
||||
} catch (err) {
|
||||
const loc = err.loc;
|
||||
|
||||
if (loc) {
|
||||
err.message += " - make sure this is an expression.\n" + (0, _codeFrame.codeFrameColumns)(replacement, {
|
||||
start: {
|
||||
line: loc.line,
|
||||
column: loc.column + 1
|
||||
}
|
||||
});
|
||||
err.code = "BABEL_REPLACE_SOURCE_ERROR";
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
|
||||
replacement = replacement.program.body[0].expression;
|
||||
|
||||
_index.default.removeProperties(replacement);
|
||||
|
||||
return this.replaceWith(replacement);
|
||||
}
|
||||
|
||||
function replaceWith(replacement) {
|
||||
this.resync();
|
||||
|
||||
if (this.removed) {
|
||||
throw new Error("You can't replace this node, we've already removed it");
|
||||
}
|
||||
|
||||
if (replacement instanceof _index2.default) {
|
||||
replacement = replacement.node;
|
||||
}
|
||||
|
||||
if (!replacement) {
|
||||
throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");
|
||||
}
|
||||
|
||||
if (this.node === replacement) {
|
||||
return [this];
|
||||
}
|
||||
|
||||
if (this.isProgram() && !t.isProgram(replacement)) {
|
||||
throw new Error("You can only replace a Program root node with another Program node");
|
||||
}
|
||||
|
||||
if (Array.isArray(replacement)) {
|
||||
throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");
|
||||
}
|
||||
|
||||
if (typeof replacement === "string") {
|
||||
throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");
|
||||
}
|
||||
|
||||
let nodePath = "";
|
||||
|
||||
if (this.isNodeType("Statement") && t.isExpression(replacement)) {
|
||||
if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) {
|
||||
replacement = t.expressionStatement(replacement);
|
||||
nodePath = "expression";
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isNodeType("Expression") && t.isStatement(replacement)) {
|
||||
if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
|
||||
return this.replaceExpressionWithStatements([replacement]);
|
||||
}
|
||||
}
|
||||
|
||||
const oldNode = this.node;
|
||||
|
||||
if (oldNode) {
|
||||
t.inheritsComments(replacement, oldNode);
|
||||
t.removeComments(oldNode);
|
||||
}
|
||||
|
||||
this._replaceWith(replacement);
|
||||
|
||||
this.type = replacement.type;
|
||||
this.setScope();
|
||||
this.requeue();
|
||||
return [nodePath ? this.get(nodePath) : this];
|
||||
}
|
||||
|
||||
function _replaceWith(node) {
|
||||
if (!this.container) {
|
||||
throw new ReferenceError("Container is falsy");
|
||||
}
|
||||
|
||||
if (this.inList) {
|
||||
t.validate(this.parent, this.key, [node]);
|
||||
} else {
|
||||
t.validate(this.parent, this.key, node);
|
||||
}
|
||||
|
||||
this.debug(`Replace with ${node == null ? void 0 : node.type}`);
|
||||
this.node = this.container[this.key] = node;
|
||||
}
|
||||
|
||||
function replaceExpressionWithStatements(nodes) {
|
||||
this.resync();
|
||||
const toSequenceExpression = t.toSequenceExpression(nodes, this.scope);
|
||||
|
||||
if (toSequenceExpression) {
|
||||
return this.replaceWith(toSequenceExpression)[0].get("expressions");
|
||||
}
|
||||
|
||||
const functionParent = this.getFunctionParent();
|
||||
const isParentAsync = functionParent == null ? void 0 : functionParent.is("async");
|
||||
const container = t.arrowFunctionExpression([], t.blockStatement(nodes));
|
||||
this.replaceWith(t.callExpression(container, []));
|
||||
this.traverse(hoistVariablesVisitor);
|
||||
const completionRecords = this.get("callee").getCompletionRecords();
|
||||
|
||||
for (const path of completionRecords) {
|
||||
if (!path.isExpressionStatement()) continue;
|
||||
const loop = path.findParent(path => path.isLoop());
|
||||
|
||||
if (loop) {
|
||||
let uid = loop.getData("expressionReplacementReturnUid");
|
||||
|
||||
if (!uid) {
|
||||
const callee = this.get("callee");
|
||||
uid = callee.scope.generateDeclaredUidIdentifier("ret");
|
||||
callee.get("body").pushContainer("body", t.returnStatement(t.cloneNode(uid)));
|
||||
loop.setData("expressionReplacementReturnUid", uid);
|
||||
} else {
|
||||
uid = t.identifier(uid.name);
|
||||
}
|
||||
|
||||
path.get("expression").replaceWith(t.assignmentExpression("=", t.cloneNode(uid), path.node.expression));
|
||||
} else {
|
||||
path.replaceWith(t.returnStatement(path.node.expression));
|
||||
}
|
||||
}
|
||||
|
||||
const callee = this.get("callee");
|
||||
callee.arrowFunctionToExpression();
|
||||
|
||||
if (isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", t.FUNCTION_TYPES)) {
|
||||
callee.set("async", true);
|
||||
this.replaceWith(t.awaitExpression(this.node));
|
||||
}
|
||||
|
||||
return callee.get("body.body");
|
||||
}
|
||||
|
||||
function replaceInline(nodes) {
|
||||
this.resync();
|
||||
|
||||
if (Array.isArray(nodes)) {
|
||||
if (Array.isArray(this.container)) {
|
||||
nodes = this._verifyNodeList(nodes);
|
||||
|
||||
const paths = this._containerInsertAfter(nodes);
|
||||
|
||||
this.remove();
|
||||
return paths;
|
||||
} else {
|
||||
return this.replaceWithMultiple(nodes);
|
||||
}
|
||||
} else {
|
||||
return this.replaceWith(nodes);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user