Skip to content

Commit 418c72c

Browse files
committedJun 5, 2019
chore(ast-utils): undo return statements as per review
rolled backed the return statements as per the review
1 parent 39be039 commit 418c72c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
 

‎packages/utils/ast-utils.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,11 @@ function parseTopScope(j: JSCodeshift, ast: Node, value: string[], action: strin
585585
);
586586
return false; // TODO: debug later
587587
}
588-
return value ? ast.find(j.Program).filter((p: Node): boolean => createTopScopeProperty(p)) : ast;
588+
if (value) {
589+
return ast.find(j.Program).filter((p: Node): boolean => createTopScopeProperty(p));
590+
} else {
591+
return ast;
592+
}
589593
}
590594

591595
/**
@@ -628,7 +632,11 @@ function parseMerge(j: JSCodeshift, ast: Node, value: string, action: string): b
628632
(p.value as Node).body[bodyLength - 1] = newVal;
629633
return false; // TODO: debug later
630634
}
631-
return value ? ast.find(j.Program).filter((p: Node): boolean => createMergeProperty(p)) : ast;
635+
if (value) {
636+
return ast.find(j.Program).filter((p: Node): boolean => createMergeProperty(p));
637+
} else {
638+
return ast;
639+
}
632640
}
633641

634642
export {

0 commit comments

Comments
 (0)
Please sign in to comment.