Evercatch - v0.3.1
    Preparing search index...

    Function unsafeAsync

    • Extracts the successful value from a ResultAsync, throwing an error if it represents a failure.

      Type Parameters

      • T
      • E extends string

      Parameters

      Returns Promise<T>

      The success value if present

      An Err if the Result contains an error

      const value = await unsafe(someSafeAsyncFunction());
      // If someSafeAsyncFunction() returns an error, the error will be thrown