jazz-tools 0.13.11 → 0.13.13
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 +5 -5
- package/CHANGELOG.md +15 -0
- package/dist/{chunk-I7NYAGLP.js → chunk-GIZWJXSR.js} +29 -21
- package/dist/chunk-GIZWJXSR.js.map +1 -0
- package/dist/coValues/coMap.d.ts +4 -4
- package/dist/coValues/coMap.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -2
- package/src/coValues/coMap.ts +35 -20
- package/src/implementation/refs.ts +1 -1
- package/src/implementation/subscriptionScope.ts +2 -2
- package/src/tests/coMap.test.ts +65 -0
- package/dist/chunk-I7NYAGLP.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.13.
|
2
|
+
> jazz-tools@0.13.13 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup && pnpm types
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -11,12 +11,12 @@
|
|
11
11
|
[34mESM[39m Build start
|
12
12
|
[32mESM[39m [1mdist/index.js [22m[32m1.48 KB[39m
|
13
13
|
[32mESM[39m [1mdist/testing.js [22m[32m6.26 KB[39m
|
14
|
-
[32mESM[39m [1mdist/chunk-
|
14
|
+
[32mESM[39m [1mdist/chunk-GIZWJXSR.js [22m[32m118.19 KB[39m
|
15
15
|
[32mESM[39m [1mdist/index.js.map [22m[32m258.00 B[39m
|
16
16
|
[32mESM[39m [1mdist/testing.js.map [22m[32m12.37 KB[39m
|
17
|
-
[32mESM[39m [1mdist/chunk-
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
17
|
+
[32mESM[39m [1mdist/chunk-GIZWJXSR.js.map [22m[32m277.09 KB[39m
|
18
|
+
[32mESM[39m ⚡️ Build success in 35ms
|
19
19
|
|
20
|
-
> jazz-tools@0.13.
|
20
|
+
> jazz-tools@0.13.13 types /home/runner/_work/jazz/jazz/packages/jazz-tools
|
21
21
|
> tsc --outDir dist
|
22
22
|
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# jazz-tools
|
2
2
|
|
3
|
+
## 0.13.13
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [ec9cb40]
|
8
|
+
- cojson@0.13.13
|
9
|
+
|
10
|
+
## 0.13.12
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- 4547525: Skip non-schema related keys when calling CoMap.toJSON
|
15
|
+
- Updated dependencies [65719f2]
|
16
|
+
- cojson@0.13.12
|
17
|
+
|
3
18
|
## 0.13.11
|
4
19
|
|
5
20
|
### Patch Changes
|
@@ -323,7 +323,7 @@ var Ref = class _Ref {
|
|
323
323
|
const entry = node.coValuesStore.get(
|
324
324
|
this.id
|
325
325
|
);
|
326
|
-
if (entry.
|
326
|
+
if (entry.highLevelState === "available") {
|
327
327
|
return new _Ref(this.id, this.controlledAccount, this.schema).value;
|
328
328
|
}
|
329
329
|
return void 0;
|
@@ -592,8 +592,8 @@ var SubscriptionScope = class {
|
|
592
592
|
};
|
593
593
|
function loadCoValue(node, id, callback, syncResolution) {
|
594
594
|
const entry = node.coValuesStore.get(id);
|
595
|
-
if (entry.
|
596
|
-
callback(entry.
|
595
|
+
if (entry.isAvailable() && syncResolution) {
|
596
|
+
callback(entry.core);
|
597
597
|
} else {
|
598
598
|
void node.loadCoValueCore(id).then((core) => {
|
599
599
|
callback(core);
|
@@ -1525,30 +1525,38 @@ var _CoMap = class _CoMap extends CoValueBase {
|
|
1525
1525
|
* @category Content
|
1526
1526
|
*/
|
1527
1527
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
1528
|
-
toJSON(_key,
|
1529
|
-
const
|
1528
|
+
toJSON(_key, processedValues) {
|
1529
|
+
const result = {
|
1530
|
+
id: this.id,
|
1531
|
+
_type: this._type
|
1532
|
+
};
|
1533
|
+
for (const key of this._raw.keys()) {
|
1530
1534
|
const tKey = key;
|
1531
1535
|
const descriptor = this._schema[tKey] || this._schema[ItemsSym];
|
1536
|
+
if (!descriptor) {
|
1537
|
+
continue;
|
1538
|
+
}
|
1532
1539
|
if (descriptor == "json" || "encoded" in descriptor) {
|
1533
|
-
|
1540
|
+
result[key] = this._raw.get(key);
|
1534
1541
|
} else if (isRefEncoded(descriptor)) {
|
1535
|
-
|
1536
|
-
|
1542
|
+
const id = this._raw.get(key);
|
1543
|
+
if (processedValues?.includes(id) || id === this.id) {
|
1544
|
+
result[key] = { _circular: id };
|
1545
|
+
continue;
|
1546
|
+
}
|
1547
|
+
const ref2 = this[tKey];
|
1548
|
+
if (ref2 && typeof ref2 === "object" && "toJSON" in ref2 && typeof ref2.toJSON === "function") {
|
1549
|
+
const jsonedRef = ref2.toJSON(tKey, [
|
1550
|
+
...processedValues || [],
|
1551
|
+
this.id
|
1552
|
+
]);
|
1553
|
+
result[key] = jsonedRef;
|
1537
1554
|
}
|
1538
|
-
const jsonedRef = this[tKey]?.toJSON(tKey, [
|
1539
|
-
...seenAbove || [],
|
1540
|
-
this.id
|
1541
|
-
]);
|
1542
|
-
return [key, jsonedRef];
|
1543
1555
|
} else {
|
1544
|
-
|
1556
|
+
result[key] = void 0;
|
1545
1557
|
}
|
1546
|
-
}
|
1547
|
-
return
|
1548
|
-
id: this.id,
|
1549
|
-
_type: this._type,
|
1550
|
-
...Object.fromEntries(jsonedFields)
|
1551
|
-
};
|
1558
|
+
}
|
1559
|
+
return result;
|
1552
1560
|
}
|
1553
1561
|
[inspect]() {
|
1554
1562
|
return this.toJSON();
|
@@ -4081,4 +4089,4 @@ export {
|
|
4081
4089
|
consumeInviteLink
|
4082
4090
|
};
|
4083
4091
|
/* istanbul ignore file -- @preserve */
|
4084
|
-
//# sourceMappingURL=chunk-
|
4092
|
+
//# sourceMappingURL=chunk-GIZWJXSR.js.map
|