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

    Type Parameters

    • T

      The generic type of the value being tested.

    Parameters

    • value: null | T

      The value which could possibly be null.

    • 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 null.