Skip to content

Function: ok()

ok<T>(data): Ok<T>

Defined in: index.ts:226

Creates an Ok result containing the provided data.

Type Parameters

T

T

The type of the data

Parameters

data

T

The success data to wrap in an Ok result

Returns

Ok<T>

An Ok result, or a Promise of an Ok result if the input is a Promise

Example

typescript
const r1 = ok("hello"); // Ok<"hello">