@adhdev/mesh-shared 1.0.82-rc.10 → 1.0.82-rc.11

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 CHANGED
@@ -3448,14 +3448,11 @@ function normalizeOwnedPaths(input) {
3448
3448
  }
3449
3449
  function entryContains(base, path) {
3450
3450
  if (path === base.path) return true;
3451
- if (base.subtree && (path === base.path || path.startsWith(`${base.path}/`))) return true;
3451
+ if (base.subtree && (base.path === "" || path.startsWith(`${base.path}/`))) return true;
3452
3452
  return false;
3453
3453
  }
3454
3454
  function entriesOverlap(a, b) {
3455
- if (a.path === b.path) return true;
3456
- if (a.subtree && (b.path === a.path || b.path.startsWith(`${a.path}/`))) return true;
3457
- if (b.subtree && (a.path === b.path || a.path.startsWith(`${b.path}/`))) return true;
3458
- return false;
3455
+ return entryContains(a, b.path) || entryContains(b, a.path);
3459
3456
  }
3460
3457
  function pathsOverlap(a, b) {
3461
3458
  if (a.paths.length === 0 || b.paths.length === 0) return false;
@@ -3727,7 +3724,15 @@ function foldKeyedDoc(held, delta, spec) {
3727
3724
  const heldList = heldCollections.get(path);
3728
3725
  if (change?.absent) {
3729
3726
  const [head2, tail2] = splitPath(path);
3730
- if (!tail2) delete next[head2];
3727
+ if (!tail2) {
3728
+ delete next[head2];
3729
+ continue;
3730
+ }
3731
+ const parent2 = next[head2];
3732
+ if (!isRecord3(parent2) || !(tail2 in parent2)) continue;
3733
+ const copy = { ...parent2 };
3734
+ delete copy[tail2];
3735
+ next[head2] = copy;
3731
3736
  continue;
3732
3737
  }
3733
3738
  if (!change && heldList === void 0) continue;