Evercatch - v0.5.0
    Preparing search index...

    Function unsafeAsync

    • Extracts the successful value from a ResultAsync, or throws the error if it's a failure.

      Type Parameters

      • T

        The type of the success value.

      • E extends string

        A string literal type for the error label.

      Parameters

      Returns Promise<T>

      A Promise that resolves with the success value.

      The Err object if the result is a failure.

      const result = someSafeAsyncFunction();
      const value = await unsafeAsync(result); // Throws if result is an error