Evercatch - v0.5.0
    Preparing search index...

    Function unsafe

    • Extracts the successful value from a Result, 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 T

      The success value if the result is successful.

      The Err object if the result is a failure.

      const result = someSafeFunction();
      const value = unsafe(result); // Throws if result is an error