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

    Type Parameters

    • T

      The generic type of the value being tested.

    Parameters

    • value: Falsy | T

      The value which could possibly be falsy.

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