@allynet/ishod
    Preparing search index...

    Function unwrapForced

    • Force unwrap a result. You probably shouldn't use this function and use unwrap or unwrapErr instead.

      If the result is an Ok, it will return the value.

      If the result is an Err, it will return undefined.

      Type Parameters

      • T
      • E

      Parameters

      • ok: Promise<Ok<T>>

      Returns Promise<T>

      const result: Result<number, string> = ok(1);
      const value = unwrapForced(result); // 1
      const result: Result<number, string> = err("error");
      const value = unwrapForced(result); // undefined
      const result: Promise<Result<number, string>> = Promise.resolve(ok(1));
      const value: Promise<number> = unwrapForced(result); // Promise<1>
      const result: Promise<Result<number, string>> = Promise.resolve(err("error"));
      const value: Promise<undefined> = unwrapForced(result); // Promise<undefined>

      unwrap

    • Force unwrap a result. You probably shouldn't use this function and use unwrap or unwrapErr instead.

      If the result is an Ok, it will return the value.

      If the result is an Err, it will return undefined.

      Type Parameters

      • T
      • E

      Parameters

      Returns T

      const result: Result<number, string> = ok(1);
      const value = unwrapForced(result); // 1
      const result: Result<number, string> = err("error");
      const value = unwrapForced(result); // undefined
      const result: Promise<Result<number, string>> = Promise.resolve(ok(1));
      const value: Promise<number> = unwrapForced(result); // Promise<1>
      const result: Promise<Result<number, string>> = Promise.resolve(err("error"));
      const value: Promise<undefined> = unwrapForced(result); // Promise<undefined>

      unwrap

    • Force unwrap a result. You probably shouldn't use this function and use unwrap or unwrapErr instead.

      If the result is an Ok, it will return the value.

      If the result is an Err, it will return undefined.

      Type Parameters

      • T
      • E

      Parameters

      • err: Promise<Err<E>>

      Returns Promise<undefined>

      const result: Result<number, string> = ok(1);
      const value = unwrapForced(result); // 1
      const result: Result<number, string> = err("error");
      const value = unwrapForced(result); // undefined
      const result: Promise<Result<number, string>> = Promise.resolve(ok(1));
      const value: Promise<number> = unwrapForced(result); // Promise<1>
      const result: Promise<Result<number, string>> = Promise.resolve(err("error"));
      const value: Promise<undefined> = unwrapForced(result); // Promise<undefined>

      unwrap

    • Force unwrap a result. You probably shouldn't use this function and use unwrap or unwrapErr instead.

      If the result is an Ok, it will return the value.

      If the result is an Err, it will return undefined.

      Type Parameters

      • T
      • E

      Parameters

      Returns undefined

      const result: Result<number, string> = ok(1);
      const value = unwrapForced(result); // 1
      const result: Result<number, string> = err("error");
      const value = unwrapForced(result); // undefined
      const result: Promise<Result<number, string>> = Promise.resolve(ok(1));
      const value: Promise<number> = unwrapForced(result); // Promise<1>
      const result: Promise<Result<number, string>> = Promise.resolve(err("error"));
      const value: Promise<undefined> = unwrapForced(result); // Promise<undefined>

      unwrap

    • Force unwrap a result. You probably shouldn't use this function and use unwrap or unwrapErr instead.

      If the result is an Ok, it will return the value.

      If the result is an Err, it will return undefined.

      Type Parameters

      • T
      • E

      Parameters

      Returns Promise<undefined | T>

      const result: Result<number, string> = ok(1);
      const value = unwrapForced(result); // 1
      const result: Result<number, string> = err("error");
      const value = unwrapForced(result); // undefined
      const result: Promise<Result<number, string>> = Promise.resolve(ok(1));
      const value: Promise<number> = unwrapForced(result); // Promise<1>
      const result: Promise<Result<number, string>> = Promise.resolve(err("error"));
      const value: Promise<undefined> = unwrapForced(result); // Promise<undefined>

      unwrap

    • Force unwrap a result. You probably shouldn't use this function and use unwrap or unwrapErr instead.

      If the result is an Ok, it will return the value.

      If the result is an Err, it will return undefined.

      Type Parameters

      • T
      • E

      Parameters

      Returns undefined | T

      const result: Result<number, string> = ok(1);
      const value = unwrapForced(result); // 1
      const result: Result<number, string> = err("error");
      const value = unwrapForced(result); // undefined
      const result: Promise<Result<number, string>> = Promise.resolve(ok(1));
      const value: Promise<number> = unwrapForced(result); // Promise<1>
      const result: Promise<Result<number, string>> = Promise.resolve(err("error"));
      const value: Promise<undefined> = unwrapForced(result); // Promise<undefined>

      unwrap