From 2a23259b3e4a1cda8f2ad46ccc2e2ee008c42bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sun, 17 Mar 2024 12:53:34 +0100 Subject: [PATCH] Tests --- src/tests.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 {}