0.1.3 #4
11
src/tests.ts
11
src/tests.ts
@@ -2,6 +2,7 @@ import { Implements } from "@thilawyn/traitify-ts"
|
||||
import { z } from "zod"
|
||||
import { ZodSchemaClass } from "./ZodSchemaClass"
|
||||
import { MobXObservableZodSchemaObject } from "./traits/MobXObservableZodSchemaObject"
|
||||
import { stripZodObjectDefaults } from "./util"
|
||||
|
||||
|
||||
// const exp = zodSchemaClass
|
||||
@@ -43,6 +44,16 @@ const exp = ZodSchemaClass(
|
||||
.expresses(MobXObservableZodSchemaObject)
|
||||
.build()
|
||||
|
||||
const test = stripZodObjectDefaults(
|
||||
z.object({
|
||||
/** User ID */
|
||||
id: z.bigint().default(-1n),
|
||||
|
||||
/** Username */
|
||||
name: z.string(),
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
@exp.staticImplements
|
||||
class User extends exp.extends implements Implements<typeof exp> {}
|
||||
|
||||
Reference in New Issue
Block a user