wordinweb 0.3.0 → 0.3.1

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.
@@ -8825,22 +8825,18 @@ var _DocxDocument = class _DocxDocument {
8825
8825
  }
8826
8826
  findParentOf(target) {
8827
8827
  const roots = this.contentRoots();
8828
+ if (roots.includes(target)) return void 0;
8828
8829
  const memo = this._parentMemo.get(target);
8829
8830
  if (memo && memo.children.includes(target) && this.memoIsLive(memo, roots)) return memo;
8830
8831
  const walk2 = (el26) => {
8831
8832
  for (const c of el26.children) {
8832
8833
  this._parentMemo.set(c, el26);
8833
- if (c === target) return el26;
8834
- const hit = walk2(c);
8835
- if (hit) return hit;
8834
+ walk2(c);
8836
8835
  }
8837
- return void 0;
8838
8836
  };
8839
- for (const root of roots) {
8840
- const hit = walk2(root);
8841
- if (hit) return hit;
8842
- }
8843
- return void 0;
8837
+ for (const root of roots) walk2(root);
8838
+ const found = this._parentMemo.get(target);
8839
+ return found && found.children.includes(target) && this.memoIsLive(found, roots) ? found : void 0;
8844
8840
  }
8845
8841
  /** Record a parent link the caller just created (a splice), so the next
8846
8842
  * lookup skips the full-document walk. Advisory only — findParentOf
@@ -55760,4 +55756,4 @@ export {
55760
55756
  cfb/cfb.js:
55761
55757
  (*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
55762
55758
  */
55763
- //# sourceMappingURL=chunk-VL6YPZSD.js.map
55759
+ //# sourceMappingURL=chunk-FFQBNFND.js.map