X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2Finternal%2FbaseMatches.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2Finternal%2FbaseMatches.js;h=b94ac5f18ed2ab573b91da40d284cb49b2de035e;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/lodash/internal/baseMatches.js b/node_modules/uncss/node_modules/lodash/internal/baseMatches.js new file mode 100644 index 000000000..b94ac5f18 --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/internal/baseMatches.js @@ -0,0 +1,30 @@ +var baseIsMatch = require('./baseIsMatch'), + getMatchData = require('./getMatchData'); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + var key = matchData[0][0], + value = matchData[0][1]; + + return function(object) { + if (object == null) { + return false; + } + return object[key] === value && + (value !== undefined || (key in Object(object))); + }; + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches;