UNPKG

@gvray/eskit

Version:

A rich and colorful toolkit about typescript and javascript.

26 lines 739 B
/** * Checks if a value is a number (including NaN and Infinity). * 检查值是否为数字(包括NaN和Infinity)。 * * @param value - The value to check / 要检查的值 * @returns True if the value is a number / 如果值是数字则返回true * * @example * ```typescript * isNumber(42) // true * isNumber(3.14) // true * isNumber(NaN) // true (NaN is type 'number') * isNumber(Infinity) // true * isNumber(-Infinity) // true * isNumber('42') // false * isNumber(null) // false * isNumber(undefined) // false * isNumber([]) // false * isNumber({}) // false * ``` * * @since 1.0.0 */ declare const isNumber: (value: unknown) => value is number; export default isNumber; //# sourceMappingURL=isNumber.d.ts.map