Hey there, I'm having issues with Infertype not functioning correctly for optional fields.
const userSchema = yup.object({
name: yup.string().required(),
age: yup.number().required().positive().integer(),
email: yup.string().email().optional().notRequired(),
website: yup.string().url().nullable(),
createdOn: yup.date().default(() => new Date()),
});
The expected type should be:
/* {
name: string;
age: number;
email?: string | undefined
website?: string | null | undefined
createdOn: Date
}*/
This is the current type being generated:
https://i.sstatic.net/mToQS.png
The email and website fields should be optional according to the schema.
Here is a snippet from my tsconfig.json file:
"compilerOptions": {
...
"strict": true,
"strictNullChecks": true
}