1 var baseIsMatch = require('./_baseIsMatch'),
2 getMatchData = require('./_getMatchData');
5 * The base implementation of `_.matches` which doesn't clone `source`.
8 * @param {Object} source The object of property values to match.
9 * @returns {Function} Returns the new function.
11 function baseMatches(source) {
12 var matchData = getMatchData(source);
13 if (matchData.length == 1 && matchData[0][2]) {
14 var key = matchData[0][0],
15 value = matchData[0][1];
17 return function(object) {
21 return object[key] === value &&
22 (value !== undefined || (key in Object(object)));
25 return function(object) {
26 return object === source || baseIsMatch(object, source, matchData);
30 module.exports = baseMatches;