ts-data-forge
    Preparing search index...
    isNonPositiveInt: (a: number) => a is NonPositiveInt = is

    Type guard that checks if a value is a non-positive integer.

    A non-positive integer is any integer less than or equal to zero (<= 0). This includes zero and all negative integers, but excludes positive numbers and non-integers.

    Type Declaration

      • (a: number): a is NonPositiveInt
      • Parameters

        • a: number

        Returns a is NonPositiveInt

        true if the value is a non-positive integer, false otherwise

    assert.isTrue(isNonPositiveInt(0));

    assert.isTrue(isNonPositiveInt(-5));

    assert.isFalse(isNonPositiveInt(1));