Creates a value that may be invalid.
true if the value is valid, or false if invalid
the value
Applies a function to the value if it is valid. If the value is invalid, no action is taken.
this if the value is invalid; otherwise, a MaybeInvalid instance wrapping the
result of applying the mapper to the value
Returns the valid value, or a default value if invalid. A value of null does not hold any
special significance. It does not imply that the value is invalid.
a value
the valid value, or defaultValue if the value is invalid
Returns the valid value, or a default value if invalid. A value of null does not hold any
special significance. It does not imply that the value is invalid.
a value
the valid value, or defaultValue if the value is invalid
Returns the valid value, or a default value if invalid. A value of null does not hold any
special significance. It does not imply that the value is invalid.
a supplier that returns the default value
the valid value, or defaultValue if the value is invalid
Converts an undefined or null value to an invalid value. If the value is invalid or non-null, no
action is taken.
an invalid value if the original value was undefined or null; otherwise, returns this
with T excluding undefined and null
Evaluates a condition on the value.
the condition to evaluate
true if the value is invalid, undefined, null or if the condition returns false;
otherwise, returns false
StaticinvalidReturns an invalid value.
an invalid value
StaticvalidReturns a valid value.
a value
a valid value
Represents a value that is being validated.
This class is not intended to replace
undefinedornullreferences but to record additional information alongside them.Instead of throwing an error when an
undefinedornullvalue is accessed, the system marks it as invalid and continues to record validation failures.