extendWithZodSchema work
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:
@@ -66,13 +66,10 @@ export function extendWithZodSchema<
|
|||||||
SchemaValues
|
SchemaValues
|
||||||
>,
|
>,
|
||||||
) {
|
) {
|
||||||
|
return class extends extend {
|
||||||
const class_ = class extends extend {
|
|
||||||
static readonly schema = schema
|
static readonly schema = schema
|
||||||
readonly schema = schema
|
readonly schema = schema
|
||||||
}
|
} as unknown as (
|
||||||
|
|
||||||
return class_ as unknown as (
|
|
||||||
Class<
|
Class<
|
||||||
Omit<C, "schema"> &
|
Omit<C, "schema"> &
|
||||||
{ readonly schema: typeof schema } &
|
{ readonly schema: typeof schema } &
|
||||||
@@ -83,7 +80,6 @@ export function extendWithZodSchema<
|
|||||||
Omit<StaticMembers<C>, "schema"> &
|
Omit<StaticMembers<C>, "schema"> &
|
||||||
{ readonly schema: typeof schema }
|
{ readonly schema: typeof schema }
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -99,4 +95,4 @@ const Test2Schema = Test1.schema.extend({ prout: z.literal("ruquier"), ruquier:
|
|||||||
const Test2 = extendWithZodSchema(Test1, Test2Schema)
|
const Test2 = extendWithZodSchema(Test1, Test2Schema)
|
||||||
|
|
||||||
Test2.schema
|
Test2.schema
|
||||||
new Test2().schema
|
new Test2().prout
|
||||||
|
|||||||
Reference in New Issue
Block a user