jazz-tools 0.14.0 → 0.14.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.
- package/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +8 -0
- package/dist/{chunk-2ASOGEYA.js → chunk-WLOZKDOH.js} +9 -8
- package/dist/chunk-WLOZKDOH.js.map +1 -0
- package/dist/coValues/CoValueBase.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/CoValueBase.ts +12 -7
- package/dist/chunk-2ASOGEYA.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CoValueBase.d.ts","sourceRoot":"","sources":["../../src/coValues/CoValueBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AACxE,OAAO,EACL,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,cAAc,EACd,EAAE,
|
1
|
+
{"version":3,"file":"CoValueBase.d.ts","sourceRoot":"","sources":["../../src/coValues/CoValueBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AACxE,OAAO,EACL,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,cAAc,EACd,EAAE,EAKF,OAAO,EACR,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAErD,gBAAgB;AAEhB,qBAAa,WAAY,YAAW,OAAO;IACjC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACzB,0BAA0B;IAClB,WAAW,EAAE,MAAM,CAAC;IAE5B,IAAI,MAAM,IAAI,OAAO,GAAG,KAAK,CAU5B;IAED,eAAe;IACf,IAAI,SAAS,iCAYZ;gBAGW,GAAG,KAAK,EAAE,GAAG;IAOzB,0BAA0B;IAC1B,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,GAAG,CAAC;IAK5E,MAAM,IAAI,MAAM,GAAG,GAAG,EAAE,GAAG,MAAM;IAQjC,CAAC,OAAO,CAAC;IAIT,6BAA6B;IAC7B,MAAM,CAAC,EAAE,SAAS,YAAY,GAAG,cAAc,CAAC,OAAO,CAAC,EACtD,EAAE,EAAE,EAAE,GACL,YAAY,CAAC,EAAE,CAAC;CAOpB"}
|
package/dist/index.js
CHANGED
package/dist/testing.js
CHANGED
package/package.json
CHANGED
@@ -17,12 +17,12 @@
|
|
17
17
|
},
|
18
18
|
"type": "module",
|
19
19
|
"license": "MIT",
|
20
|
-
"version": "0.14.
|
20
|
+
"version": "0.14.1",
|
21
21
|
"dependencies": {
|
22
22
|
"@scure/bip39": "^1.3.0",
|
23
23
|
"fast-myers-diff": "^3.2.0",
|
24
24
|
"zod": "3.25.0-beta.20250518T002810",
|
25
|
-
"cojson": "0.14.
|
25
|
+
"cojson": "0.14.1"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"tsup": "8.3.5",
|
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
CoValueFromRaw,
|
7
7
|
ID,
|
8
8
|
RegisteredSchemas,
|
9
|
+
accessChildById,
|
9
10
|
anySchemaToCoSchema,
|
10
11
|
coValuesCache,
|
11
12
|
inspect,
|
@@ -22,15 +23,15 @@ export class CoValueBase implements CoValue {
|
|
22
23
|
declare _instanceID: string;
|
23
24
|
|
24
25
|
get _owner(): Account | Group {
|
25
|
-
const
|
26
|
+
const schema =
|
26
27
|
this._raw.group instanceof RawAccount
|
27
|
-
?
|
28
|
-
|
29
|
-
)
|
30
|
-
: RegisteredSchemas["Group"].fromRaw(this._raw.group),
|
31
|
-
);
|
28
|
+
? RegisteredSchemas["Account"]
|
29
|
+
: RegisteredSchemas["Group"];
|
32
30
|
|
33
|
-
return
|
31
|
+
return accessChildById(this, this._raw.group.id, {
|
32
|
+
ref: schema,
|
33
|
+
optional: false,
|
34
|
+
});
|
34
35
|
}
|
35
36
|
|
36
37
|
/** @private */
|
@@ -78,6 +79,10 @@ export class CoValueBase implements CoValue {
|
|
78
79
|
castAs<Cl extends CoValueClass & CoValueFromRaw<CoValue>>(
|
79
80
|
cl: Cl,
|
80
81
|
): InstanceType<Cl> {
|
82
|
+
if (this.constructor === cl) {
|
83
|
+
return this as InstanceType<Cl>;
|
84
|
+
}
|
85
|
+
|
81
86
|
return cl.fromRaw(this._raw) as InstanceType<Cl>;
|
82
87
|
}
|
83
88
|
}
|