00001 var baseIsEqual = require('./_baseIsEqual'), 00002 get = require('./get'), 00003 hasIn = require('./hasIn'), 00004 isKey = require('./_isKey'), 00005 isStrictComparable = require('./_isStrictComparable'), 00006 matchesStrictComparable = require('./_matchesStrictComparable'), 00007 toKey = require('./_toKey'); 00008 00010 var COMPARE_PARTIAL_FLAG = 1, 00011 COMPARE_UNORDERED_FLAG = 2; 00012 00021 function baseMatchesProperty(path, srcValue) { 00022 if (isKey(path) && isStrictComparable(srcValue)) { 00023 return matchesStrictComparable(toKey(path), srcValue); 00024 } 00025 return function(object) { 00026 var objValue = get(object, path); 00027 return (objValue === undefined && objValue === srcValue) 00028 ? hasIn(object, path) 00029 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 00030 }; 00031 } 00032 00033 module.exports = baseMatchesProperty;