You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Typescript the optional word is used to mean that an property in the object can be undefined.
Optional Properties
Not all properties of an interface may be required. Some exist under certain conditions or may not be there at all. These optional properties are popular when creating patterns like “option bags” where you pass an object to a function that only has a couple of properties filled in.
In Typescript the optional word is used to mean that an property in the object can be
undefined
.From the Typescript hand book
But the
IsOptional
decorator checks if its an emptystring
and notnull
.Source
In my opinion
IsOptional
should check if it isundefined
(and maybenull
) and the current version should be renamed.The text was updated successfully, but these errors were encountered: