Skip to content

Commit eca7775

Browse files
committed
Preprocessed option allows files now.
1 parent 51bcdcd commit eca7775

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lib/superValidate.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,16 @@ function formDataToValidation<T extends AnyZodObject>(
164164
entry: FormDataEntryValue,
165165
typeInfo: ZodTypeInfo
166166
) {
167+
if (preprocessed && preprocessed.includes(key)) {
168+
return entry;
169+
}
170+
167171
if (entry && typeof entry !== 'string') {
168172
// File object, not supported
169173
return undefined;
170-
} else if (!preprocessed || !preprocessed.includes(key)) {
171-
return parseFormDataEntry(key, entry, typeInfo);
172-
} else {
173-
return entry;
174174
}
175+
176+
return parseFormDataEntry(key, entry, typeInfo);
175177
}
176178

177179
for (const key of schemaKeys) {

0 commit comments

Comments
 (0)