@@ -38,6 +38,7 @@ class ZodDeclarationFileBuilder {
3838
3939 // we keep track of the schemas we've seen so we can
4040 // process resolve-ref schemas
41+ // deno-lint-ignore no-explicit-any
4142 schemas : Record < string , any > = { } ;
4243
4344 // deno-lint-ignore no-explicit-any
@@ -106,18 +107,13 @@ ${zodInferredTypes}`;
106107 convertSchemaEnum ( schema : any ) : string | undefined {
107108 // deno-lint-ignore no-explicit-any
108109 const zodEnumDeclaration = ( values : any [ ] ) => {
109- // deno-lint-ignore no-explicit-any
110- const zodEnumValues = values . map ( ( value : any ) => {
111- return JSON . stringify ( value ) ;
112- } ) ;
113-
114110 // first filter out strings
115- const zodEnumStrings = zodEnumValues . filter ( ( value ) => {
111+ const zodEnumStrings = values . filter ( ( value ) => {
116112 return typeof value === "string" ;
117113 } ) . map ( ( value ) => {
118114 return JSON . stringify ( value ) ;
119115 } ) ;
120- const zodLiterals = zodEnumValues . filter ( ( x ) => {
116+ const zodLiterals = values . filter ( ( x ) => {
121117 return typeof x !== "string" ;
122118 } ) ;
123119 const zodTypes : string [ ] = [ ] ;
@@ -131,7 +127,7 @@ ${zodInferredTypes}`;
131127 zodTypes . push (
132128 ...zodLiterals . map ( ( x ) => {
133129 return `z.literal(${ JSON . stringify ( x ) } )` ;
134- } ) . join ( ", " ) ,
130+ } ) ,
135131 ) ;
136132 }
137133 if ( zodTypes . length === 0 ) {
0 commit comments