feat: refactoring project
This commit is contained in:
16
node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js
generated
vendored
16
node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js
generated
vendored
@@ -50,13 +50,6 @@ function extractElementDescriptor(file, classRef, superRef, path) {
|
||||
if (path.node.type === "StaticBlock") {
|
||||
throw path.buildCodeFrameError(`Static blocks are not supported in 2018-09 decorator transform, please specify { "version": "2021-12" } instead.`);
|
||||
}
|
||||
if (path.isFunction()) {
|
||||
{
|
||||
var _path$ensureFunctionN;
|
||||
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
}
|
||||
path.ensureFunctionName(false);
|
||||
}
|
||||
const {
|
||||
node,
|
||||
scope
|
||||
@@ -71,8 +64,13 @@ function extractElementDescriptor(file, classRef, superRef, path) {
|
||||
}).replace();
|
||||
}
|
||||
const properties = [prop("kind", _core.types.stringLiteral(_core.types.isClassMethod(node) ? node.kind : "field")), prop("decorators", takeDecorators(node)), prop("static", node.static && _core.types.booleanLiteral(true)), prop("key", getKey(node))].filter(Boolean);
|
||||
if (_core.types.isClassMethod(node)) {
|
||||
properties.push(prop("value", _core.types.toExpression(node)));
|
||||
if (isMethod) {
|
||||
{
|
||||
var _path$ensureFunctionN;
|
||||
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
}
|
||||
path.ensureFunctionName(false);
|
||||
properties.push(prop("value", _core.types.toExpression(path.node)));
|
||||
} else if (_core.types.isClassProperty(node) && node.value) {
|
||||
properties.push(method("value", _core.template.statements.ast`return ${node.value}`));
|
||||
} else {
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js.map
generated
vendored
2
node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js.map
generated
vendored
File diff suppressed because one or more lines are too long
10
node_modules/@babel/helper-create-class-features-plugin/lib/index.js
generated
vendored
10
node_modules/@babel/helper-create-class-features-plugin/lib/index.js
generated
vendored
@@ -95,12 +95,12 @@ function createClassFeaturePlugin({
|
||||
(0, _features.enableFeature)(file, feature, loose);
|
||||
{
|
||||
if (typeof file.get(versionKey) === "number") {
|
||||
file.set(versionKey, "7.25.0");
|
||||
file.set(versionKey, "7.25.9");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.25.0")) {
|
||||
file.set(versionKey, "7.25.0");
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.25.9")) {
|
||||
file.set(versionKey, "7.25.9");
|
||||
}
|
||||
},
|
||||
visitor: {
|
||||
@@ -108,7 +108,7 @@ function createClassFeaturePlugin({
|
||||
file
|
||||
}) {
|
||||
var _ref;
|
||||
if (file.get(versionKey) !== "7.25.0") return;
|
||||
if (file.get(versionKey) !== "7.25.9") return;
|
||||
if (!(0, _features.shouldTransform)(path, file)) return;
|
||||
const pathIsClassDeclaration = path.isClassDeclaration();
|
||||
if (pathIsClassDeclaration) (0, _typescript.assertFieldTransformed)(path);
|
||||
@@ -229,7 +229,7 @@ function createClassFeaturePlugin({
|
||||
file
|
||||
}) {
|
||||
{
|
||||
if (file.get(versionKey) !== "7.25.0") return;
|
||||
if (file.get(versionKey) !== "7.25.9") return;
|
||||
const decl = path.get("declaration");
|
||||
if (decl.isClassDeclaration() && (0, _decorators2.hasDecorators)(decl.node)) {
|
||||
if (decl.node.id) {
|
||||
|
||||
Reference in New Issue
Block a user