ExtendableZodSchemaObject
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Julien Valverdé
2024-02-25 04:45:58 +01:00
parent e7c65c0a07
commit bf429fc63b
3 changed files with 25 additions and 53 deletions

View File

@@ -38,13 +38,22 @@ const inst = User.create({ id: 1n, name: "" })
const jsonifiedUser = await inst.jsonifyPromise()
class SubTest extends User.extend({
schema: ({ schema }) => schema.extend({
prout: z.string()
}),
const extended = User.extend()
.schema({
schema: s => s.extend({
name: z.literal("Admin")
}),
defaultValues: v => v,
})
defaultValues: v => v,
}) {}
class SubTest extends User.extend()
.schema({
schema: s => s.extend({}),
defaultValues: v => v,
})
.build()
{}
const subInst = await SubTest.createPromise({ name: "", prout: "" })
// console.log(subInst)