jazz-tools 0.10.7 → 0.10.8
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +8 -0
- package/dist/{chunk-TSEO4KAO.js → chunk-6OJCOJJ6.js} +24 -3
- package/dist/chunk-6OJCOJJ6.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -2
- package/src/coValues/deepLoading.ts +25 -2
- package/src/coValues/interfaces.ts +1 -0
- package/src/tests/coMap.test.ts +2 -2
- package/src/tests/deepLoading.test.ts +85 -1
- package/src/tests/subscribe.test.ts +39 -0
- package/dist/chunk-TSEO4KAO.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.10.
|
2
|
+
> jazz-tools@0.10.8 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -11,8 +11,8 @@
|
|
11
11
|
[34mESM[39m Build start
|
12
12
|
[32mESM[39m [1mdist/index.js [22m[32m1.50 KB[39m
|
13
13
|
[32mESM[39m [1mdist/testing.js [22m[32m6.28 KB[39m
|
14
|
-
[32mESM[39m [1mdist/chunk-
|
14
|
+
[32mESM[39m [1mdist/chunk-6OJCOJJ6.js [22m[32m113.88 KB[39m
|
15
15
|
[32mESM[39m [1mdist/index.js.map [22m[32m259.00 B[39m
|
16
16
|
[32mESM[39m [1mdist/testing.js.map [22m[32m12.41 KB[39m
|
17
|
-
[32mESM[39m [1mdist/chunk-
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
17
|
+
[32mESM[39m [1mdist/chunk-6OJCOJJ6.js.map [22m[32m273.01 KB[39m
|
18
|
+
[32mESM[39m ⚡️ Build success in 40ms
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# jazz-tools
|
2
2
|
|
3
|
+
## 0.10.8
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 2fb6428: Allow explicit keys when loading values from a CoMap.Record and throw when a required ref is undefined
|
8
|
+
- Updated dependencies [153dc99]
|
9
|
+
- cojson@0.10.8
|
10
|
+
|
3
11
|
## 0.10.7
|
4
12
|
|
5
13
|
### Patch Changes
|
@@ -58,8 +58,28 @@ function fulfillsDepth(depth, value) {
|
|
58
58
|
} else {
|
59
59
|
for (const key of Object.keys(depth)) {
|
60
60
|
const map = value;
|
61
|
-
if (
|
62
|
-
|
61
|
+
if (map._raw.get(key) === void 0) {
|
62
|
+
if (!map._schema?.[key]) {
|
63
|
+
if (map._schema?.[ItemsSym]) {
|
64
|
+
if (map._schema[ItemsSym].optional) {
|
65
|
+
continue;
|
66
|
+
} else {
|
67
|
+
throw new Error(
|
68
|
+
`The ref ${key} requested on ${map.constructor.name} is missing`
|
69
|
+
);
|
70
|
+
}
|
71
|
+
} else {
|
72
|
+
throw new Error(
|
73
|
+
`The ref ${key} requested on ${map.constructor.name} is not defined in the schema`
|
74
|
+
);
|
75
|
+
}
|
76
|
+
} else if (map._schema[key].optional) {
|
77
|
+
continue;
|
78
|
+
} else {
|
79
|
+
throw new Error(
|
80
|
+
`The ref ${key} on ${map.constructor.name} is required but missing`
|
81
|
+
);
|
82
|
+
}
|
63
83
|
}
|
64
84
|
if (!map[key]) {
|
65
85
|
return false;
|
@@ -810,6 +830,7 @@ function subscribeToCoValue(cls, id, as, depth, listener, onUnavailable, syncRes
|
|
810
830
|
} else {
|
811
831
|
ref2.load().then((value) => subscribe(value)).catch((e) => {
|
812
832
|
console.error("Failed to load / subscribe to CoValue", e);
|
833
|
+
onUnavailable?.();
|
813
834
|
});
|
814
835
|
}
|
815
836
|
return function unsubscribeAtAnyPoint() {
|
@@ -3972,4 +3993,4 @@ export {
|
|
3972
3993
|
consumeInviteLink
|
3973
3994
|
};
|
3974
3995
|
/* istanbul ignore file -- @preserve */
|
3975
|
-
//# sourceMappingURL=chunk-
|
3996
|
+
//# sourceMappingURL=chunk-6OJCOJJ6.js.map
|