Are you sure it’s passing `undefined` here and not like an empty string or null maybe?
Are you sure it’s passing
undefined here and not like an empty string or null maybe?import type syntax to make an index that only re-exports types?z.custom<File>(() => true)field?: T | undefined rather than just field?: T{} isn’t an instance of File even with your assertion because instance of is a runtime concept and the assertion is just a compile time assertionFile global was defined in your environment, not whether the input was a file or an object{} with a union like this:{} or a File object.ZodSchema? I think that’s unavoidable. npm/yarn/pnpm should abstract that concern away if you make your package depend on Zod thoughtype TSomeSchema = z.infer<typeof someSchema>; => type TSomeSchema = { foo: string; bar: number };defaultValues, passed to the useForm call, i.e. not to individual input fieldsdefaultValue on individual fields. We just use this:useForm hook. And the same with the default values, just one chunk of default values that I load and assemble before passing it as well to useForm, once.preprocess is just defined that way since the input to the preprocessor is unknown. https://github.com/colinhacks/zod/blob/502384e56fe2b1f8173735df6c3b0d41bce04edc/src/types.ts#L4350import typez.custom<File>(() => true)field?: T | undefinedfield?: TZodSchematype TSomeSchema = z.infer<typeof someSchema>;type TSomeSchema = { foo: string; bar: number };preprocessfile: z.union([z.record(z.never()), z.instanceof(File)])interface Foo {
file: Record<string, never> | File;
}