Skip to content

Function.ok

GitHub Actions edited this page Mar 5, 2025 · 27 revisions

resultar / ok

Function: ok()

Call Signature

ok<T, E>(value): Result<T, E>

Defined in: result.ts:626

Creates a new Result instance representing a successful operation.

Type Parameters

T

E = never

Parameters

value

T

The value to be wrapped in the Result instance.

Returns

Result<T, E>

A new Result instance with the provided value.

Call Signature

ok<T, E>(value): Result<void, E>

Defined in: result.ts:626

Creates a new Result instance representing a successful operation.

Type Parameters

T extends void = void

E = never

Parameters

value

void

The value to be wrapped in the Result instance.

Returns

Result<void, E>

A new Result instance with the provided value.