1 var baseIsMatch = require('./baseIsMatch'),
2 getMatchData = require('./getMatchData'),
3 toObject = require('./toObject');
6 * The base implementation of `_.matches` which does not clone `source`.
9 * @param {Object} source The object of property values to match.
10 * @returns {Function} Returns the new function.
12 function baseMatches(source) {
13 var matchData = getMatchData(source);
14 if (matchData.length == 1 && matchData[0][2]) {
15 var key = matchData[0][0],
16 value = matchData[0][1];
18 return function(object) {
22 return object[key] === value && (value !== undefined || (key in toObject(object)));
25 return function(object) {
26 return baseIsMatch(object, matchData);
30 module.exports = baseMatches;