This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Implements, TraitExpression } from "@thilawyn/traitify-ts"
|
||||
import { z } from "zod"
|
||||
import { ZodSchemaClassBuilder } from "./ZodSchemaClass"
|
||||
import { dejsonify, jsonify } from "./schema/jsonify"
|
||||
import { ObservableZodSchemaObject } from "./traits/ObservableZodSchemaObject"
|
||||
|
||||
|
||||
@@ -15,8 +16,12 @@ const newTestExp = new ZodSchemaClassBuilder(TraitExpression.NullSuperclass, [])
|
||||
defaultValues: { id: -1n },
|
||||
})
|
||||
.jsonifiable({
|
||||
jsonifySchema: ({ schema }) => schema.extend({}),
|
||||
dejsonifySchema: ({ schema }) => schema.extend({}),
|
||||
jsonifySchema: ({ schema, shape }) => schema.extend({
|
||||
id: jsonify.bigint(shape.id)
|
||||
}),
|
||||
dejsonifySchema: ({ schema, shape }) => schema.extend({
|
||||
id: dejsonify.bigint(shape.id)
|
||||
}),
|
||||
})
|
||||
.expresses(ObservableZodSchemaObject)
|
||||
.build()
|
||||
|
||||
Reference in New Issue
Block a user