@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 +11 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -6
- package/dist/index.mjs.map +1 -1
- package/dist/path-ownership.d.ts +1 -1
- package/package.json +1 -1
- package/src/keyed-doc-delta.ts +9 -1
- package/src/path-ownership.ts +4 -6
package/dist/index.mjs
CHANGED
|
@@ -3088,14 +3088,11 @@ function normalizeOwnedPaths(input) {
|
|
|
3088
3088
|
}
|
|
3089
3089
|
function entryContains(base, path) {
|
|
3090
3090
|
if (path === base.path) return true;
|
|
3091
|
-
if (base.subtree && (path ===
|
|
3091
|
+
if (base.subtree && (base.path === "" || path.startsWith(`${base.path}/`))) return true;
|
|
3092
3092
|
return false;
|
|
3093
3093
|
}
|
|
3094
3094
|
function entriesOverlap(a, b) {
|
|
3095
|
-
|
|
3096
|
-
if (a.subtree && (b.path === a.path || b.path.startsWith(`${a.path}/`))) return true;
|
|
3097
|
-
if (b.subtree && (a.path === b.path || a.path.startsWith(`${b.path}/`))) return true;
|
|
3098
|
-
return false;
|
|
3095
|
+
return entryContains(a, b.path) || entryContains(b, a.path);
|
|
3099
3096
|
}
|
|
3100
3097
|
function pathsOverlap(a, b) {
|
|
3101
3098
|
if (a.paths.length === 0 || b.paths.length === 0) return false;
|
|
@@ -3367,7 +3364,15 @@ function foldKeyedDoc(held, delta, spec) {
|
|
|
3367
3364
|
const heldList = heldCollections.get(path);
|
|
3368
3365
|
if (change?.absent) {
|
|
3369
3366
|
const [head2, tail2] = splitPath(path);
|
|
3370
|
-
if (!tail2)
|
|
3367
|
+
if (!tail2) {
|
|
3368
|
+
delete next[head2];
|
|
3369
|
+
continue;
|
|
3370
|
+
}
|
|
3371
|
+
const parent2 = next[head2];
|
|
3372
|
+
if (!isRecord3(parent2) || !(tail2 in parent2)) continue;
|
|
3373
|
+
const copy = { ...parent2 };
|
|
3374
|
+
delete copy[tail2];
|
|
3375
|
+
next[head2] = copy;
|
|
3371
3376
|
continue;
|
|
3372
3377
|
}
|
|
3373
3378
|
if (!change && heldList === void 0) continue;
|