Repository URL to install this package:
|
Version:
5.0.0-rc.11 ▾
|
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var _baseIsEqual = require('./_baseIsEqual.js');
var _isStrictComparable = require('./_isStrictComparable.js');
var _matchesStrictComparable = require('./_matchesStrictComparable.js');
var _isKey = require('./_isKey.js');
var _toKey = require('./_toKey.js');
var get = require('./get.js');
var hasIn = require('./hasIn.js');
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (_isKey.default(path) && _isStrictComparable.default(srcValue)) {
return _matchesStrictComparable.default(_toKey.default(path), srcValue);
}
return function(object) {
var objValue = get.default(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn.default(object, path)
: _baseIsEqual.default(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
var _baseMatchesProperty = baseMatchesProperty;
exports.__moduleExports = _baseMatchesProperty;
exports.default = _baseMatchesProperty;
//# sourceMappingURL=_baseMatchesProperty.js.map