Skip to content

Commit

Permalink
chore(ast-utils): undo return statements as per review
Browse files Browse the repository at this point in the history
rolled backed the return statements as per the review
  • Loading branch information
pranshuchittora committed Jun 5, 2019
1 parent 39be039 commit 418c72c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/utils/ast-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,11 @@ function parseTopScope(j: JSCodeshift, ast: Node, value: string[], action: strin
);
return false; // TODO: debug later
}
return value ? ast.find(j.Program).filter((p: Node): boolean => createTopScopeProperty(p)) : ast;
if (value) {
return ast.find(j.Program).filter((p: Node): boolean => createTopScopeProperty(p));
} else {
return ast;
}
}

/**
Expand Down Expand Up @@ -628,7 +632,11 @@ function parseMerge(j: JSCodeshift, ast: Node, value: string, action: string): b
(p.value as Node).body[bodyLength - 1] = newVal;
return false; // TODO: debug later
}
return value ? ast.find(j.Program).filter((p: Node): boolean => createMergeProperty(p)) : ast;
if (value) {
return ast.find(j.Program).filter((p: Node): boolean => createMergeProperty(p));
} else {
return ast;
}
}

export {
Expand Down

0 comments on commit 418c72c

Please sign in to comment.