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
Ideally something (tsc/lint) would disallow this (since foo is shown to be a number, i.e. NonNullable<>) in order to stunt the proliferation of unnecessary optional values.
You probably wouldn't write this directly in code most of the time. However, this poses an issue when doing any type of refactoring.
For example, in our codebase we had type Standard = ... & { domain: null | Domain } everywhere in our codebase. This entailed a bunch of uses of maybe-js to handle the optional standard.domain. Over time we made the field required, changing the type definition to type Standard = ... & { domain: Domain }. maybe not checking this left optionals and optional handling downstream of this change.
The text was updated successfully, but these errors were encountered:
Non-nullable types are accepted and compile/lint just fine in our various maybe-js combinators:
Ideally something (tsc/lint) would disallow this (since
foo
is shown to be anumber
, i.e.NonNullable<>
) in order to stunt the proliferation of unnecessary optional values.You probably wouldn't write this directly in code most of the time. However, this poses an issue when doing any type of refactoring.
For example, in our codebase we had
type Standard = ... & { domain: null | Domain }
everywhere in our codebase. This entailed a bunch of uses ofmaybe-js
to handle the optionalstandard.domain
. Over time we made the field required, changing the type definition totype Standard = ... & { domain: Domain }
.maybe
not checking this left optionals and optional handling downstream of this change.The text was updated successfully, but these errors were encountered: