Sha256: 0b08f9192890bfdfc4f274850685f6b3ab46fbfdc453c28c8c8884b5d057bf38
Contents?: true
Size: 824 Bytes
Versions: 153
Compression:
Stored size: 824 Bytes
Contents
var baseIsMatch = require('./baseIsMatch'), getMatchData = require('./getMatchData'), toObject = require('./toObject'); /** * The base implementation of `_.matches` which does not 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 toObject(object))); }; } return function(object) { return baseIsMatch(object, matchData); }; } module.exports = baseMatches;
Version data entries
153 entries across 80 versions & 8 rubygems