mirror of
https://github.com/hanzoai/babel.git
synced 2026-10-30 14:46:06 +00:00
12 lines
304 B
JavaScript
12 lines
304 B
JavaScript
import _nameFunction from "@babel/helper-function-name";
|
|
const nameFunction = _nameFunction.default || _nameFunction;
|
|
|
|
export default api => ({
|
|
visitor: {
|
|
FunctionExpression(path) {
|
|
const replacement = nameFunction(path);
|
|
if (replacement) path.replaceWith(replacement);
|
|
},
|
|
},
|
|
});
|