Working new implementation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
23
src/tests.ts
23
src/tests.ts
@@ -2,25 +2,20 @@ import { z } from "zod"
|
||||
import { ZodSchemaClassOf, defineDefaultValues } from "."
|
||||
|
||||
|
||||
class Test extends ZodSchemaClassOf<Test>()(Object, {
|
||||
class Test extends ZodSchemaClassOf(Object, {
|
||||
schema: z.object({
|
||||
id: z.bigint()
|
||||
id: z.bigint(),
|
||||
name: z.string(),
|
||||
}),
|
||||
|
||||
defaultValues: defineDefaultValues({ id: -1n }),
|
||||
}) {}
|
||||
Test.newPromise()
|
||||
Test.extend()
|
||||
Test.defaultValues
|
||||
const inst = await Test.newPromise({ id: 1n, name: "" })
|
||||
// Test.extend()
|
||||
|
||||
new Test({ id: 1n }).id
|
||||
console.log(inst)
|
||||
|
||||
// class ChildTest extends Test {}
|
||||
|
||||
const Test2 = ZodSchemaClassOf<Test>()(Object, {
|
||||
schema: z.object({
|
||||
id: z.bigint()
|
||||
}),
|
||||
|
||||
defaultValues: defineDefaultValues({ id: -1n }),
|
||||
})
|
||||
|
||||
Test2.extend()
|
||||
// ChildTest.newPromise()
|
||||
|
||||
Reference in New Issue
Block a user