A finite number. You can't pass a bigint as they are already guaranteed to be finite.
number
bigint
Use-case: Validating and documenting parameters.
Note: This can't detect NaN, please upvote this issue if you want to have this type as a built-in in TypeScript.
NaN
import type {Finite} from 'type-fest';declare function setScore<T extends number>(length: Finite<T>): void; Copy
import type {Finite} from 'type-fest';declare function setScore<T extends number>(length: Finite<T>): void;
A finite
number. You can't pass abigintas they are already guaranteed to be finite.Use-case: Validating and documenting parameters.
Note: This can't detect
NaN, please upvote this issue if you want to have this type as a built-in in TypeScript.