Class type detection
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Julien Valverdé
2024-01-24 21:40:27 +01:00
parent 338c750a4b
commit 516ce0ade2
4 changed files with 32 additions and 8 deletions

View File

@@ -1,12 +1,8 @@
import { z } from "zod"
import { ZodSchemaClassOf, defineDefaultValues } from "."
import { ZodSchemaClass, defineDefaultValues } from "."
class Root {
}
class Test extends ZodSchemaClassOf(Root, {
class Test extends ZodSchemaClass({
schema: z.object({
id: z.bigint(),
name: z.string(),
@@ -18,6 +14,7 @@ class Test extends ZodSchemaClassOf(Root, {
Test.defaultValues
const inst = await Test.instantiatePromise({ id: 1n, name: "" })
class SubTest extends Test.extend({
schema: ({ schema }) => schema.extend({
prout: z.string()