@babel/plugin-transform-function-name
Advanced tools
+1
-1
@@ -5,3 +5,3 @@ import { isRequired } from '@babel/helper-compilation-targets'; | ||
| var index = declare(api => { | ||
| api.assertVersion("8.0.0-alpha.17"); | ||
| api.assertVersion("8.0.0-beta.0"); | ||
| const supportUnicodeId = !isRequired("transform-unicode-escapes", api.targets()); | ||
@@ -8,0 +8,0 @@ return { |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","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"],"names":["declare","api","assertVersion","supportUnicodeId","isRequired","targets","name","visitor","FunctionExpression","exit","path","key","parentPath","isObjectProperty","ensureFunctionName","ObjectProperty","value","get","isFunction"],"mappings":";;;AAGA,YAAeA,OAAO,CAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAA,gBAAoB,CAAC,CAAA;AACtC,EAAA,MAAMC,gBAAgB,GAAG,CAACC,UAAU,CAClC,2BAA2B,EAC3BH,GAAG,CAACI,OAAO,EACb,CAAC,CAAA;EAED,OAAO;AACLC,IAAAA,IAAI,EAAE,yBAAyB;AAE/BC,IAAAA,OAAO,EAAE;AACPC,MAAAA,kBAAkB,EAAE;QAClBC,IAAIA,CAACC,IAAI,EAAE;AACT,UAAA,IAAIA,IAAI,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,IAAI,CAACE,UAAU,CAACC,gBAAgB,EAAE,EAAE;AAO/DH,YAAAA,IAAI,CAACI,kBAAkB,CAACX,gBAAgB,CAAC,CAAA;AAC3C,WAAA;AACF,SAAA;OACD;MAEDY,cAAcA,CAACL,IAAI,EAAE;AACnB,QAAA,MAAMM,KAAK,GAAGN,IAAI,CAACO,GAAG,CAAC,OAAO,CAAC,CAAA;AAC/B,QAAA,IAAID,KAAK,CAACE,UAAU,EAAE,EAAE;AAQtBF,UAAAA,KAAK,CAACF,kBAAkB,CAACX,gBAAgB,CAAC,CAAA;AAC5C,SAAA;AACF,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"} | ||
| {"version":3,"file":"index.js","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"],"names":["declare","api","assertVersion","supportUnicodeId","isRequired","targets","name","visitor","FunctionExpression","exit","path","key","parentPath","isObjectProperty","ensureFunctionName","ObjectProperty","value","get","isFunction"],"mappings":";;;AAGA,YAAeA,OAAO,CAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAA,cAAoB,CAAC,CAAA;AACtC,EAAA,MAAMC,gBAAgB,GAAG,CAACC,UAAU,CAClC,2BAA2B,EAC3BH,GAAG,CAACI,OAAO,EACb,CAAC,CAAA;EAED,OAAO;AACLC,IAAAA,IAAI,EAAE,yBAAyB;AAE/BC,IAAAA,OAAO,EAAE;AACPC,MAAAA,kBAAkB,EAAE;QAClBC,IAAIA,CAACC,IAAI,EAAE;AACT,UAAA,IAAIA,IAAI,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,IAAI,CAACE,UAAU,CAACC,gBAAgB,EAAE,EAAE;AAO/DH,YAAAA,IAAI,CAACI,kBAAkB,CAACX,gBAAgB,CAAC,CAAA;AAC3C,WAAA;AACF,SAAA;OACD;MAEDY,cAAcA,CAACL,IAAI,EAAE;AACnB,QAAA,MAAMM,KAAK,GAAGN,IAAI,CAACO,GAAG,CAAC,OAAO,CAAC,CAAA;AAC/B,QAAA,IAAID,KAAK,CAACE,UAAU,EAAE,EAAE;AAQtBF,UAAAA,KAAK,CAACF,kBAAkB,CAACX,gBAAgB,CAAC,CAAA;AAC5C,SAAA;AACF,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"} |
+7
-7
| { | ||
| "name": "@babel/plugin-transform-function-name", | ||
| "version": "8.0.0-alpha.17", | ||
| "version": "8.0.0-beta.0", | ||
| "description": "Apply ES2015 function.name semantics to all functions", | ||
@@ -20,14 +20,14 @@ "repository": { | ||
| "dependencies": { | ||
| "@babel/helper-compilation-targets": "^8.0.0-alpha.17", | ||
| "@babel/helper-plugin-utils": "^8.0.0-alpha.17" | ||
| "@babel/helper-compilation-targets": "^8.0.0-beta.0", | ||
| "@babel/helper-plugin-utils": "^8.0.0-beta.0" | ||
| }, | ||
| "peerDependencies": { | ||
| "@babel/core": "^8.0.0-alpha.17" | ||
| "@babel/core": "^8.0.0-beta.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "^8.0.0-alpha.17", | ||
| "@babel/helper-plugin-test-runner": "^8.0.0-alpha.17" | ||
| "@babel/core": "^8.0.0-beta.0", | ||
| "@babel/helper-plugin-test-runner": "^8.0.0-beta.0" | ||
| }, | ||
| "engines": { | ||
| "node": "^18.20.0 || ^20.17.0 || >=22.8.0" | ||
| "node": "^20.19.0 || >=22.12.0" | ||
| }, | ||
@@ -34,0 +34,0 @@ "author": "The Babel Team (https://babel.dev/team)", |
6344
-0.41%