Returns true if the option is a None value.
Returns true if the option is a Some value.
Method to compare two Options with and operation
other Option to compare
Method to compare two Options with andThen operation
function to return default value
expect the Option to be Some or throw an error
Match the Option value with a solver
solver to match the value (Map key to match, callback as resolver)
Optional
defaultValue: Outputdefault value if no match
Method to compare two Options with or operation
Method to compare two Options with or operation
Replace the actual value with the given one and returns the old Option.
Warning: currently TS can't change type of "this" (with asserts) and return value at the same time. https://github.com/microsoft/TypeScript/issues/41339
new value
old Option
Returns the contained Some value, consuming the self value.
Warning: currently TS can't change type of "this" (with asserts) and return value at the same time. https://github.com/microsoft/TypeScript/issues/41339
copy of original Option
Convert Option to string
string representation of the Option
Method to unwrap the value or throw an error if None
Optional
err: Error | ((err: Error) => Error)optional error or function to transform the error
Method to unwrap the value or if None then return the default value.
Method to unwrap the value or if None then return the default value from function.
function to return default value
Method to unwrap the value or if None then return the default value from constructors valueOf (mimic Rust unwrap_or_default).
constructor to return default value from valueOf
OptionBuilder is a class that represents an optional value: every Option is either Some and contains a value and type, or None which does not any type.
Since
v1.0.0