Evercatch - v0.12.0
    Preparing search index...

    Type Alias InferOk<R>

    InferOk: OkOf<ResultOf<R>>

    Infers the value type of a result.

    Works on a Result, a ResultAsync, and on functions returning either, such as a ResultFn or a ResultAsyncFn. Promises are unwrapped, so the value type of an async result is the resolved value.

    Type Parameters

    • R extends Inferable

      The result, async result or result-returning function.

    const safeParse = fromThrowable((raw: string): Config => JSON.parse(raw));

    type Parsed = InferOk<typeof safeParse>; // Config
    type Fetched = InferOk<ResultAsync<Response, Error>>; // Response