Constraint that rejects error types that could be nullish.
null in the error slot means "this result is ok, there is no error", so an
error can never be null. undefined is rejected along with it, since it
means "no error was passed" everywhere an error is optional.
Every error type in this library is constrained with it. Use it when writing
your own generic helpers around Result.
unknown is allowed, so an error caught in a catch block can be passed on
as is. any is not, since it resolves to a nullish type here; widen it to
unknown instead.
Constraint that rejects error types that could be nullish.
nullin the error slot means "this result is ok, there is no error", so an error can never benull.undefinedis rejected along with it, since it means "no error was passed" everywhere an error is optional.Every error type in this library is constrained with it. Use it when writing your own generic helpers around Result.
unknownis allowed, so an error caught in acatchblock can be passed on as is.anyis not, since it resolves to a nullish type here; widen it tounknowninstead.