first commit

This commit is contained in:
monjack
2025-06-20 18:01:48 +08:00
commit 6daa6d65c1
24611 changed files with 2512443 additions and 0 deletions

View File

@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperCompilationTargets = require("@babel/helper-compilation-targets");
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
api.assertVersion(7);
const supportUnicodeId = !(0, _helperCompilationTargets.isRequired)("transform-unicode-escapes", api.targets());
return {
name: "transform-function-name",
visitor: {
FunctionExpression: {
exit(path) {
if (path.key !== "value" && !path.parentPath.isObjectProperty()) {
{
var _path$ensureFunctionN;
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
}
path.ensureFunctionName(supportUnicodeId);
}
}
},
ObjectProperty(path) {
const value = path.get("value");
if (value.isFunction()) {
{
var _value$ensureFunction;
(_value$ensureFunction = value.ensureFunctionName) != null ? _value$ensureFunction : value.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
}
value.ensureFunctionName(supportUnicodeId);
}
}
}
};
});
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["_helperCompilationTargets","require","_helperPluginUtils","_default","exports","default","declare","api","assertVersion","supportUnicodeId","isRequired","targets","name","visitor","FunctionExpression","exit","path","key","parentPath","isObjectProperty","_path$ensureFunctionN","ensureFunctionName","NodePath","prototype","ObjectProperty","value","get","isFunction","_value$ensureFunction"],"sources":["../src/index.ts"],"sourcesContent":["import { isRequired } from \"@babel/helper-compilation-targets\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n const supportUnicodeId = !isRequired(\n \"transform-unicode-escapes\",\n api.targets(),\n );\n\n return {\n name: \"transform-function-name\",\n\n visitor: {\n FunctionExpression: {\n exit(path) {\n if (path.key !== \"value\" && !path.parentPath.isObjectProperty()) {\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n path.ensureFunctionName ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.ensureFunctionName;\n }\n path.ensureFunctionName(supportUnicodeId);\n }\n },\n },\n\n ObjectProperty(path) {\n const value = path.get(\"value\");\n if (value.isFunction()) {\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n value.ensureFunctionName ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.ensureFunctionName;\n }\n // @ts-expect-error Fixme: should check ArrowFunctionExpression\n value.ensureFunctionName(supportUnicodeId);\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAAqD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EACtC,MAAMC,gBAAgB,GAAG,CAAC,IAAAC,oCAAU,EAClC,2BAA2B,EAC3BH,GAAG,CAACI,OAAO,CAAC,CACd,CAAC;EAED,OAAO;IACLC,IAAI,EAAE,yBAAyB;IAE/BC,OAAO,EAAE;MACPC,kBAAkB,EAAE;QAClBC,IAAIA,CAACC,IAAI,EAAE;UACT,IAAIA,IAAI,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,IAAI,CAACE,UAAU,CAACC,gBAAgB,CAAC,CAAC,EAAE;YACE;cAAA,IAAAC,qBAAA;cAE/D,CAAAA,qBAAA,GAAAJ,IAAI,CAACK,kBAAkB,YAAAD,qBAAA,GAAvBJ,IAAI,CAACK,kBAAkB,GAErBpB,OAAO,CAAC,iBAAiB,CAAC,CAACqB,QAAQ,CAACC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