If you know how to fix the issue, make a pull request instead.
If you do not mention the authors the issue will be ignored.
I have a suggestion for an improvement to the typings. Happy to submit a PR but I wanted to make sure this change makes sense first.
Currently, the yup package treats all object properties as optional by default:
const schema = yup.object({
asdf: yup.string()
})
schema.validate({}) // passes
Yet yup.InferType infers the type as: { asdf: string } when really it should be { asdf?: string }.
The idea behind this change is to make all calls to yup.string, yup.number, and yup.boolean optional by default, which aligns with the behavior of the actual package implementation. I have this working on my local machine, but I wanted to run this by you guys in case there's a reason it's currently done this way.
If you know how to fix the issue, make a pull request instead.
@types/xxxxpackage and had problems.Definitions by:inindex.d.ts) so they can respond.If you do not mention the authors the issue will be ignored.
I have a suggestion for an improvement to the typings. Happy to submit a PR but I wanted to make sure this change makes sense first.
Currently, the yup package treats all object properties as optional by default:
Yet
yup.InferTypeinfers the type as:{ asdf: string }when really it should be{ asdf?: string }.The idea behind this change is to make all calls to
yup.string,yup.number, andyup.booleanoptional by default, which aligns with the behavior of the actual package implementation. I have this working on my local machine, but I wanted to run this by you guys in case there's a reason it's currently done this way.