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

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

    Returns true for a positive integer — a value with no fractional component, including values outside the safe integer range (unlike SafeInt).

    Type Declaration

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

        • a: number

        Returns a is PositiveInt

        true if the value is a positive integer, false otherwise

    assert.isTrue(isPositiveInt(5));

    assert.isFalse(isPositiveInt(0));

    assert.isTrue(PositiveInt.is(10));