0.1.1 #2

Merged
Thilawyn merged 47 commits from next into master 2024-01-17 20:47:13 +01:00
Showing only changes of commit d28f95af82 - Show all commits

View File

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