Create a successful result with some data.
import { ok, isOk, isErr } from "typerun/result";const result = ok(42);console.log(isOk(result)); // trueconsole.log(isErr(result)); // falseconsole.log(result.data); // 42 Copy
import { ok, isOk, isErr } from "typerun/result";const result = ok(42);console.log(isOk(result)); // trueconsole.log(isErr(result)); // falseconsole.log(result.data); // 42
The data to wrap in a successful result.
Create a successful result with some data.
Example