committed by
GitHub
parent
20d2b4f98d
commit
e4f3964f67
6
node_modules/@babel/helpers/lib/helpers-generated.js
generated
vendored
6
node_modules/@babel/helpers/lib/helpers-generated.js
generated
vendored
File diff suppressed because one or more lines are too long
25
node_modules/@babel/helpers/lib/helpers.js
generated
vendored
25
node_modules/@babel/helpers/lib/helpers.js
generated
vendored
@ -284,7 +284,7 @@ helpers.defineProperty = helper("7.0.0-beta.0")`
|
||||
`;
|
||||
helpers.extends = helper("7.0.0-beta.0")`
|
||||
export default function _extends() {
|
||||
_extends = Object.assign || function (target) {
|
||||
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
for (var key in source) {
|
||||
@ -351,7 +351,7 @@ helpers.inheritsLoose = helper("7.0.0-beta.0")`
|
||||
helpers.getPrototypeOf = helper("7.0.0-beta.0")`
|
||||
export default function _getPrototypeOf(o) {
|
||||
_getPrototypeOf = Object.setPrototypeOf
|
||||
? Object.getPrototypeOf
|
||||
? Object.getPrototypeOf.bind()
|
||||
: function _getPrototypeOf(o) {
|
||||
return o.__proto__ || Object.getPrototypeOf(o);
|
||||
};
|
||||
@ -360,10 +360,12 @@ helpers.getPrototypeOf = helper("7.0.0-beta.0")`
|
||||
`;
|
||||
helpers.setPrototypeOf = helper("7.0.0-beta.0")`
|
||||
export default function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
return o;
|
||||
};
|
||||
_setPrototypeOf = Object.setPrototypeOf
|
||||
? Object.setPrototypeOf.bind()
|
||||
: function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
return o;
|
||||
};
|
||||
return _setPrototypeOf(o, p);
|
||||
}
|
||||
`;
|
||||
@ -400,7 +402,7 @@ helpers.construct = helper("7.0.0-beta.0")`
|
||||
|
||||
export default function _construct(Parent, args, Class) {
|
||||
if (isNativeReflectConstruct()) {
|
||||
_construct = Reflect.construct;
|
||||
_construct = Reflect.construct.bind();
|
||||
} else {
|
||||
// NOTE: If Parent !== Class, the correct __proto__ is set *after*
|
||||
// calling the constructor.
|
||||
@ -630,7 +632,7 @@ helpers.get = helper("7.0.0-beta.0")`
|
||||
|
||||
export default function _get() {
|
||||
if (typeof Reflect !== "undefined" && Reflect.get) {
|
||||
_get = Reflect.get;
|
||||
_get = Reflect.get.bind();
|
||||
} else {
|
||||
_get = function _get(target, property, receiver) {
|
||||
var base = superPropBase(target, property);
|
||||
@ -1951,4 +1953,9 @@ helpers.classPrivateMethodInitSpec = helper("7.14.1")`
|
||||
throw new TypeError("attempted to reassign private method");
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
helpers.identity = helper("7.17.0")`
|
||||
export default function _identity(x) {
|
||||
return x;
|
||||
}
|
||||
`;
|
530
node_modules/@babel/helpers/lib/helpers/applyDecs.js
generated
vendored
Normal file
530
node_modules/@babel/helpers/lib/helpers/applyDecs.js
generated
vendored
Normal file
@ -0,0 +1,530 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = applyDecs;
|
||||
|
||||
function createMetadataMethodsForProperty(metadataMap, kind, property, decoratorFinishedRef) {
|
||||
return {
|
||||
getMetadata: function (key) {
|
||||
assertNotFinished(decoratorFinishedRef, "getMetadata");
|
||||
assertMetadataKey(key);
|
||||
var metadataForKey = metadataMap[key];
|
||||
if (metadataForKey === void 0) return void 0;
|
||||
|
||||
if (kind === 1) {
|
||||
var pub = metadataForKey.public;
|
||||
|
||||
if (pub !== void 0) {
|
||||
return pub[property];
|
||||
}
|
||||
} else if (kind === 2) {
|
||||
var priv = metadataForKey.private;
|
||||
|
||||
if (priv !== void 0) {
|
||||
return priv.get(property);
|
||||
}
|
||||
} else if (Object.hasOwnProperty.call(metadataForKey, "constructor")) {
|
||||
return metadataForKey.constructor;
|
||||
}
|
||||
},
|
||||
setMetadata: function (key, value) {
|
||||
assertNotFinished(decoratorFinishedRef, "setMetadata");
|
||||
assertMetadataKey(key);
|
||||
var metadataForKey = metadataMap[key];
|
||||
|
||||
if (metadataForKey === void 0) {
|
||||
metadataForKey = metadataMap[key] = {};
|
||||
}
|
||||
|
||||
if (kind === 1) {
|
||||
var pub = metadataForKey.public;
|
||||
|
||||
if (pub === void 0) {
|
||||
pub = metadataForKey.public = {};
|
||||
}
|
||||
|
||||
pub[property] = value;
|
||||
} else if (kind === 2) {
|
||||
var priv = metadataForKey.priv;
|
||||
|
||||
if (priv === void 0) {
|
||||
priv = metadataForKey.private = new Map();
|
||||
}
|
||||
|
||||
priv.set(property, value);
|
||||
} else {
|
||||
metadataForKey.constructor = value;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function convertMetadataMapToFinal(obj, metadataMap) {
|
||||
var parentMetadataMap = obj[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
||||
var metadataKeys = Object.getOwnPropertySymbols(metadataMap);
|
||||
if (metadataKeys.length === 0) return;
|
||||
|
||||
for (var i = 0; i < metadataKeys.length; i++) {
|
||||
var key = metadataKeys[i];
|
||||
var metaForKey = metadataMap[key];
|
||||
var parentMetaForKey = parentMetadataMap ? parentMetadataMap[key] : null;
|
||||
var pub = metaForKey.public;
|
||||
var parentPub = parentMetaForKey ? parentMetaForKey.public : null;
|
||||
|
||||
if (pub && parentPub) {
|
||||
Object.setPrototypeOf(pub, parentPub);
|
||||
}
|
||||
|
||||
var priv = metaForKey.private;
|
||||
|
||||
if (priv) {
|
||||
var privArr = Array.from(priv.values());
|
||||
var parentPriv = parentMetaForKey ? parentMetaForKey.private : null;
|
||||
|
||||
if (parentPriv) {
|
||||
privArr = privArr.concat(parentPriv);
|
||||
}
|
||||
|
||||
metaForKey.private = privArr;
|
||||
}
|
||||
|
||||
if (parentMetaForKey) {
|
||||
Object.setPrototypeOf(metaForKey, parentMetaForKey);
|
||||
}
|
||||
}
|
||||
|
||||
if (parentMetadataMap) {
|
||||
Object.setPrototypeOf(metadataMap, parentMetadataMap);
|
||||
}
|
||||
|
||||
obj[Symbol.metadata || Symbol.for("Symbol.metadata")] = metadataMap;
|
||||
}
|
||||
|
||||
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
||||
return function addInitializer(initializer) {
|
||||
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
||||
assertCallable(initializer, "An initializer");
|
||||
initializers.push(initializer);
|
||||
};
|
||||
}
|
||||
|
||||
function memberDec(dec, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value) {
|
||||
var kindStr;
|
||||
|
||||
switch (kind) {
|
||||
case 1:
|
||||
kindStr = "accessor";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
kindStr = "method";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
kindStr = "getter";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
kindStr = "setter";
|
||||
break;
|
||||
|
||||
default:
|
||||
kindStr = "field";
|
||||
}
|
||||
|
||||
var ctx = {
|
||||
kind: kindStr,
|
||||
name: isPrivate ? "#" + name : name,
|
||||
isStatic: isStatic,
|
||||
isPrivate: isPrivate
|
||||
};
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
|
||||
if (kind !== 0) {
|
||||
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
||||
}
|
||||
|
||||
var metadataKind, metadataName;
|
||||
|
||||
if (isPrivate) {
|
||||
metadataKind = 2;
|
||||
metadataName = Symbol(name);
|
||||
var access = {};
|
||||
|
||||
if (kind === 0) {
|
||||
access.get = desc.get;
|
||||
access.set = desc.set;
|
||||
} else if (kind === 2) {
|
||||
access.get = function () {
|
||||
return desc.value;
|
||||
};
|
||||
} else {
|
||||
if (kind === 1 || kind === 3) {
|
||||
access.get = function () {
|
||||
return desc.get.call(this);
|
||||
};
|
||||
}
|
||||
|
||||
if (kind === 1 || kind === 4) {
|
||||
access.set = function (v) {
|
||||
desc.set.call(this, v);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
ctx.access = access;
|
||||
} else {
|
||||
metadataKind = 1;
|
||||
metadataName = name;
|
||||
}
|
||||
|
||||
try {
|
||||
return dec(value, Object.assign(ctx, createMetadataMethodsForProperty(metadataMap, metadataKind, metadataName, decoratorFinishedRef)));
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
}
|
||||
|
||||
function assertNotFinished(decoratorFinishedRef, fnName) {
|
||||
if (decoratorFinishedRef.v) {
|
||||
throw new Error("attempted to call " + fnName + " after decoration was finished");
|
||||
}
|
||||
}
|
||||
|
||||
function assertMetadataKey(key) {
|
||||
if (typeof key !== "symbol") {
|
||||
throw new TypeError("Metadata keys must be symbols, received: " + key);
|
||||
}
|
||||
}
|
||||
|
||||
function assertCallable(fn, hint) {
|
||||
if (typeof fn !== "function") {
|
||||
throw new TypeError(hint + " must be a function");
|
||||
}
|
||||
}
|
||||
|
||||
function assertValidReturnValue(kind, value) {
|
||||
var type = typeof value;
|
||||
|
||||
if (kind === 1) {
|
||||
if (type !== "object" || value === null) {
|
||||
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
||||
}
|
||||
|
||||
if (value.get !== undefined) {
|
||||
assertCallable(value.get, "accessor.get");
|
||||
}
|
||||
|
||||
if (value.set !== undefined) {
|
||||
assertCallable(value.set, "accessor.set");
|
||||
}
|
||||
|
||||
if (value.init !== undefined) {
|
||||
assertCallable(value.init, "accessor.init");
|
||||
}
|
||||
|
||||
if (value.initializer !== undefined) {
|
||||
assertCallable(value.initializer, "accessor.initializer");
|
||||
}
|
||||
} else if (type !== "function") {
|
||||
var hint;
|
||||
|
||||
if (kind === 0) {
|
||||
hint = "field";
|
||||
} else if (kind === 10) {
|
||||
hint = "class";
|
||||
} else {
|
||||
hint = "method";
|
||||
}
|
||||
|
||||
throw new TypeError(hint + " decorators must return a function or void 0");
|
||||
}
|
||||
}
|
||||
|
||||
function getInit(desc) {
|
||||
var initializer;
|
||||
|
||||
if ((initializer = desc.init) == null && (initializer = desc.initializer) && typeof console !== "undefined") {
|
||||
console.warn(".initializer has been renamed to .init as of March 2022");
|
||||
}
|
||||
|
||||
return initializer;
|
||||
}
|
||||
|
||||
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers) {
|
||||
var decs = decInfo[0];
|
||||
var desc, initializer, value;
|
||||
|
||||
if (isPrivate) {
|
||||
if (kind === 0 || kind === 1) {
|
||||
desc = {
|
||||
get: decInfo[3],
|
||||
set: decInfo[4]
|
||||
};
|
||||
} else if (kind === 3) {
|
||||
desc = {
|
||||
get: decInfo[3]
|
||||
};
|
||||
} else if (kind === 4) {
|
||||
desc = {
|
||||
set: decInfo[3]
|
||||
};
|
||||
} else {
|
||||
desc = {
|
||||
value: decInfo[3]
|
||||
};
|
||||
}
|
||||
} else if (kind !== 0) {
|
||||
desc = Object.getOwnPropertyDescriptor(base, name);
|
||||
}
|
||||
|
||||
if (kind === 1) {
|
||||
value = {
|
||||
get: desc.get,
|
||||
set: desc.set
|
||||
};
|
||||
} else if (kind === 2) {
|
||||
value = desc.value;
|
||||
} else if (kind === 3) {
|
||||
value = desc.get;
|
||||
} else if (kind === 4) {
|
||||
value = desc.set;
|
||||
}
|
||||
|
||||
var newValue, get, set;
|
||||
|
||||
if (typeof decs === "function") {
|
||||
newValue = memberDec(decs, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value);
|
||||
|
||||
if (newValue !== void 0) {
|
||||
assertValidReturnValue(kind, newValue);
|
||||
|
||||
if (kind === 0) {
|
||||
initializer = newValue;
|
||||
} else if (kind === 1) {
|
||||
initializer = getInit(newValue);
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = decs.length - 1; i >= 0; i--) {
|
||||
var dec = decs[i];
|
||||
newValue = memberDec(dec, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value);
|
||||
|
||||
if (newValue !== void 0) {
|
||||
assertValidReturnValue(kind, newValue);
|
||||
var newInit;
|
||||
|
||||
if (kind === 0) {
|
||||
newInit = newValue;
|
||||
} else if (kind === 1) {
|
||||
newInit = getInit(newValue);
|
||||
get = newValue.get || value.get;
|
||||
set = newValue.set || value.set;
|
||||
value = {
|
||||
get: get,
|
||||
set: set
|
||||
};
|
||||
} else {
|
||||
value = newValue;
|
||||
}
|
||||
|
||||
if (newInit !== void 0) {
|
||||
if (initializer === void 0) {
|
||||
initializer = newInit;
|
||||
} else if (typeof initializer === "function") {
|
||||
initializer = [initializer, newInit];
|
||||
} else {
|
||||
initializer.push(newInit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (kind === 0 || kind === 1) {
|
||||
if (initializer === void 0) {
|
||||
initializer = function (instance, init) {
|
||||
return init;
|
||||
};
|
||||
} else if (typeof initializer !== "function") {
|
||||
var ownInitializers = initializer;
|
||||
|
||||
initializer = function (instance, init) {
|
||||
var value = init;
|
||||
|
||||
for (var i = 0; i < ownInitializers.length; i++) {
|
||||
value = ownInitializers[i].call(instance, value);
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
} else {
|
||||
var originalInitializer = initializer;
|
||||
|
||||
initializer = function (instance, init) {
|
||||
return originalInitializer.call(instance, init);
|
||||
};
|
||||
}
|
||||
|
||||
ret.push(initializer);
|
||||
}
|
||||
|
||||
if (kind !== 0) {
|
||||
if (kind === 1) {
|
||||
desc.get = value.get;
|
||||
desc.set = value.set;
|
||||
} else if (kind === 2) {
|
||||
desc.value = value;
|
||||
} else if (kind === 3) {
|
||||
desc.get = value;
|
||||
} else if (kind === 4) {
|
||||
desc.set = value;
|
||||
}
|
||||
|
||||
if (isPrivate) {
|
||||
if (kind === 1) {
|
||||
ret.push(function (instance, args) {
|
||||
return value.get.call(instance, args);
|
||||
});
|
||||
ret.push(function (instance, args) {
|
||||
return value.set.call(instance, args);
|
||||
});
|
||||
} else if (kind === 2) {
|
||||
ret.push(value);
|
||||
} else {
|
||||
ret.push(function (instance, args) {
|
||||
return value.call(instance, args);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Object.defineProperty(base, name, desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function applyMemberDecs(ret, Class, protoMetadataMap, staticMetadataMap, decInfos) {
|
||||
var protoInitializers;
|
||||
var staticInitializers;
|
||||
var existingProtoNonFields = new Map();
|
||||
var existingStaticNonFields = new Map();
|
||||
|
||||
for (var i = 0; i < decInfos.length; i++) {
|
||||
var decInfo = decInfos[i];
|
||||
if (!Array.isArray(decInfo)) continue;
|
||||
var kind = decInfo[1];
|
||||
var name = decInfo[2];
|
||||
var isPrivate = decInfo.length > 3;
|
||||
var isStatic = kind >= 5;
|
||||
var base;
|
||||
var metadataMap;
|
||||
var initializers;
|
||||
|
||||
if (isStatic) {
|
||||
base = Class;
|
||||
metadataMap = staticMetadataMap;
|
||||
kind = kind - 5;
|
||||
|
||||
if (kind !== 0) {
|
||||
staticInitializers = staticInitializers || [];
|
||||
initializers = staticInitializers;
|
||||
}
|
||||
} else {
|
||||
base = Class.prototype;
|
||||
metadataMap = protoMetadataMap;
|
||||
|
||||
if (kind !== 0) {
|
||||
protoInitializers = protoInitializers || [];
|
||||
initializers = protoInitializers;
|
||||
}
|
||||
}
|
||||
|
||||
if (kind !== 0 && !isPrivate) {
|
||||
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
||||
var existingKind = existingNonFields.get(name) || 0;
|
||||
|
||||
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
|
||||
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
||||
} else if (!existingKind && kind > 2) {
|
||||
existingNonFields.set(name, kind);
|
||||
} else {
|
||||
existingNonFields.set(name, true);
|
||||
}
|
||||
}
|
||||
|
||||
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers);
|
||||
}
|
||||
|
||||
pushInitializers(ret, protoInitializers);
|
||||
pushInitializers(ret, staticInitializers);
|
||||
}
|
||||
|
||||
function pushInitializers(ret, initializers) {
|
||||
if (initializers) {
|
||||
ret.push(function (instance) {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(instance);
|
||||
}
|
||||
|
||||
return instance;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function applyClassDecs(ret, targetClass, metadataMap, classDecs) {
|
||||
if (classDecs.length > 0) {
|
||||
var initializers = [];
|
||||
var newClass = targetClass;
|
||||
var name = targetClass.name;
|
||||
|
||||
for (var i = classDecs.length - 1; i >= 0; i--) {
|
||||
var decoratorFinishedRef = {
|
||||
v: false
|
||||
};
|
||||
|
||||
try {
|
||||
var ctx = Object.assign({
|
||||
kind: "class",
|
||||
name: name,
|
||||
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
|
||||
}, createMetadataMethodsForProperty(metadataMap, 0, name, decoratorFinishedRef));
|
||||
var nextNewClass = classDecs[i](newClass, ctx);
|
||||
} finally {
|
||||
decoratorFinishedRef.v = true;
|
||||
}
|
||||
|
||||
if (nextNewClass !== undefined) {
|
||||
assertValidReturnValue(10, nextNewClass);
|
||||
newClass = nextNewClass;
|
||||
}
|
||||
}
|
||||
|
||||
ret.push(newClass, function () {
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
initializers[i].call(newClass);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function applyDecs(targetClass, memberDecs, classDecs) {
|
||||
var ret = [];
|
||||
var staticMetadataMap = {};
|
||||
var protoMetadataMap = {};
|
||||
applyMemberDecs(ret, targetClass, protoMetadataMap, staticMetadataMap, memberDecs);
|
||||
convertMetadataMapToFinal(targetClass.prototype, protoMetadataMap);
|
||||
applyClassDecs(ret, targetClass, staticMetadataMap, classDecs);
|
||||
convertMetadataMapToFinal(targetClass, staticMetadataMap);
|
||||
return ret;
|
||||
}
|
587
node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js
generated
vendored
Normal file
587
node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js
generated
vendored
Normal file
@ -0,0 +1,587 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _regeneratorRuntime;
|
||||
|
||||
function _regeneratorRuntime() {
|
||||
"use strict";
|
||||
|
||||
exports.default = _regeneratorRuntime = function () {
|
||||
return exports;
|
||||
};
|
||||
|
||||
var exports = {};
|
||||
var Op = Object.prototype;
|
||||
var hasOwn = Op.hasOwnProperty;
|
||||
var undefined;
|
||||
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
||||
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
||||
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
||||
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
||||
|
||||
function define(obj, key, value) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
return obj[key];
|
||||
}
|
||||
|
||||
try {
|
||||
define({}, "");
|
||||
} catch (err) {
|
||||
define = function (obj, key, value) {
|
||||
return obj[key] = value;
|
||||
};
|
||||
}
|
||||
|
||||
function wrap(innerFn, outerFn, self, tryLocsList) {
|
||||
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
||||
var generator = Object.create(protoGenerator.prototype);
|
||||
var context = new Context(tryLocsList || []);
|
||||
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
||||
return generator;
|
||||
}
|
||||
|
||||
exports.wrap = wrap;
|
||||
|
||||
function tryCatch(fn, obj, arg) {
|
||||
try {
|
||||
return {
|
||||
type: "normal",
|
||||
arg: fn.call(obj, arg)
|
||||
};
|
||||
} catch (err) {
|
||||
return {
|
||||
type: "throw",
|
||||
arg: err
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
var GenStateSuspendedStart = "suspendedStart";
|
||||
var GenStateSuspendedYield = "suspendedYield";
|
||||
var GenStateExecuting = "executing";
|
||||
var GenStateCompleted = "completed";
|
||||
var ContinueSentinel = {};
|
||||
|
||||
function Generator() {}
|
||||
|
||||
function GeneratorFunction() {}
|
||||
|
||||
function GeneratorFunctionPrototype() {}
|
||||
|
||||
var IteratorPrototype = {};
|
||||
define(IteratorPrototype, iteratorSymbol, function () {
|
||||
return this;
|
||||
});
|
||||
var getProto = Object.getPrototypeOf;
|
||||
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
||||
|
||||
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
||||
IteratorPrototype = NativeIteratorPrototype;
|
||||
}
|
||||
|
||||
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
||||
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
||||
define(Gp, "constructor", GeneratorFunctionPrototype);
|
||||
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
||||
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
|
||||
|
||||
function defineIteratorMethods(prototype) {
|
||||
["next", "throw", "return"].forEach(function (method) {
|
||||
define(prototype, method, function (arg) {
|
||||
return this._invoke(method, arg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
exports.isGeneratorFunction = function (genFun) {
|
||||
var ctor = typeof genFun === "function" && genFun.constructor;
|
||||
return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
|
||||
};
|
||||
|
||||
exports.mark = function (genFun) {
|
||||
if (Object.setPrototypeOf) {
|
||||
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
||||
} else {
|
||||
genFun.__proto__ = GeneratorFunctionPrototype;
|
||||
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
||||
}
|
||||
|
||||
genFun.prototype = Object.create(Gp);
|
||||
return genFun;
|
||||
};
|
||||
|
||||
exports.awrap = function (arg) {
|
||||
return {
|
||||
__await: arg
|
||||
};
|
||||
};
|
||||
|
||||
function AsyncIterator(generator, PromiseImpl) {
|
||||
function invoke(method, arg, resolve, reject) {
|
||||
var record = tryCatch(generator[method], generator, arg);
|
||||
|
||||
if (record.type === "throw") {
|
||||
reject(record.arg);
|
||||
} else {
|
||||
var result = record.arg;
|
||||
var value = result.value;
|
||||
|
||||
if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
|
||||
return PromiseImpl.resolve(value.__await).then(function (value) {
|
||||
invoke("next", value, resolve, reject);
|
||||
}, function (err) {
|
||||
invoke("throw", err, resolve, reject);
|
||||
});
|
||||
}
|
||||
|
||||
return PromiseImpl.resolve(value).then(function (unwrapped) {
|
||||
result.value = unwrapped;
|
||||
resolve(result);
|
||||
}, function (error) {
|
||||
return invoke("throw", error, resolve, reject);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var previousPromise;
|
||||
|
||||
function enqueue(method, arg) {
|
||||
function callInvokeWithMethodAndArg() {
|
||||
return new PromiseImpl(function (resolve, reject) {
|
||||
invoke(method, arg, resolve, reject);
|
||||
});
|
||||
}
|
||||
|
||||
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
||||
}
|
||||
|
||||
this._invoke = enqueue;
|
||||
}
|
||||
|
||||
defineIteratorMethods(AsyncIterator.prototype);
|
||||
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
||||
return this;
|
||||
});
|
||||
exports.AsyncIterator = AsyncIterator;
|
||||
|
||||
exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
||||
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
||||
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
||||
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
||||
return result.done ? result.value : iter.next();
|
||||
});
|
||||
};
|
||||
|
||||
function makeInvokeMethod(innerFn, self, context) {
|
||||
var state = GenStateSuspendedStart;
|
||||
return function invoke(method, arg) {
|
||||
if (state === GenStateExecuting) {
|
||||
throw new Error("Generator is already running");
|
||||
}
|
||||
|
||||
if (state === GenStateCompleted) {
|
||||
if (method === "throw") {
|
||||
throw arg;
|
||||
}
|
||||
|
||||
return doneResult();
|
||||
}
|
||||
|
||||
context.method = method;
|
||||
context.arg = arg;
|
||||
|
||||
while (true) {
|
||||
var delegate = context.delegate;
|
||||
|
||||
if (delegate) {
|
||||
var delegateResult = maybeInvokeDelegate(delegate, context);
|
||||
|
||||
if (delegateResult) {
|
||||
if (delegateResult === ContinueSentinel) continue;
|
||||
return delegateResult;
|
||||
}
|
||||
}
|
||||
|
||||
if (context.method === "next") {
|
||||
context.sent = context._sent = context.arg;
|
||||
} else if (context.method === "throw") {
|
||||
if (state === GenStateSuspendedStart) {
|
||||
state = GenStateCompleted;
|
||||
throw context.arg;
|
||||
}
|
||||
|
||||
context.dispatchException(context.arg);
|
||||
} else if (context.method === "return") {
|
||||
context.abrupt("return", context.arg);
|
||||
}
|
||||
|
||||
state = GenStateExecuting;
|
||||
var record = tryCatch(innerFn, self, context);
|
||||
|
||||
if (record.type === "normal") {
|
||||
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
|
||||
|
||||
if (record.arg === ContinueSentinel) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return {
|
||||
value: record.arg,
|
||||
done: context.done
|
||||
};
|
||||
} else if (record.type === "throw") {
|
||||
state = GenStateCompleted;
|
||||
context.method = "throw";
|
||||
context.arg = record.arg;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function maybeInvokeDelegate(delegate, context) {
|
||||
var method = delegate.iterator[context.method];
|
||||
|
||||
if (method === undefined) {
|
||||
context.delegate = null;
|
||||
|
||||
if (context.method === "throw") {
|
||||
if (delegate.iterator["return"]) {
|
||||
context.method = "return";
|
||||
context.arg = undefined;
|
||||
maybeInvokeDelegate(delegate, context);
|
||||
|
||||
if (context.method === "throw") {
|
||||
return ContinueSentinel;
|
||||
}
|
||||
}
|
||||
|
||||
context.method = "throw";
|
||||
context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
||||
}
|
||||
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
var record = tryCatch(method, delegate.iterator, context.arg);
|
||||
|
||||
if (record.type === "throw") {
|
||||
context.method = "throw";
|
||||
context.arg = record.arg;
|
||||
context.delegate = null;
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
var info = record.arg;
|
||||
|
||||
if (!info) {
|
||||
context.method = "throw";
|
||||
context.arg = new TypeError("iterator result is not an object");
|
||||
context.delegate = null;
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
context[delegate.resultName] = info.value;
|
||||
context.next = delegate.nextLoc;
|
||||
|
||||
if (context.method !== "return") {
|
||||
context.method = "next";
|
||||
context.arg = undefined;
|
||||
}
|
||||
} else {
|
||||
return info;
|
||||
}
|
||||
|
||||
context.delegate = null;
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
defineIteratorMethods(Gp);
|
||||
define(Gp, toStringTagSymbol, "Generator");
|
||||
define(Gp, iteratorSymbol, function () {
|
||||
return this;
|
||||
});
|
||||
define(Gp, "toString", function () {
|
||||
return "[object Generator]";
|
||||
});
|
||||
|
||||
function pushTryEntry(locs) {
|
||||
var entry = {
|
||||
tryLoc: locs[0]
|
||||
};
|
||||
|
||||
if (1 in locs) {
|
||||
entry.catchLoc = locs[1];
|
||||
}
|
||||
|
||||
if (2 in locs) {
|
||||
entry.finallyLoc = locs[2];
|
||||
entry.afterLoc = locs[3];
|
||||
}
|
||||
|
||||
this.tryEntries.push(entry);
|
||||
}
|
||||
|
||||
function resetTryEntry(entry) {
|
||||
var record = entry.completion || {};
|
||||
record.type = "normal";
|
||||
delete record.arg;
|
||||
entry.completion = record;
|
||||
}
|
||||
|
||||
function Context(tryLocsList) {
|
||||
this.tryEntries = [{
|
||||
tryLoc: "root"
|
||||
}];
|
||||
tryLocsList.forEach(pushTryEntry, this);
|
||||
this.reset(true);
|
||||
}
|
||||
|
||||
exports.keys = function (object) {
|
||||
var keys = [];
|
||||
|
||||
for (var key in object) {
|
||||
keys.push(key);
|
||||
}
|
||||
|
||||
keys.reverse();
|
||||
return function next() {
|
||||
while (keys.length) {
|
||||
var key = keys.pop();
|
||||
|
||||
if (key in object) {
|
||||
next.value = key;
|
||||
next.done = false;
|
||||
return next;
|
||||
}
|
||||
}
|
||||
|
||||
next.done = true;
|
||||
return next;
|
||||
};
|
||||
};
|
||||
|
||||
function values(iterable) {
|
||||
if (iterable) {
|
||||
var iteratorMethod = iterable[iteratorSymbol];
|
||||
|
||||
if (iteratorMethod) {
|
||||
return iteratorMethod.call(iterable);
|
||||
}
|
||||
|
||||
if (typeof iterable.next === "function") {
|
||||
return iterable;
|
||||
}
|
||||
|
||||
if (!isNaN(iterable.length)) {
|
||||
var i = -1,
|
||||
next = function next() {
|
||||
while (++i < iterable.length) {
|
||||
if (hasOwn.call(iterable, i)) {
|
||||
next.value = iterable[i];
|
||||
next.done = false;
|
||||
return next;
|
||||
}
|
||||
}
|
||||
|
||||
next.value = undefined;
|
||||
next.done = true;
|
||||
return next;
|
||||
};
|
||||
|
||||
return next.next = next;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
next: doneResult
|
||||
};
|
||||
}
|
||||
|
||||
exports.values = values;
|
||||
|
||||
function doneResult() {
|
||||
return {
|
||||
value: undefined,
|
||||
done: true
|
||||
};
|
||||
}
|
||||
|
||||
Context.prototype = {
|
||||
constructor: Context,
|
||||
reset: function (skipTempReset) {
|
||||
this.prev = 0;
|
||||
this.next = 0;
|
||||
this.sent = this._sent = undefined;
|
||||
this.done = false;
|
||||
this.delegate = null;
|
||||
this.method = "next";
|
||||
this.arg = undefined;
|
||||
this.tryEntries.forEach(resetTryEntry);
|
||||
|
||||
if (!skipTempReset) {
|
||||
for (var name in this) {
|
||||
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
|
||||
this[name] = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
stop: function () {
|
||||
this.done = true;
|
||||
var rootEntry = this.tryEntries[0];
|
||||
var rootRecord = rootEntry.completion;
|
||||
|
||||
if (rootRecord.type === "throw") {
|
||||
throw rootRecord.arg;
|
||||
}
|
||||
|
||||
return this.rval;
|
||||
},
|
||||
dispatchException: function (exception) {
|
||||
if (this.done) {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
var context = this;
|
||||
|
||||
function handle(loc, caught) {
|
||||
record.type = "throw";
|
||||
record.arg = exception;
|
||||
context.next = loc;
|
||||
|
||||
if (caught) {
|
||||
context.method = "next";
|
||||
context.arg = undefined;
|
||||
}
|
||||
|
||||
return !!caught;
|
||||
}
|
||||
|
||||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||||
var entry = this.tryEntries[i];
|
||||
var record = entry.completion;
|
||||
|
||||
if (entry.tryLoc === "root") {
|
||||
return handle("end");
|
||||
}
|
||||
|
||||
if (entry.tryLoc <= this.prev) {
|
||||
var hasCatch = hasOwn.call(entry, "catchLoc");
|
||||
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
||||
|
||||
if (hasCatch && hasFinally) {
|
||||
if (this.prev < entry.catchLoc) {
|
||||
return handle(entry.catchLoc, true);
|
||||
} else if (this.prev < entry.finallyLoc) {
|
||||
return handle(entry.finallyLoc);
|
||||
}
|
||||
} else if (hasCatch) {
|
||||
if (this.prev < entry.catchLoc) {
|
||||
return handle(entry.catchLoc, true);
|
||||
}
|
||||
} else if (hasFinally) {
|
||||
if (this.prev < entry.finallyLoc) {
|
||||
return handle(entry.finallyLoc);
|
||||
}
|
||||
} else {
|
||||
throw new Error("try statement without catch or finally");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
abrupt: function (type, arg) {
|
||||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||||
var entry = this.tryEntries[i];
|
||||
|
||||
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
||||
var finallyEntry = entry;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
|
||||
finallyEntry = null;
|
||||
}
|
||||
|
||||
var record = finallyEntry ? finallyEntry.completion : {};
|
||||
record.type = type;
|
||||
record.arg = arg;
|
||||
|
||||
if (finallyEntry) {
|
||||
this.method = "next";
|
||||
this.next = finallyEntry.finallyLoc;
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
return this.complete(record);
|
||||
},
|
||||
complete: function (record, afterLoc) {
|
||||
if (record.type === "throw") {
|
||||
throw record.arg;
|
||||
}
|
||||
|
||||
if (record.type === "break" || record.type === "continue") {
|
||||
this.next = record.arg;
|
||||
} else if (record.type === "return") {
|
||||
this.rval = this.arg = record.arg;
|
||||
this.method = "return";
|
||||
this.next = "end";
|
||||
} else if (record.type === "normal" && afterLoc) {
|
||||
this.next = afterLoc;
|
||||
}
|
||||
|
||||
return ContinueSentinel;
|
||||
},
|
||||
finish: function (finallyLoc) {
|
||||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||||
var entry = this.tryEntries[i];
|
||||
|
||||
if (entry.finallyLoc === finallyLoc) {
|
||||
this.complete(entry.completion, entry.afterLoc);
|
||||
resetTryEntry(entry);
|
||||
return ContinueSentinel;
|
||||
}
|
||||
}
|
||||
},
|
||||
catch: function (tryLoc) {
|
||||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||||
var entry = this.tryEntries[i];
|
||||
|
||||
if (entry.tryLoc === tryLoc) {
|
||||
var record = entry.completion;
|
||||
|
||||
if (record.type === "throw") {
|
||||
var thrown = record.arg;
|
||||
resetTryEntry(entry);
|
||||
}
|
||||
|
||||
return thrown;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error("illegal catch attempt");
|
||||
},
|
||||
delegateYield: function (iterable, resultName, nextLoc) {
|
||||
this.delegate = {
|
||||
iterator: values(iterable),
|
||||
resultName: resultName,
|
||||
nextLoc: nextLoc
|
||||
};
|
||||
|
||||
if (this.method === "next") {
|
||||
this.arg = undefined;
|
||||
}
|
||||
|
||||
return ContinueSentinel;
|
||||
}
|
||||
};
|
||||
return exports;
|
||||
}
|
136
node_modules/@babel/helpers/lib/index.js
generated
vendored
136
node_modules/@babel/helpers/lib/index.js
generated
vendored
@ -20,10 +20,8 @@ const {
|
||||
assignmentExpression,
|
||||
cloneNode,
|
||||
expressionStatement,
|
||||
file: t_file,
|
||||
identifier,
|
||||
variableDeclaration,
|
||||
variableDeclarator
|
||||
file,
|
||||
identifier
|
||||
} = _t;
|
||||
|
||||
function makePath(path) {
|
||||
@ -37,7 +35,7 @@ function makePath(path) {
|
||||
return parts.reverse().join(".");
|
||||
}
|
||||
|
||||
let fileClass = undefined;
|
||||
let FileClass = undefined;
|
||||
|
||||
function getHelperMetadata(file) {
|
||||
const globals = new Set();
|
||||
@ -68,14 +66,11 @@ function getHelperMetadata(file) {
|
||||
ExportDefaultDeclaration(child) {
|
||||
const decl = child.get("declaration");
|
||||
|
||||
if (decl.isFunctionDeclaration()) {
|
||||
if (!decl.node.id) {
|
||||
throw decl.buildCodeFrameError("Helpers should give names to their exported func declaration");
|
||||
}
|
||||
|
||||
exportName = decl.node.id.name;
|
||||
if (!decl.isFunctionDeclaration() || !decl.node.id) {
|
||||
throw decl.buildCodeFrameError("Helpers can only export named function declarations");
|
||||
}
|
||||
|
||||
exportName = decl.node.id.name;
|
||||
exportPath = makePath(child);
|
||||
},
|
||||
|
||||
@ -132,7 +127,7 @@ function getHelperMetadata(file) {
|
||||
};
|
||||
(0, _traverse.default)(file.ast, dependencyVisitor, file.scope);
|
||||
(0, _traverse.default)(file.ast, referenceVisitor, file.scope);
|
||||
if (!exportPath) throw new Error("Helpers must default-export something.");
|
||||
if (!exportPath) throw new Error("Helpers must have a default export.");
|
||||
exportBindingAssignments.reverse();
|
||||
return {
|
||||
globals: Array.from(globals),
|
||||
@ -179,50 +174,37 @@ function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
|
||||
toRename[exportName] = id.name;
|
||||
}
|
||||
|
||||
const visitor = {
|
||||
Program(path) {
|
||||
const exp = path.get(exportPath);
|
||||
const imps = importPaths.map(p => path.get(p));
|
||||
const impsBindingRefs = importBindingsReferences.map(p => path.get(p));
|
||||
const decl = exp.get("declaration");
|
||||
const {
|
||||
path
|
||||
} = file;
|
||||
const exp = path.get(exportPath);
|
||||
const imps = importPaths.map(p => path.get(p));
|
||||
const impsBindingRefs = importBindingsReferences.map(p => path.get(p));
|
||||
const decl = exp.get("declaration");
|
||||
|
||||
if (id.type === "Identifier") {
|
||||
if (decl.isFunctionDeclaration()) {
|
||||
exp.replaceWith(decl);
|
||||
} else {
|
||||
exp.replaceWith(variableDeclaration("var", [variableDeclarator(id, decl.node)]));
|
||||
}
|
||||
} else if (id.type === "MemberExpression") {
|
||||
if (decl.isFunctionDeclaration()) {
|
||||
exportBindingAssignments.forEach(assignPath => {
|
||||
const assign = path.get(assignPath);
|
||||
assign.replaceWith(assignmentExpression("=", id, assign.node));
|
||||
});
|
||||
exp.replaceWith(decl);
|
||||
path.pushContainer("body", expressionStatement(assignmentExpression("=", id, identifier(exportName))));
|
||||
} else {
|
||||
exp.replaceWith(expressionStatement(assignmentExpression("=", id, decl.node)));
|
||||
}
|
||||
} else {
|
||||
throw new Error("Unexpected helper format.");
|
||||
}
|
||||
if (id.type === "Identifier") {
|
||||
exp.replaceWith(decl);
|
||||
} else if (id.type === "MemberExpression") {
|
||||
exportBindingAssignments.forEach(assignPath => {
|
||||
const assign = path.get(assignPath);
|
||||
assign.replaceWith(assignmentExpression("=", id, assign.node));
|
||||
});
|
||||
exp.replaceWith(decl);
|
||||
path.pushContainer("body", expressionStatement(assignmentExpression("=", id, identifier(exportName))));
|
||||
} else {
|
||||
throw new Error("Unexpected helper format.");
|
||||
}
|
||||
|
||||
Object.keys(toRename).forEach(name => {
|
||||
path.scope.rename(name, toRename[name]);
|
||||
});
|
||||
Object.keys(toRename).forEach(name => {
|
||||
path.scope.rename(name, toRename[name]);
|
||||
});
|
||||
|
||||
for (const path of imps) path.remove();
|
||||
for (const path of imps) path.remove();
|
||||
|
||||
for (const path of impsBindingRefs) {
|
||||
const node = cloneNode(dependenciesRefs[path.node.name]);
|
||||
path.replaceWith(node);
|
||||
}
|
||||
|
||||
path.stop();
|
||||
}
|
||||
|
||||
};
|
||||
(0, _traverse.default)(file.ast, visitor, file.scope);
|
||||
for (const path of impsBindingRefs) {
|
||||
const node = cloneNode(dependenciesRefs[path.node.name]);
|
||||
path.replaceWith(node);
|
||||
}
|
||||
}
|
||||
|
||||
const helperData = Object.create(null);
|
||||
@ -239,23 +221,34 @@ function loadHelper(name) {
|
||||
}
|
||||
|
||||
const fn = () => {
|
||||
const file = {
|
||||
ast: t_file(helper.ast())
|
||||
};
|
||||
|
||||
if (fileClass) {
|
||||
return new fileClass({
|
||||
filename: `babel-helper://${name}`
|
||||
}, file);
|
||||
{
|
||||
if (!FileClass) {
|
||||
const fakeFile = {
|
||||
ast: file(helper.ast()),
|
||||
path: null
|
||||
};
|
||||
(0, _traverse.default)(fakeFile.ast, {
|
||||
Program: path => (fakeFile.path = path).stop()
|
||||
});
|
||||
return fakeFile;
|
||||
}
|
||||
}
|
||||
|
||||
return file;
|
||||
return new FileClass({
|
||||
filename: `babel-helper://${name}`
|
||||
}, {
|
||||
ast: file(helper.ast()),
|
||||
code: "[internal Babel helper code]",
|
||||
inputMap: null
|
||||
});
|
||||
};
|
||||
|
||||
const metadata = getHelperMetadata(fn());
|
||||
let metadata = null;
|
||||
helperData[name] = {
|
||||
minVersion: helper.minVersion,
|
||||
|
||||
build(getDependency, id, localBindings) {
|
||||
const file = fn();
|
||||
metadata || (metadata = getHelperMetadata(file));
|
||||
permuteHelperAST(file, metadata, id, localBindings, getDependency);
|
||||
return {
|
||||
nodes: file.ast.program.body,
|
||||
@ -263,11 +256,11 @@ function loadHelper(name) {
|
||||
};
|
||||
},
|
||||
|
||||
minVersion() {
|
||||
return helper.minVersion;
|
||||
},
|
||||
getDependencies() {
|
||||
metadata || (metadata = getHelperMetadata(fn()));
|
||||
return Array.from(metadata.dependencies.values());
|
||||
}
|
||||
|
||||
dependencies: metadata.dependencies
|
||||
};
|
||||
}
|
||||
|
||||
@ -279,18 +272,15 @@ function get(name, getDependency, id, localBindings) {
|
||||
}
|
||||
|
||||
function minVersion(name) {
|
||||
return loadHelper(name).minVersion();
|
||||
return loadHelper(name).minVersion;
|
||||
}
|
||||
|
||||
function getDependencies(name) {
|
||||
return Array.from(loadHelper(name).dependencies.values());
|
||||
return loadHelper(name).getDependencies();
|
||||
}
|
||||
|
||||
function ensure(name, newFileClass) {
|
||||
if (!fileClass) {
|
||||
fileClass = newFileClass;
|
||||
}
|
||||
|
||||
FileClass || (FileClass = newFileClass);
|
||||
loadHelper(name);
|
||||
}
|
||||
|
||||
|
16
node_modules/@babel/helpers/package.json
generated
vendored
16
node_modules/@babel/helpers/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helpers",
|
||||
"version": "7.16.7",
|
||||
"version": "7.18.6",
|
||||
"description": "Collection of helper functions used by Babel transforms.",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-helpers",
|
||||
@ -15,15 +15,19 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.16.7",
|
||||
"@babel/traverse": "^7.16.7",
|
||||
"@babel/types": "^7.16.7"
|
||||
"@babel/template": "^7.18.6",
|
||||
"@babel/traverse": "^7.18.6",
|
||||
"@babel/types": "^7.18.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.16.7",
|
||||
"@babel/generator": "^7.18.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.18.6",
|
||||
"@babel/parser": "^7.18.6",
|
||||
"regenerator-runtime": "^0.13.9",
|
||||
"terser": "^5.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
6
node_modules/@babel/helpers/scripts/generate-helpers.js
generated
vendored
6
node_modules/@babel/helpers/scripts/generate-helpers.js
generated
vendored
@ -1,7 +1,7 @@
|
||||
import fs from "fs";
|
||||
import { join } from "path";
|
||||
import { URL, fileURLToPath } from "url";
|
||||
import { minify } from "terser"; // eslint-disable-line
|
||||
import { minify } from "terser"; // eslint-disable-line import/no-extraneous-dependencies
|
||||
|
||||
const HELPERS_FOLDER = new URL("../src/helpers", import.meta.url);
|
||||
const IGNORED_FILES = new Set(["package.json"]);
|
||||
@ -14,10 +14,10 @@ export default async function generateHelpers() {
|
||||
|
||||
import template from "@babel/template";
|
||||
|
||||
function helper(minVersion, source) {
|
||||
function helper(minVersion: string, source: string) {
|
||||
return Object.freeze({
|
||||
minVersion,
|
||||
ast: () => template.program.ast(source),
|
||||
ast: () => template.program.ast(source, { preserveComments: true }),
|
||||
})
|
||||
}
|
||||
|
||||
|
64
node_modules/@babel/helpers/scripts/generate-regenerator-runtime.js
generated
vendored
Normal file
64
node_modules/@babel/helpers/scripts/generate-regenerator-runtime.js
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
|
||||
import fs from "fs";
|
||||
import { createRequire } from "module";
|
||||
|
||||
const [parse, generate] = await Promise.all([
|
||||
import("@babel/parser").then(ns => ns.parse),
|
||||
import("@babel/generator").then(ns => ns.default.default),
|
||||
]).catch(error =>
|
||||
Promise.reject(
|
||||
new Error(
|
||||
"Before running generate-helpers.js you must compile @babel/parser and @babel/generator.",
|
||||
{ cause: error }
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
const REGENERATOR_RUNTIME_IN_FILE = fs.readFileSync(
|
||||
createRequire(import.meta.url).resolve("regenerator-runtime"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
const MIN_VERSION = "7.18.0";
|
||||
|
||||
const HEADER = `/* @minVersion ${MIN_VERSION} */
|
||||
/*
|
||||
* This file is auto-generated! Do not modify it directly.
|
||||
* To re-generate, update the regenerator-runtime dependency of
|
||||
* @babel/helpers and run 'yarn gulp generate-runtime-helpers'.
|
||||
*/
|
||||
|
||||
/* eslint-disable */
|
||||
`;
|
||||
|
||||
const COPYRIGHT = `/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */`;
|
||||
|
||||
export default function generateRegeneratorRuntimeHelper() {
|
||||
const ast = parse(REGENERATOR_RUNTIME_IN_FILE, { sourceType: "script" });
|
||||
|
||||
const factoryFunction = ast.program.body[0].declarations[0].init.callee;
|
||||
factoryFunction.type = "FunctionDeclaration";
|
||||
factoryFunction.id = { type: "Identifier", name: "_regeneratorRuntime" };
|
||||
factoryFunction.params = [];
|
||||
factoryFunction.body.body.unshift(
|
||||
...stmts(`
|
||||
${COPYRIGHT}
|
||||
_regeneratorRuntime = function () { return exports; };
|
||||
var exports = {};
|
||||
`)
|
||||
);
|
||||
|
||||
const { code } = generate({
|
||||
type: "ExportDefaultDeclaration",
|
||||
declaration: factoryFunction,
|
||||
});
|
||||
|
||||
return HEADER + code;
|
||||
}
|
||||
|
||||
function stmts(code) {
|
||||
return parse(`function _() { ${code} }`, {
|
||||
sourceType: "script",
|
||||
}).program.body[0].body.body;
|
||||
}
|
Reference in New Issue
Block a user