1 var Stack = require(
'./_Stack'),
2 equalArrays = require(
'./_equalArrays'),
3 equalByTag = require(
'./_equalByTag'),
4 equalObjects = require(
'./_equalObjects'),
5 getTag = require(
'./_getTag'),
6 isArray = require(
'./isArray'),
7 isBuffer = require(
'./isBuffer'),
8 isTypedArray = require(
'./isTypedArray');
11 var COMPARE_PARTIAL_FLAG = 1;
14 var argsTag =
'[object Arguments]',
15 arrayTag =
'[object Array]',
16 objectTag =
'[object Object]';
19 var objectProto = Object.prototype;
22 var hasOwnProperty = objectProto.hasOwnProperty;
38 function baseIsEqualDeep(
object, other, bitmask, customizer, equalFunc, stack) {
39 var objIsArr = isArray(
object),
40 othIsArr = isArray(other),
41 objTag = objIsArr ? arrayTag : getTag(
object),
42 othTag = othIsArr ? arrayTag : getTag(other);
44 objTag = objTag == argsTag ? objectTag : objTag;
45 othTag = othTag == argsTag ? objectTag : othTag;
47 var objIsObj = objTag == objectTag,
48 othIsObj = othTag == objectTag,
49 isSameTag = objTag == othTag;
51 if (isSameTag && isBuffer(
object)) {
52 if (!isBuffer(other)) {
58 if (isSameTag && !objIsObj) {
59 stack || (stack =
new Stack);
60 return (objIsArr || isTypedArray(
object))
61 ? equalArrays(
object, other, bitmask, customizer, equalFunc, stack)
62 : equalByTag(
object, other, objTag, bitmask, customizer, equalFunc, stack);
64 if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
65 var objIsWrapped = objIsObj && hasOwnProperty.call(
object,
'__wrapped__'),
66 othIsWrapped = othIsObj && hasOwnProperty.call(other,
'__wrapped__');
68 if (objIsWrapped || othIsWrapped) {
69 var objUnwrapped = objIsWrapped ?
object.value() : object,
70 othUnwrapped = othIsWrapped ? other.value() : other;
72 stack || (stack =
new Stack);
73 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
79 stack || (stack =
new Stack);
80 return equalObjects(
object, other, bitmask, customizer, equalFunc, stack);
83 module.exports = baseIsEqualDeep;