{"ScriptPreparationCode":"function equal(a, b) {\r\n if (a === b) return true;\r\n\r\n if (a \u0026\u0026 b \u0026\u0026 typeof a == \u0027object\u0027 \u0026\u0026 typeof b == \u0027object\u0027) {\r\n if (a.constructor !== b.constructor) return false;\r\n\r\n var length, i, keys;\r\n if (Array.isArray(a)) {\r\n length = a.length;\r\n if (length != b.length) return false;\r\n for (i = length; i-- !== 0;)\r\n if (!equal(a[i], b[i])) return false;\r\n return true;\r\n }\r\n\r\n\r\n\r\n if (a.constructor === RegExp) return a.source === b.source \u0026\u0026 a.flags === b.flags;\r\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\r\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\r\n\r\n keys = Object.keys(a);\r\n length = keys.length;\r\n if (length !== Object.keys(b).length) return false;\r\n\r\n for (i = length; i-- !== 0;)\r\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\r\n\r\n for (i = length; i-- !== 0;) {\r\n var key = keys[i];\r\n\r\n if (!equal(a[key], b[key])) return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n // true if both NaN, false otherwise\r\n return a!==a \u0026\u0026 b!==b;\r\n};\r\n\r\nfunction is(x, y) {\r\n if (x === y) {\r\n return x !== 0 || y !== 0 || 1 / x === 1 / y\r\n } else {\r\n return x !== x \u0026\u0026 y !== y\r\n }\r\n}\r\n\r\nfunction shallowEqual(objA, objB) {\r\n if (is(objA, objB)) return true\r\n\r\n if (\r\n typeof objA !== \u0027object\u0027 ||\r\n objA === null ||\r\n typeof objB !== \u0027object\u0027 ||\r\n objB === null\r\n ) {\r\n return false\r\n }\r\n\r\n const keysA = Object.keys(objA)\r\n const keysB = Object.keys(objB)\r\n\r\n if (keysA.length !== keysB.length) return false\r\n\r\n for (let i = 0; i \u003C keysA.length; i\u002B\u002B) {\r\n if (\r\n !Object.prototype.hasOwnProperty.call(objB, keysA[i]) ||\r\n !is(objA[keysA[i]], objB[keysA[i]])\r\n ) {\r\n return false\r\n }\r\n }\r\n\r\n return true\r\n}\r\n\r\n// 1 level deep\r\nvar data = [\r\n {\r\n description: \u0027equal numbers\u0027,\r\n value1: 1,\r\n value2: 1,\r\n },\r\n {\r\n description: \u0027not equal numbers\u0027,\r\n value1: 1,\r\n value2: 2,\r\n },\r\n \t\t{\r\n description: \u0027equal strings\u0027,\r\n value1: \u0027a\u0027,\r\n value2: \u0027a\u0027,\r\n },\r\n {\r\n description: \u0027simple array, same numeric array\u0027,\r\n value1: [1,2,3,4],\r\n value2: [1,2,3,4],\r\n },\r\n \t\t\t\t\t{\r\n description: \u0027simple array, same string array\u0027,\r\n value1: [\u0027happy\u0027, \u0027birthday\u0027, \u0027to\u0027, \u0027you\u0027],\r\n value2: [\u0027happy\u0027, \u0027birthday\u0027, \u0027to\u0027, \u0027you\u0027],\r\n },\r\n \t\t\t\t\t{\r\n description: \u0027different string array\u0027,\r\n value1: [\u0027happy\u0027, \u0027birthday\u0027, \u0027to\u0027, \u0027you\u0027, \u0027Taylor\u0027],\r\n value2: [\u0027happy\u0027, \u0027birthday\u0027, \u0027to\u0027, \u0027you\u0027],\r\n },\r\n {\r\n description: \u0027array, same deep values\u0027,\r\n value1: [[0],{x: 1},[3]],\r\n value2: [[0],{x: 1},[3]],\r\n },\r\n {\r\n description: \u0027big object\u0027,\r\n value1: {\r\n prop1: \u0027value1\u0027,\r\n prop2: \u0027value2\u0027,\r\n prop3: \u0027value3\u0027,\r\n prop4: {\r\n subProp1: \u0027sub value1\u0027,\r\n subProp2: {\r\n subSubProp1: \u0027sub sub value1\u0027,\r\n subSubProp2: [\r\n 1,\r\n 2,\r\n { prop2: 1, prop: 2 },\r\n 4,\r\n 5,\r\n ],\r\n },\r\n },\r\n prop5: 1000,\r\n prop6: new Date(2016, 2, 10),\r\n },\r\n value2: {\r\n prop5: 1000,\r\n prop3: \u0027value3\u0027,\r\n prop1: \u0027value1\u0027,\r\n prop2: \u0027value2\u0027,\r\n prop6: new Date(\u00272016/03/10\u0027),\r\n prop4: {\r\n subProp2: {\r\n subSubProp1: \u0027sub sub value1\u0027,\r\n subSubProp2: [\r\n 1,\r\n 2,\r\n { prop2: 1, prop: 2 },\r\n 4,\r\n 5,\r\n ],\r\n },\r\n subProp1: \u0027sub value1\u0027,\r\n },\r\n },\r\n equal: true,\r\n },\r\n ];","TestCases":[{"Name":"lodash0","Code":"_.isEqual(data[0].value1, data[0].value2)","IsDeferred":false},{"Name":"shallowEqual0","Code":"shallowEqual(data[0].value1, data[0].value2)","IsDeferred":false},{"Name":"lodash1","Code":"_.isEqual(data[1].value1, data[1].value2)","IsDeferred":false},{"Name":"shallowEqual1","Code":"shallowEqual(data[1].value1, data[1].value2)","IsDeferred":false},{"Name":"lodash2","Code":"_.isEqual(data[2].value1, data[2].value2)","IsDeferred":false},{"Name":"shallowEqual2","Code":"shallowEqual(data[2].value1, data[2].value2)","IsDeferred":false},{"Name":"lodash3","Code":"_.isEqual(data[3].value1, data[3].value2)","IsDeferred":false},{"Name":"shallowEqual3","Code":"shallowEqual(data[3].value1, data[3].value2)","IsDeferred":false},{"Name":"lodash4","Code":"_.isEqual(data[4].value1, data[4].value2)","IsDeferred":false},{"Name":"shallowEqual4","Code":"shallowEqual(data[4].value1, data[4].value2)","IsDeferred":false},{"Name":"lodash5","Code":"_.isEqual(data[5].value1, data[5].value2)","IsDeferred":false},{"Name":"shallowEqual5","Code":"shallowEqual(data[5].value1, data[5].value2)","IsDeferred":false},{"Name":"lodash6","Code":"_.isEqual(data[6].value1, data[6].value2)","IsDeferred":false},{"Name":"shallowEqual6","Code":"shallowEqual(data[6].value1, data[6].value2)","IsDeferred":false},{"Name":"lodash7","Code":"_.isEqual(data[7].value1, data[7].value2)","IsDeferred":false},{"Name":"shallowEqual7","Code":"shallowEqual(data[7].value1, data[7].value2)","IsDeferred":false}]}