@workwell-global/component-library 1.1.37 → 1.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -99,9 +99,13 @@ export function create365Schema<TField extends Record<string, FieldObj>>(
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
return z.object(shape) as ZodObject<
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
return z.object(shape) as ZodObject<
|
|
103
|
+
{
|
|
104
|
+
[K in keyof TField]: TField[K]['type'] extends ZodTypeAny
|
|
105
|
+
? TField[K]['type']
|
|
106
|
+
: ZodTypeAny
|
|
107
|
+
} & { [key: string]: ZodTypeAny }
|
|
108
|
+
>
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
export function createPrettySchema<TField extends Record<string, FieldObj>>(
|
|
@@ -123,6 +127,8 @@ export function createPrettySchema<TField extends Record<string, FieldObj>>(
|
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
return z.object(shape) as ZodObject<{
|
|
126
|
-
[Key in keyof TField as TField[Key]['pretty']]: ZodTypeAny
|
|
130
|
+
[Key in keyof TField as TField[Key]['pretty']]: TField[Key]['type'] extends ZodTypeAny
|
|
131
|
+
? TField[Key]['type']
|
|
132
|
+
: ZodTypeAny
|
|
127
133
|
}>
|
|
128
134
|
}
|