Creates an Ok variant of a Result containing the given value.
Wraps the provided value in an Ok, indicating a successful outcome for a checked Result.
The type of the value.
The type of the potential error.
A Result containing the value as Ok.
const x = ok<number, string>(42);
expect(x.isOk()).toBe(true);
expect(x.unwrap()).toBe(42);
Creates an Ok variant of a Result with a
void
value.Wraps
undefined
in an Ok, indicating a successful outcome with no value (void
) for a checked Result.