Function equals

  • Allows quick triple-equal equality check between the values inside two Results without having to unwrap them first.

    const a = Result.of(3)
    const b = Result.of(3)
    const c = Result.of(null)
    const d = Result.nothing()

    Result.equals(a, b) // true
    Result.equals(a, c) // false
    Result.equals(c, d) // true

    Type Parameters

    • T
    • E

    Parameters

    • resultB: Result<T, E>

      A maybe to compare to.

    • resultA: Result<T, E>

      A maybe instance to check.

    Returns boolean

  • Allows quick triple-equal equality check between the values inside two Results without having to unwrap them first.

    const a = Result.of(3)
    const b = Result.of(3)
    const c = Result.of(null)
    const d = Result.nothing()

    Result.equals(a, b) // true
    Result.equals(a, c) // false
    Result.equals(c, d) // true

    Type Parameters

    • T
    • E

    Parameters

    • resultB: Result<T, E>

      A maybe to compare to.

    Returns (resultA: Result<T, E>) => boolean