A successful Result, with its value.
Result
value
import { Ok } from "staquia";const result = new Ok(5);console.log(result.ok, result.value); // true 5 Copy
import { Ok } from "staquia";const result = new Ok(5);console.log(result.ok, result.value); // true 5
The type of the value.
Creates an instance of an Ok result.
Optional
The value to wrap, optional if T permits void/undefined.
T
void
undefined
Indicates that the result is successful.
The successful value contained within this result.
Returns a string representation of the contained value.
A successful
Result, with itsvalue.Example