0.1.3 #4

Merged
Thilawyn merged 74 commits from next into master 2024-03-24 22:24:25 +01:00
Showing only changes of commit 2a23259b3e - Show all commits

View File

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