mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Bump to v3.6.0.
This commit is contained in:
@@ -15,26 +15,26 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
* @param {Object} other The other object to compare.
|
||||
* @param {Function} equalFunc The function to determine equivalents of values.
|
||||
* @param {Function} [customizer] The function to customize comparing values.
|
||||
* @param {boolean} [isWhere] Specify performing partial comparisons.
|
||||
* @param {boolean} [isLoose] Specify performing partial comparisons.
|
||||
* @param {Array} [stackA] Tracks traversed `value` objects.
|
||||
* @param {Array} [stackB] Tracks traversed `other` objects.
|
||||
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
||||
*/
|
||||
function equalObjects(object, other, equalFunc, customizer, isWhere, stackA, stackB) {
|
||||
function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
|
||||
var objProps = keys(object),
|
||||
objLength = objProps.length,
|
||||
othProps = keys(other),
|
||||
othLength = othProps.length;
|
||||
|
||||
if (objLength != othLength && !isWhere) {
|
||||
if (objLength != othLength && !isLoose) {
|
||||
return false;
|
||||
}
|
||||
var hasCtor,
|
||||
var skipCtor = isLoose,
|
||||
index = -1;
|
||||
|
||||
while (++index < objLength) {
|
||||
var key = objProps[index],
|
||||
result = hasOwnProperty.call(other, key);
|
||||
result = isLoose ? key in other : hasOwnProperty.call(other, key);
|
||||
|
||||
if (result) {
|
||||
var objValue = object[key],
|
||||
@@ -42,21 +42,21 @@ function equalObjects(object, other, equalFunc, customizer, isWhere, stackA, sta
|
||||
|
||||
result = undefined;
|
||||
if (customizer) {
|
||||
result = isWhere
|
||||
result = isLoose
|
||||
? customizer(othValue, objValue, key)
|
||||
: customizer(objValue, othValue, key);
|
||||
}
|
||||
if (typeof result == 'undefined') {
|
||||
// Recursively compare objects (susceptible to call stack limits).
|
||||
result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isWhere, stackA, stackB);
|
||||
result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);
|
||||
}
|
||||
}
|
||||
if (!result) {
|
||||
return false;
|
||||
}
|
||||
hasCtor || (hasCtor = key == 'constructor');
|
||||
skipCtor || (skipCtor = key == 'constructor');
|
||||
}
|
||||
if (!hasCtor) {
|
||||
if (!skipCtor) {
|
||||
var objCtor = object.constructor,
|
||||
othCtor = other.constructor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user