Sha256: 6f0491c5ca5c4d7fc26cca3097ea9aa257e30e006d4c3251c0df1e7a1cfe0f66

Contents?: true

Size: 802 Bytes

Versions: 276

Compression:

Stored size: 802 Bytes

Contents

/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/**
 * Checks if `value` is a valid array-like length.
 *
 * **Note:** This method is loosely based on
 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
 * @example
 *
 * _.isLength(3);
 * // => true
 *
 * _.isLength(Number.MIN_VALUE);
 * // => false
 *
 * _.isLength(Infinity);
 * // => false
 *
 * _.isLength('3');
 * // => false
 */
function isLength(value) {
  return typeof value == 'number' &&
    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}

module.exports = isLength;

Version data entries

276 entries across 274 versions & 31 rubygems

Version Path
rapid_stack-0.1.1 templates/FrontEnd/node_modules/lodash/isLength.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/lodash/isLength.js
immosquare-cleaner-0.1.60 node_modules/lodash/isLength.js
immosquare-cleaner-0.1.59 node_modules/lodash/isLength.js
immosquare-cleaner-0.1.58 node_modules/lodash/isLength.js
immosquare-cleaner-0.1.57 node_modules/lodash/isLength.js
immosquare-cleaner-0.1.56 node_modules/lodash/isLength.js
immosquare-cleaner-0.1.55 node_modules/lodash/isLength.js
immosquare-cleaner-0.1.54 node_modules/lodash/isLength.js
immosquare-cleaner-0.1.53 node_modules/lodash/isLength.js
immosquare-cleaner-0.1.52 node_modules/lodash/isLength.js
trusty-cms-6.3.1 node_modules/lodash/isLength.js
immosquare-cleaner-0.1.51 node_modules/lodash/isLength.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/isLength.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/isLength.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/isLength.js
immosquare-cleaner-0.1.50 node_modules/lodash/isLength.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/isLength.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/isLength.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/isLength.js