@@ -2,26 +2,20 @@ import { _ } from "@eslint-react/eff";
22import { AST_NODE_TYPES as T , type TSESTree } from "@typescript-eslint/types" ;
33
44/**
5- * Find the parent node that satisfies the predicate function
5+ * Find the parent node that satisfies the test function
66 * @param node The AST node
7- * @param predicate The predicate function
8- * @returns The parent node that satisfies the predicate or `undefined ` if not found
7+ * @param test The test function
8+ * @returns The parent node that satisfies the test function or `_ ` if not found
99 */
10- export function findParentNode < A extends TSESTree . Node > (
11- node : TSESTree . Node | _ ,
12- predicate : ( n : TSESTree . Node ) => n is A ,
13- ) : A | _ ;
10+ function findParentNode < A extends TSESTree . Node > ( node : TSESTree . Node | _ , test : ( n : TSESTree . Node ) => n is A ) : A | _ ;
1411/**
15- * Find the parent node that satisfies the test function
12+ * Find the parent node that satisfies the test function or `_` if not found
1613 * @param node The AST node
1714 * @param test The test function
18- * @returns The parent node that satisfies the test or `undefined` if not found
15+ * @returns The parent node that satisfies the test function
1916 */
20- export function findParentNode (
21- node : TSESTree . Node | _ ,
22- test : ( node : TSESTree . Node ) => boolean ,
23- ) : TSESTree . Node | _ ;
24- export function findParentNode < A extends TSESTree . Node > (
17+ function findParentNode ( node : TSESTree . Node | _ , test : ( node : TSESTree . Node ) => boolean ) : TSESTree . Node | _ ;
18+ function findParentNode < A extends TSESTree . Node > (
2519 node : TSESTree . Node | _ ,
2620 test : ( ( node : TSESTree . Node ) => boolean ) | ( ( n : TSESTree . Node ) => n is A ) ,
2721) : TSESTree . Node | A | _ {
@@ -35,3 +29,5 @@ export function findParentNode<A extends TSESTree.Node>(
3529 }
3630 return _ ;
3731}
32+
33+ export { findParentNode } ;
0 commit comments