File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -11,19 +11,15 @@ export default async function getToJsonSchemaFn(): Promise<ToJsonSchemaFn> {
1111 // https://zod.dev/library-authors?id=how-to-support-zod-and-zod-mini-simultaneously#how-to-support-zod-3-and-zod-4-simultaneously
1212 if ( "_zod" in ( schema as $ZodType | ZodTypeAny ) ) {
1313 try {
14- handler = await import ( "zod/v4/core" )
15- . catch ( ( ) => {
16- throw zodv4Error ;
17- } )
18- . then ( ( mod ) => mod . toJSONSchema as ToJsonSchemaFn ) ;
14+ const mod = await import ( "zod/v4/core" )
15+ handler = mod . toJSONSchema as ToJsonSchemaFn ;
1916 } catch {
2017 throw zodv4Error ;
2118 }
2219 } else {
2320 try {
24- handler = await import ( "zod-to-json-schema" ) . then (
25- ( mod ) => mod . zodToJsonSchema as ToJsonSchemaFn ,
26- ) ;
21+ const mod = await import ( "zod-to-json-schema" )
22+ handler = mod . zodToJsonSchema as ToJsonSchemaFn ;
2723 } catch {
2824 throw new MissingDependencyError ( "zod-to-json-schema" ) ;
2925 }
You can’t perform that action at this time.
0 commit comments