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

This commit is contained in:
Julien Valverdé
2024-03-15 03:14:55 +01:00
parent 2e09d9a0e0
commit c3c7c0aba5

View File

@@ -13,18 +13,15 @@ type CreateArgs<Input extends object> = (
export const ZodSchemaObject = < export const ZodSchemaObject = <
SchemaT extends z.ZodRawShape, SchemaT extends z.ZodRawShape,
SchemaUnknownKeys extends z.UnknownKeysParam,
SchemaCatchall extends z.ZodTypeAny, SchemaCatchall extends z.ZodTypeAny,
SchemaWithDefaultValuesT extends z.ZodRawShape, SchemaWithDefaultValuesT extends z.ZodRawShape,
SchemaWithDefaultValuesUnknownKeys extends z.UnknownKeysParam,
SchemaWithDefaultValuesCatchall extends z.ZodTypeAny, SchemaWithDefaultValuesCatchall extends z.ZodTypeAny,
Values extends object, Values extends object,
PartialValues extends Partial<Values>, PartialValues extends Partial<Values>,
>( >(
schema: z.ZodObject<SchemaT, SchemaUnknownKeys, SchemaCatchall, Values, Values>, schema: z.ZodObject<SchemaT, "strip", SchemaCatchall, Values, Values>,
schemaWithDefaultValues: z.ZodObject<SchemaWithDefaultValuesT, SchemaWithDefaultValuesUnknownKeys, SchemaWithDefaultValuesCatchall, Values, PartialValues>, schemaWithDefaultValues: z.ZodObject<SchemaWithDefaultValuesT, "strip", SchemaWithDefaultValuesCatchall, Values, PartialValues>,
) => trait ) => trait
.implement(Super => class ZodSchemaObject extends Super { .implement(Super => class ZodSchemaObject extends Super {
static readonly schema = schema static readonly schema = schema
@@ -95,11 +92,8 @@ export const ZodSchemaObject = <
export type ZodSchemaObjectTrait< export type ZodSchemaObjectTrait<
SchemaT extends z.ZodRawShape, SchemaT extends z.ZodRawShape,
SchemaUnknownKeys extends z.UnknownKeysParam,
SchemaCatchall extends z.ZodTypeAny, SchemaCatchall extends z.ZodTypeAny,
SchemaWithDefaultValuesT extends z.ZodRawShape, SchemaWithDefaultValuesT extends z.ZodRawShape,
SchemaWithDefaultValuesUnknownKeys extends z.UnknownKeysParam,
SchemaWithDefaultValuesCatchall extends z.ZodTypeAny, SchemaWithDefaultValuesCatchall extends z.ZodTypeAny,
Values extends object, Values extends object,
@@ -108,11 +102,8 @@ export type ZodSchemaObjectTrait<
ReturnType< ReturnType<
typeof ZodSchemaObject< typeof ZodSchemaObject<
SchemaT, SchemaT,
SchemaUnknownKeys,
SchemaCatchall, SchemaCatchall,
SchemaWithDefaultValuesT, SchemaWithDefaultValuesT,
SchemaWithDefaultValuesUnknownKeys,
SchemaWithDefaultValuesCatchall, SchemaWithDefaultValuesCatchall,
Values, Values,