@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.
Files changed (2) hide show
  1. package/dist/index.js +5 -5
  2. 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 parent = node.parent;
316
- while (parent?.type !== AST_NODE_TYPES.Program) {
317
- if (parent == null) return null;
318
- if (test(parent)) return parent;
319
- parent = parent.parent;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/ast",
3
- "version": "5.5.0-next.0",
3
+ "version": "5.5.1-beta.0",
4
4
  "description": "ESLint React's TSESTree AST utility module.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {