Skip to content

Commit

Permalink
Refactor walker callback function
Browse files Browse the repository at this point in the history
  • Loading branch information
david0xd committed Jan 26, 2023
1 parent 576b08e commit 61832b5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function walkAndSearch(subject: unknown, target: unknown) {
let result = false;
const walker = new Walker(
(value: unknown) => {
return (result = result || value === target);
result = target === value;
return result;
},
{ maxRecursionLimit: 100, onShouldIgnoreError: () => true },
);
Expand Down

0 comments on commit 61832b5

Please sign in to comment.