diff --git a/src/tests.ts b/src/tests.ts index 42f4ca7..6438366 100644 --- a/src/tests.ts +++ b/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 {}