ts-fortress
    Preparing search index...

    Variable isPositiveIntConst

    isPositiveInt: (a: number) => a is TtfImported_PositiveInt

    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 TtfImported_PositiveInt
      • Parameters

        • a: number

        Returns a is TtfImported_PositiveInt

        true if the value is a positive integer, false otherwise

    assert.isTrue(isPositiveInt(5));

    assert.isFalse(isPositiveInt(0));

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