happy-rusty
    Preparing search index...

    Function isResult

    • Checks if a value is a Result.

      Type Parameters

      • T

        The expected type of the success value contained within the Result.

      • E

        The expected type of the error value contained within the Result.

      Parameters

      • r: unknown

        The value to be checked as a Result.

      Returns r is Result<T, E>

      true if the value is a Result, otherwise false.

      1.2.0

      const x = Ok(5);
      console.log(isResult(x)); // true
      console.log(isResult(null)); // false
      console.log(isResult({ value: 5 })); // false