-
-
Notifications
You must be signed in to change notification settings - Fork 0
number nonzero finite
Nicholas Berlette edited this page Jun 19, 2025
·
1 revision
function isNonZeroFiniteNumber<N = number>(it: N): it is NonZeroFinite<N>;Checks if a given value is a nonzero finite number.
| Name | Info |
|---|---|
it |
The value to check. |
true if the value is a nonzero finite number, false otherwise.
Numbers
import { isNonZeroFiniteNumber } from "jsr:@nick/is/integer";
console.log(isNonZeroFiniteNumber(0)); // false
console.log(isNonZeroFiniteNumber(1)); // true
console.log(isNonZeroFiniteNumber(-1)); // true
console.log(isNonZeroFiniteNumber(1.5)); // true
console.log(isNonZeroFiniteNumber(NaN)); // false
console.log(isNonZeroFiniteNumber(Infinity)); // truefunction isNonZeroFiniteNumber(it: unknown): it is NonZeroFinite;Checks if a given value is a nonzero finite number.
| Name | Info |
|---|---|
it |
The value to check. |
true if the value is a nonzero finite number, false otherwise.
Numbers
import { isNonZeroFiniteNumber } from "jsr:@nick/is/integer";
console.log(isNonZeroFiniteNumber(0)); // false
console.log(isNonZeroFiniteNumber(1)); // true
console.log(isNonZeroFiniteNumber(-1)); // true
console.log(isNonZeroFiniteNumber(1.5)); // true
console.log(isNonZeroFiniteNumber(NaN)); // false
console.log(isNonZeroFiniteNumber(Infinity)); // trueexport type MaybeNonZeroFinite<N = number> = Cast<N, MAYBE_NON_ZERO_FINITE>;Casts a value into a partial nonzero finite type. If the value is not a number,
it will resolve to never.
-
N(default:number)
export type NonZeroFinite<N = number> = Cast<N, NON_ZERO_FINITE>;Casts a value into a nonzero finite type. If the value is not a number, it will
resolve to never.
-
N(default:number)
Numbers