X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2FisArrayLike.js;fp=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2FisArrayLike.js;h=9f4ddd51bb6767dd066c22e6b58d24054de9bc7e;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/isArrayLike.js b/node_modules/grunt-legacy-util/node_modules/lodash/isArrayLike.js new file mode 100644 index 000000000..9f4ddd51b --- /dev/null +++ b/node_modules/grunt-legacy-util/node_modules/lodash/isArrayLike.js @@ -0,0 +1,35 @@ +var getLength = require('./_getLength'), + isFunction = require('./isFunction'), + isLength = require('./isLength'); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && + !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); +} + +module.exports = isArrayLike;