Skip to content

Commit

Permalink
Fix recursion in findOne querying helper. Fixes #1856.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachsents authored Dec 31, 2024
1 parent f93ef5c commit fab7c6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/querying.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ export function findOne(
return node;
}
if (recurse && hasChildren(node) && node.children.length > 0) {
return findOne(test, node.children, true);
const found = findOne(test, node.children, true);
if(found) return found
}
}

Expand Down

0 comments on commit fab7c6e

Please sign in to comment.