Constructors
constructor
- new Ok<T>(value): Ok<T>
Returns Ok<T>
Methods
extract
- extract<E>(): {
error?: E;
value?: T;
} Returns {
error?: E;
value?: T;
}
- An object with the value or error property set.
Optional
error?: E
Optional
value?: T
flatMap
- flatMap<U>(mapper): Result<U, never>
Parameters
mapper: ((value) => Result<U, never>)
Returns Result<U, never>
- A new Result with the transformed value.
map
- map<U>(mapper): Result<U, never>
Returns Result<U, never>
- A new Result with the transformed value.
toOptional
- toOptional(): Optional<T>
- An Optional containing the success value.
Represents the successful outcome of an operation with a value.