Function assertKnown

  • Asserts that an Upward is known, otherwise throws the provided error.

    Useful when Unknown values should be treated as hard failures.

    Returns

    True as a type predicate when value is known.

    Type Parameters

    • T

      The type representing the known variants

    Parameters

    • value: Upward<T>

      The possibly Unknown value returned from gRPC.

    • error: string | Error

      Error to throw if value is unknown.

    Returns value is T

Generated using TypeDoc