Buckets:
ktongue/docker_container / CAD_kevin /frontend /node_modules /@babel /plugin-bugfix-safari-id-destructuring-collision-in-function-expression /lib /index.js
| ; | |
| Object.defineProperty(exports, '__esModule', { value: true }); | |
| var helperPluginUtils = require('@babel/helper-plugin-utils'); | |
| function shouldTransform(path) { | |
| const { | |
| node | |
| } = path; | |
| const functionId = node.id; | |
| if (!functionId) return false; | |
| const name = functionId.name; | |
| const paramNameBinding = path.scope.getOwnBinding(name); | |
| if (paramNameBinding === undefined) { | |
| return false; | |
| } | |
| if (paramNameBinding.kind !== "param") { | |
| return false; | |
| } | |
| if (paramNameBinding.identifier === paramNameBinding.path.node) { | |
| return false; | |
| } | |
| return name; | |
| } | |
| var index = helperPluginUtils.declare(api => { | |
| api.assertVersion("^7.16.0"); | |
| return { | |
| name: "plugin-bugfix-safari-id-destructuring-collision-in-function-expression", | |
| visitor: { | |
| FunctionExpression(path) { | |
| const name = shouldTransform(path); | |
| if (name) { | |
| const { | |
| scope | |
| } = path; | |
| const newParamName = scope.generateUid(name); | |
| scope.rename(name, newParamName); | |
| } | |
| } | |
| } | |
| }; | |
| }); | |
| exports.default = index; | |
| //# sourceMappingURL=index.js.map | |
Xet Storage Details
- Size:
- 1.13 kB
- Xet hash:
- 49035d8771a04d183044e1901c9ee3bbf9fb82009f129abaad7c7f5f67fd9fc3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.