@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("^7.0.0-0 || ^8.0.0 || 8.0.0-rc.2"); | ||
| api.assertVersion("^7.0.0-0 || ^8.0.0 || 8.0.0-rc.3"); | ||
| 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 path.ensureFunctionName(supportUnicodeId);\n }\n },\n },\n\n ObjectProperty(path) {\n const value = path.get(\"value\");\n if (value.isFunction()) {\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,kCAAoB,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;AAC/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;AAEtBF,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 path.ensureFunctionName(supportUnicodeId);\n }\n },\n },\n\n ObjectProperty(path) {\n const value = path.get(\"value\");\n if (value.isFunction()) {\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,kCAAoB,CAAC;AACtC,EAAA,MAAMC,gBAAgB,GAAG,CAACC,UAAU,CAClC,2BAA2B,EAC3BH,GAAG,CAACI,OAAO,EACb,CAAC;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;AAC/DH,YAAAA,IAAI,CAACI,kBAAkB,CAACX,gBAAgB,CAAC;AAC3C,UAAA;AACF,QAAA;OACD;MAEDY,cAAcA,CAACL,IAAI,EAAE;AACnB,QAAA,MAAMM,KAAK,GAAGN,IAAI,CAACO,GAAG,CAAC,OAAO,CAAC;AAC/B,QAAA,IAAID,KAAK,CAACE,UAAU,EAAE,EAAE;AAEtBF,UAAAA,KAAK,CAACF,kBAAkB,CAACX,gBAAgB,CAAC;AAC5C,QAAA;AACF,MAAA;AACF;GACD;AACH,CAAC,CAAC;;;;"} |
+6
-6
| { | ||
| "name": "@babel/plugin-transform-function-name", | ||
| "version": "8.0.0-rc.2", | ||
| "version": "8.0.0-rc.3", | ||
| "description": "Apply ES2015 function.name semantics to all functions", | ||
@@ -20,11 +20,11 @@ "repository": { | ||
| "dependencies": { | ||
| "@babel/helper-compilation-targets": "^8.0.0-rc.2", | ||
| "@babel/helper-plugin-utils": "^8.0.0-rc.2" | ||
| "@babel/helper-compilation-targets": "^8.0.0-rc.3", | ||
| "@babel/helper-plugin-utils": "^8.0.0-rc.3" | ||
| }, | ||
| "peerDependencies": { | ||
| "@babel/core": "^8.0.0-rc.2" | ||
| "@babel/core": "^8.0.0-rc.3" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "^8.0.0-rc.2", | ||
| "@babel/helper-plugin-test-runner": "^8.0.0-rc.2" | ||
| "@babel/core": "^8.0.0-rc.3", | ||
| "@babel/helper-plugin-test-runner": "^8.0.0-rc.3" | ||
| }, | ||
@@ -31,0 +31,0 @@ "engines": { |
5613
-0.62%