Fixed InstantiableZodSchemaObject
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
31
src/tests.ts
31
src/tests.ts
@@ -11,23 +11,32 @@ class Test extends ZodSchemaClass({
|
||||
defaultValues: { id: -1n },
|
||||
}) {}
|
||||
|
||||
const Test2 = ZodSchemaClass({
|
||||
schema: z.object({
|
||||
id: z.bigint(),
|
||||
name: z.string(),
|
||||
}),
|
||||
|
||||
defaultValues: { id: -1n },
|
||||
})
|
||||
|
||||
Test.defaultValues
|
||||
const inst = await Test.createPromise({ id: 1n, name: "" })
|
||||
const inst = Test.create({ id: 1n, name: "" })
|
||||
|
||||
|
||||
class SubTest extends Test.extend({
|
||||
schema: ({ schema }) => schema.extend({
|
||||
prout: z.string()
|
||||
}),
|
||||
// class SubTest extends Test.extend({
|
||||
// schema: ({ schema }) => schema.extend({
|
||||
// prout: z.string()
|
||||
// }),
|
||||
|
||||
defaultValues: defaultValues => defineDefaultValues({
|
||||
...defaultValues
|
||||
}),
|
||||
}) {}
|
||||
// defaultValues: defaultValues => defineDefaultValues({
|
||||
// ...defaultValues
|
||||
// }),
|
||||
// }) {}
|
||||
|
||||
const subInst = await SubTest.createPromise({ name: "", prout: "" })
|
||||
// const subInst = await SubTest.createPromise({ name: "", prout: "" })
|
||||
|
||||
console.log(subInst)
|
||||
// console.log(subInst)
|
||||
|
||||
// class ChildTest extends Test {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user