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
I keep reimplementing these in projects using ts-results-es,
I figured the could be added to the core.
Add three static methods to the Option namespace for converting
nullable, optional, and nullish values to Option<T>. fromNullable
and fromOptional are the preferred APIs for T | null and T | undefined
respectively as they avoid accidentally treating undefined and null
the same way if the input type ever changes. fromNullish handles
tT | null | undefined.
0 commit comments