X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2F_baseIteratee.js;fp=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2F_baseIteratee.js;h=19531af3b9ae8c9bc810e5ac783a992ce76982d7;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/_baseIteratee.js b/node_modules/grunt-legacy-util/node_modules/lodash/_baseIteratee.js new file mode 100644 index 000000000..19531af3b --- /dev/null +++ b/node_modules/grunt-legacy-util/node_modules/lodash/_baseIteratee.js @@ -0,0 +1,30 @@ +var baseMatches = require('./_baseMatches'), + baseMatchesProperty = require('./_baseMatchesProperty'), + identity = require('./identity'), + isArray = require('./isArray'), + property = require('./property'); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + var type = typeof value; + if (type == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (type == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee;