@@ -121,16 +121,9 @@ function formDataToValidation<T extends AnyZodObject>(
121121 ) {
122122 if ( entry && typeof entry !== 'string' ) {
123123 // File object, not supported
124- /*
125- throw new SuperFormError(
126- `Field "${key}" contains a file, which is not supported by Superforms. Remove it from the schema and use FormData directly instead.`
127- );
128- return (entry.valueOf() as File).name;
129- return entry as File;
130- */
131124 return undefined ;
132125 } else {
133- return parseEntry ( key , entry , typeInfo ) ;
126+ return parseFormDataEntry ( key , entry , typeInfo ) ;
134127 }
135128 }
136129
@@ -146,7 +139,7 @@ function formDataToValidation<T extends AnyZodObject>(
146139 }
147140 }
148141
149- function parseEntry (
142+ function parseFormDataEntry (
150143 field : string ,
151144 value : string | null ,
152145 typeInfo : ZodTypeInfo
@@ -171,7 +164,7 @@ function formDataToValidation<T extends AnyZodObject>(
171164 return new Date ( value ?? '' ) ;
172165 } else if ( zodType instanceof ZodArray ) {
173166 const arrayType = unwrapZodType ( zodType . _def . type ) ;
174- return parseEntry ( field , value , arrayType ) ;
167+ return parseFormDataEntry ( field , value , arrayType ) ;
175168 } else if ( zodType instanceof ZodBigInt ) {
176169 try {
177170 return BigInt ( value ?? '.' ) ;
@@ -521,6 +514,7 @@ export function superValidateSync<
521514 output = emptyResultToValidation ( result , entityInfo , addErrors ) ;
522515 } else {
523516 const result = originalSchema . safeParse ( data ) ;
517+
524518 output = resultToValidation (
525519 result ,
526520 entityInfo ,
0 commit comments