mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
45
react-app/node_modules/lodash/internal/baseMatchesProperty.js
generated
vendored
Normal file
45
react-app/node_modules/lodash/internal/baseMatchesProperty.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
var baseGet = require('./baseGet'),
|
||||
baseIsEqual = require('./baseIsEqual'),
|
||||
baseSlice = require('./baseSlice'),
|
||||
isArray = require('../lang/isArray'),
|
||||
isKey = require('./isKey'),
|
||||
isStrictComparable = require('./isStrictComparable'),
|
||||
last = require('../array/last'),
|
||||
toObject = require('./toObject'),
|
||||
toPath = require('./toPath');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.matchesProperty` which does not clone `srcValue`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} path The path of the property to get.
|
||||
* @param {*} srcValue The value to compare.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseMatchesProperty(path, srcValue) {
|
||||
var isArr = isArray(path),
|
||||
isCommon = isKey(path) && isStrictComparable(srcValue),
|
||||
pathKey = (path + '');
|
||||
|
||||
path = toPath(path);
|
||||
return function(object) {
|
||||
if (object == null) {
|
||||
return false;
|
||||
}
|
||||
var key = pathKey;
|
||||
object = toObject(object);
|
||||
if ((isArr || !isCommon) && !(key in object)) {
|
||||
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
|
||||
if (object == null) {
|
||||
return false;
|
||||
}
|
||||
key = last(path);
|
||||
object = toObject(object);
|
||||
}
|
||||
return object[key] === srcValue
|
||||
? (srcValue !== undefined || (key in object))
|
||||
: baseIsEqual(srcValue, object[key], undefined, true);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = baseMatchesProperty;
|
Reference in New Issue
Block a user