@eslint-react/ast 5.5.0-next.0 → 5.5.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -312,11 +312,11 @@ const isEqual = dual(2, (a, b) => {
|
|
|
312
312
|
var traverse_exports = /* @__PURE__ */ __exportAll({ findParent: () => findParent });
|
|
313
313
|
function findParent(node, test) {
|
|
314
314
|
if (node == null) return null;
|
|
315
|
-
let
|
|
316
|
-
while (
|
|
317
|
-
if (
|
|
318
|
-
if (
|
|
319
|
-
|
|
315
|
+
let current = node.parent;
|
|
316
|
+
while (current != null) {
|
|
317
|
+
if (test(current)) return current;
|
|
318
|
+
if (current.type === "Program") return null;
|
|
319
|
+
current = current.parent;
|
|
320
320
|
}
|
|
321
321
|
return null;
|
|
322
322
|
}
|