{"ScriptPreparationCode":"function is(x, y) {\r\n\tif (x === y) {\r\n\t\treturn x !== 0 || y !== 0 || 1 / x === 1 / y;\r\n\t}\r\n\treturn x !== x \u0026\u0026 y !== y;\r\n}\r\n\r\nfunction shallowEqual(objA, objB) {\r\n\tif (is(objA, objB)) return true;\r\n\r\n\tif (typeof objA !== \u0027object\u0027 || objA === null || typeof objB !== \u0027object\u0027 || objB === null) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tconst keysA = Object.keys(objA);\r\n\tconst keysB = Object.keys(objB);\r\n\r\n\tif (keysA.length !== keysB.length) return false;\r\n\r\n\tfor (let i = 0; i \u003C keysA.length; i\u002B\u002B) {\r\n\t\tif (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n// 1 level deep\r\nwindow.foo1 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } };\r\nwindow.bar1 = { a: 1, b: 3, c: { a: 1, b: 2, c: { a: 1, b: 2 } } };\r\n\r\n// 2 levels deep\r\nwindow.foo2 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } };\r\nwindow.bar2 = { a: 1, b: 2, c: { a: 1, b: 3, c: { a: 1, b: 2 } } };\r\n\r\n// 3 levels deep\r\nwindow.foo3 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } };\r\nwindow.bar3 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 4 } } };","TestCases":[{"Name":"_.isEqual Level 1","Code":"_.isEqual(window.foo1, window.bar1)","IsDeferred":false},{"Name":"JSON.stringify Level 1","Code":"JSON.stringify(window.foo1) === JSON.stringify(window.bar1);","IsDeferred":false},{"Name":"_.isEqual Level 2","Code":"_.isEqual(window.foo2, window.bar2)","IsDeferred":false},{"Name":"JSON.stringify Level 2","Code":"JSON.stringify(window.foo2) === JSON.stringify(window.bar2);","IsDeferred":false},{"Name":"_.isEqual Level 3","Code":"_.isEqual(window.foo3, window.bar3)","IsDeferred":false},{"Name":"JSON.stringify Level 3","Code":"JSON.stringify(window.foo3) === JSON.stringify(window.bar3);","IsDeferred":false},{"Name":"shallowEqual Level 1","Code":"shallowEqual(window.foo1, window.bar1)","IsDeferred":false},{"Name":"shallowEqual Level 2","Code":"shallowEqual(window.foo2, window.bar2)","IsDeferred":false},{"Name":"shallowEqual Level 3","Code":"shallowEqual(window.foo3, window.bar3)","IsDeferred":false}]}