File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export interface ZodV3Internal {
3131export interface ZodV4Internal {
3232 _zod ?: {
3333 def ?: {
34- typeName ?: string ;
34+ type ?: string ;
3535 value ?: unknown ;
3636 values ?: unknown [ ] ;
3737 shape ?: Record < string , AnySchema > | ( ( ) => Record < string , AnySchema > ) ;
@@ -175,7 +175,7 @@ export function normalizeObjectSchema(schema: AnySchema | ZodRawShapeCompat | un
175175 // Check if it's a v4 object
176176 const v4Schema = schema as unknown as ZodV4Internal ;
177177 const def = v4Schema . _zod ?. def ;
178- if ( def && ( def . typeName === 'object' || def . shape !== undefined ) ) {
178+ if ( def && ( def . type === 'object' || def . shape !== undefined ) ) {
179179 return schema as AnyObjectSchema ;
180180 }
181181 } else {
@@ -238,7 +238,7 @@ export function getSchemaDescription(schema: AnySchema): string | undefined {
238238export function isSchemaOptional ( schema : AnySchema ) : boolean {
239239 if ( isZ4Schema ( schema ) ) {
240240 const v4Schema = schema as unknown as ZodV4Internal ;
241- return v4Schema . _zod ?. def ?. typeName === 'ZodOptional ' ;
241+ return v4Schema . _zod ?. def ?. type === 'optional ' ;
242242 }
243243 const v3Schema = schema as unknown as ZodV3Internal ;
244244 // v3 has isOptional() method
You can’t perform that action at this time.
0 commit comments