• Throws if the given value is nullish, otherwise returns it.

    Type Parameters

    • T

      The generic type of the value being tested.

    Parameters

    • value: Nullish | T

      The value which could possibly be nullish.

    • name: string = "value"

      The (optional) name of the value, to include in the thrown error message.

    Returns T

    The value, once it has been confirmed it is not nullish.