X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2Finternal%2FbaseIteratee.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2Finternal%2FbaseIteratee.js;h=ccb6bf4b936f87acdb746d38a30d5e7c533185c0;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/lodash/internal/baseIteratee.js b/node_modules/uncss/node_modules/lodash/internal/baseIteratee.js new file mode 100644 index 000000000..ccb6bf4b9 --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/internal/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;