Function isTruthy

  • Checks if a given value is a truthy value.

    Example

    isTruthy(true)
    // => true

    isTruthy([])
    // => true

    isTruthy({})
    // => true

    isTruthy(false)
    // => false

    isTruthy(on)
    // => false

    Type Parameters

    • T

      The type of the value to check.

    Parameters

    • value: T

      The value to be checked.

    Returns value is NonNullable<T>

    true if the value is truthy and not null or undefined, false otherwise.

Generated using TypeDoc v0.24.7