Const
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).
true
SafeInt
true if the value is a positive integer, false otherwise
false
assert.isTrue(isPositiveInt(5));assert.isFalse(isPositiveInt(0));assert.isTrue(PositiveInt.is(10)); Copy
assert.isTrue(isPositiveInt(5));assert.isFalse(isPositiveInt(0));assert.isTrue(PositiveInt.is(10));
Type guard that checks if a value is a positive integer.
Returns
truefor a positive integer — a value with no fractional component, including values outside the safe integer range (unlikeSafeInt).