Sha256: 98f3368a9e9cefa6247b7429682558ec2dd3adb2a930f859b77ca4743516f76d
Contents?: true
Size: 886 Bytes
Versions: 264
Compression:
Stored size: 886 Bytes
Contents
var baseGetTag = require('./_baseGetTag'), isObjectLike = require('./isObjectLike'); /** `Object#toString` result references. */ var numberTag = '[object Number]'; /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike(value) && baseGetTag(value) == numberTag); } module.exports = isNumber;
Version data entries
264 entries across 262 versions & 29 rubygems