vue-app-sdk
Version:
21 lines (20 loc) • 1.02 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const _baseIsEqual = require("./_baseIsEqual.cjs");
const get = require("./get.cjs");
const hasIn = require("./hasIn.cjs");
const _isKey = require("./_isKey.cjs");
const _isStrictComparable = require("./_isStrictComparable.cjs");
const _matchesStrictComparable = require("./_matchesStrictComparable.cjs");
const _toKey = require("./_toKey.cjs");
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
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 === void 0 && objValue === srcValue ? hasIn.default(object, path) : _baseIsEqual.default(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
exports.default = baseMatchesProperty;