function isOk
Since 0.1.0
isOk<T, E>(result: Result<T, E>): result is Ok<T>

Type guard: narrows a Result to Ok.

Type Parameters

The success value type

The error type

Parameters

result: Result<T, E>

The result to inspect

Return Type

result is Ok<T>

true if the result is Ok

Usage

import { isOk } from "common/src/index.ts";