jazz-tools 0.14.7 → 0.14.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 +7 -7
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-RTUIFVYF.js → chunk-PA6UHG6Q.js} +5 -5
- package/dist/{chunk-RTUIFVYF.js.map → chunk-PA6UHG6Q.js.map} +1 -1
- package/dist/coValues/extensions/imageDef.d.ts +1 -1
- package/dist/coValues/extensions/imageDef.d.ts.map +1 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts +1 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +1 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/AccountSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoListSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts.map +1 -1
- package/dist/implementation/zodSchema/unionUtils.d.ts +1 -1
- package/dist/implementation/zodSchema/unionUtils.d.ts.map +1 -1
- package/dist/implementation/zodSchema/zodCo.d.ts +1 -1
- package/dist/implementation/zodSchema/zodCo.d.ts.map +1 -1
- package/dist/implementation/zodSchema/zodReExport.d.ts +1 -1
- package/dist/implementation/zodSchema/zodReExport.d.ts.map +1 -1
- package/dist/implementation/zodSchema/zodSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/zodSchema.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -2
- package/src/coValues/extensions/imageDef.ts +1 -1
- package/src/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.ts +5 -1
- package/src/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/AccountSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/CoFeedSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/CoListSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/CoMapSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/CoRecordSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/FileStreamSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/PlainTextSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/RichTextSchema.ts +1 -1
- package/src/implementation/zodSchema/typeConverters/InstanceOfSchema.ts +1 -1
- package/src/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.ts +1 -1
- package/src/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.ts +1 -1
- package/src/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.ts +1 -1
- package/src/implementation/zodSchema/unionUtils.ts +1 -1
- package/src/implementation/zodSchema/zodCo.ts +1 -1
- package/src/implementation/zodSchema/zodReExport.ts +1 -1
- package/src/implementation/zodSchema/zodSchema.ts +1 -3
- package/src/tests/coMap.test-d.ts +1 -1
- package/src/tests/coMap.test.ts +1 -1
- package/src/tests/schemaUnion.test.ts +5 -2
@@ -1,5 +1,5 @@
|
|
1
1
|
import { LocalNode, RawAccount } from "cojson";
|
2
|
-
import z from "zod/v4";
|
2
|
+
import z from "jazz-tools-zod-v4-rn-patch/v4";
|
3
3
|
import {
|
4
4
|
Account,
|
5
5
|
AccountClass,
|
@@ -21,8 +21,6 @@ import { PlainTextSchema } from "./schemaTypes/PlainTextSchema.js";
|
|
21
21
|
import { RichTextSchema } from "./schemaTypes/RichTextSchema.js";
|
22
22
|
import { InstanceOfSchema } from "./typeConverters/InstanceOfSchema.js";
|
23
23
|
import { InstanceOfSchemaCoValuesNullable } from "./typeConverters/InstanceOfSchemaCoValuesNullable.js";
|
24
|
-
import { InstanceOrPrimitiveOfSchema } from "./typeConverters/InstanceOrPrimitiveOfSchema.js";
|
25
|
-
import { InstanceOrPrimitiveOfSchemaCoValuesNullable } from "./typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.js";
|
26
24
|
|
27
25
|
// defining an extra type for this, otherwise BaseSchema & {...} often
|
28
26
|
// gets expanded into a n inferred type that's too long for typescript to print
|
@@ -280,7 +280,7 @@ describe("CoMap", async () => {
|
|
280
280
|
|
281
281
|
const MapWithEnumOfMaps = co.map({
|
282
282
|
name: z.string(),
|
283
|
-
child: z.discriminatedUnion([ChildA, ChildB]),
|
283
|
+
child: z.discriminatedUnion("type", [ChildA, ChildB]),
|
284
284
|
});
|
285
285
|
|
286
286
|
const mapWithEnum = MapWithEnumOfMaps.create({
|
package/src/tests/coMap.test.ts
CHANGED
@@ -416,7 +416,7 @@ describe("CoMap", async () => {
|
|
416
416
|
|
417
417
|
const MapWithEnumOfMaps = co.map({
|
418
418
|
name: z.string(),
|
419
|
-
child: z.discriminatedUnion([ChildA, ChildB]),
|
419
|
+
child: z.discriminatedUnion("type", [ChildA, ChildB]),
|
420
420
|
});
|
421
421
|
|
422
422
|
const mapWithEnum = MapWithEnumOfMaps.create({
|
@@ -24,7 +24,10 @@ const BlueButtonWidget = co.map({
|
|
24
24
|
blueness: z.number(),
|
25
25
|
});
|
26
26
|
|
27
|
-
const ButtonWidget = z.discriminatedUnion(
|
27
|
+
const ButtonWidget = z.discriminatedUnion("type", [
|
28
|
+
RedButtonWidget,
|
29
|
+
BlueButtonWidget,
|
30
|
+
]);
|
28
31
|
|
29
32
|
const SliderWidget = co.map({
|
30
33
|
type: z.literal("slider"),
|
@@ -37,7 +40,7 @@ const CheckboxWidget = co.map({
|
|
37
40
|
checked: z.boolean(),
|
38
41
|
});
|
39
42
|
|
40
|
-
const WidgetUnion = z.discriminatedUnion([
|
43
|
+
const WidgetUnion = z.discriminatedUnion("type", [
|
41
44
|
ButtonWidget,
|
42
45
|
SliderWidget,
|
43
46
|
CheckboxWidget,
|