0.1.2 #3
@@ -1,5 +1,5 @@
|
|||||||
import { expression } from "@thilawyn/traitify-ts"
|
import { expression } from "@thilawyn/traitify-ts"
|
||||||
import { AbstractClass } from "type-fest"
|
import { AbstractClass, Simplify } from "type-fest"
|
||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
import { ExtendableZodSchemaObject } from "./traits/ExtendableZodSchemaObject"
|
import { ExtendableZodSchemaObject } from "./traits/ExtendableZodSchemaObject"
|
||||||
import { InstantiableZodSchemaObject } from "./traits/InstantiableZodSchemaObject"
|
import { InstantiableZodSchemaObject } from "./traits/InstantiableZodSchemaObject"
|
||||||
@@ -36,18 +36,19 @@ export function ZodSchemaClassOf<
|
|||||||
return expression
|
return expression
|
||||||
.extends(Schemas as unknown as (
|
.extends(Schemas as unknown as (
|
||||||
AbstractClass<
|
AbstractClass<
|
||||||
InstanceType<typeof of> &
|
InstanceType<Superclass> &
|
||||||
Extend<[
|
Simplify<
|
||||||
InstanceType<typeof Schemas>,
|
Extend<[Schemas, Values]>
|
||||||
Values,
|
>,
|
||||||
]>,
|
|
||||||
|
|
||||||
ConstructorParameters<typeof Schemas>
|
ConstructorParameters<typeof Schemas>
|
||||||
> &
|
> &
|
||||||
Extend<[
|
Simplify<
|
||||||
StaticMembers<typeof of>,
|
Extend<[
|
||||||
StaticMembers<typeof Schemas>,
|
StaticMembers<Superclass>,
|
||||||
]>
|
StaticMembers<typeof Schemas>,
|
||||||
|
]>
|
||||||
|
>
|
||||||
))
|
))
|
||||||
.expresses(
|
.expresses(
|
||||||
InstantiableZodSchemaObject,
|
InstantiableZodSchemaObject,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { ZodSchemaClass } from "./ZodSchemaClass"
|
|||||||
|
|
||||||
const TestExp = ZodSchemaClass({
|
const TestExp = ZodSchemaClass({
|
||||||
schema: z.object({
|
schema: z.object({
|
||||||
|
/** Object ID */
|
||||||
id: z.bigint(),
|
id: z.bigint(),
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user