Make .insert{Before,After} work by default when the parent is an eport declaration (#7040)
This commit is contained in:
@@ -89,11 +89,8 @@ function plainFunction(path: NodePath, callId: Object) {
|
||||
});
|
||||
|
||||
if (isDeclaration) {
|
||||
const basePath = path.parentPath.isExportDeclaration()
|
||||
? path.parentPath
|
||||
: path;
|
||||
basePath.insertAfter(container[1]);
|
||||
path.replaceWith(container[0]);
|
||||
path.insertAfter(container[1]);
|
||||
} else {
|
||||
const retFunction = container.callee.body.body[1].argument;
|
||||
if (!functionId) {
|
||||
|
||||
Reference in New Issue
Block a user