{"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\n\r\nvar tests = [\r\n {\r\n description: \u0027scalars\u0027,\r\n tests: [\r\n {\r\n description: \u0027equal numbers\u0027,\r\n value1: 1,\r\n value2: 1,\r\n equal: true\r\n },\r\n {\r\n description: \u0027not equal numbers\u0027,\r\n value1: 1,\r\n value2: 2,\r\n equal: false\r\n },\r\n {\r\n description: \u0027number and array are not equal\u0027,\r\n value1: 1,\r\n value2: [],\r\n equal: false\r\n },\r\n {\r\n description: \u00270 and null are not equal\u0027,\r\n value1: 0,\r\n value2: null,\r\n equal: false\r\n },\r\n {\r\n description: \u0027equal strings\u0027,\r\n value1: \u0027a\u0027,\r\n value2: \u0027a\u0027,\r\n equal: true\r\n },\r\n {\r\n description: \u0027not equal strings\u0027,\r\n value1: \u0027a\u0027,\r\n value2: \u0027b\u0027,\r\n equal: false\r\n },\r\n {\r\n description: \u0027empty string and null are not equal\u0027,\r\n value1: \u0027\u0027,\r\n value2: null,\r\n equal: false\r\n },\r\n {\r\n description: \u0027null is equal to null\u0027,\r\n value1: null,\r\n value2: null,\r\n equal: true\r\n },\r\n {\r\n description: \u0027equal booleans (true)\u0027,\r\n value1: true,\r\n value2: true,\r\n equal: true\r\n },\r\n {\r\n description: \u0027equal booleans (false)\u0027,\r\n value1: false,\r\n value2: false,\r\n equal: true\r\n },\r\n {\r\n description: \u0027not equal booleans\u0027,\r\n value1: true,\r\n value2: false,\r\n equal: false\r\n },\r\n {\r\n description: \u00271 and true are not equal\u0027,\r\n value1: 1,\r\n value2: true,\r\n equal: false\r\n },\r\n {\r\n description: \u00270 and false are not equal\u0027,\r\n value1: 0,\r\n value2: false,\r\n equal: false\r\n },\r\n {\r\n description: \u0027NaN and NaN are equal\u0027,\r\n value1: NaN,\r\n value2: NaN,\r\n equal: true\r\n },\r\n {\r\n description: \u00270 and -0 are equal\u0027,\r\n value1: 0,\r\n value2: -0,\r\n equal: true\r\n },\r\n {\r\n description: \u0027Infinity and Infinity are equal\u0027,\r\n value1: Infinity,\r\n value2: Infinity,\r\n equal: true\r\n },\r\n {\r\n description: \u0027Infinity and -Infinity are not equal\u0027,\r\n value1: Infinity,\r\n value2: -Infinity,\r\n equal: false\r\n }\r\n ]\r\n },\r\n\r\n {\r\n description: \u0027objects\u0027,\r\n tests: [\r\n {\r\n description: \u0027empty objects are equal\u0027,\r\n value1: {},\r\n value2: {},\r\n equal: true\r\n },\r\n {\r\n description: \u0027equal objects (same properties \u0022order\u0022)\u0027,\r\n value1: {a: 1, b: \u00272\u0027},\r\n value2: {a: 1, b: \u00272\u0027},\r\n equal: true\r\n },\r\n {\r\n description: \u0027equal objects (different properties \u0022order\u0022)\u0027,\r\n value1: {a: 1, b: \u00272\u0027},\r\n value2: {b: \u00272\u0027, a: 1},\r\n equal: true\r\n },\r\n {\r\n description: \u0027not equal objects (extra property)\u0027,\r\n value1: {a: 1, b: \u00272\u0027},\r\n value2: {a: 1, b: \u00272\u0027, c: []},\r\n equal: false\r\n },\r\n {\r\n description: \u0027not equal objects (different property values)\u0027,\r\n value1: {a: 1, b: \u00272\u0027, c: 3},\r\n value2: {a: 1, b: \u00272\u0027, c: 4},\r\n equal: false\r\n },\r\n {\r\n description: \u0027not equal objects (different properties)\u0027,\r\n value1: {a: 1, b: \u00272\u0027, c: 3},\r\n value2: {a: 1, b: \u00272\u0027, d: 3},\r\n equal: false\r\n },\r\n {\r\n description: \u0027equal objects (same sub-properties)\u0027,\r\n value1: { a: [ { b: \u0027c\u0027 } ] },\r\n value2: { a: [ { b: \u0027c\u0027 } ] },\r\n equal: true\r\n },\r\n {\r\n description: \u0027not equal objects (different sub-property value)\u0027,\r\n value1: { a: [ { b: \u0027c\u0027 } ] },\r\n value2: { a: [ { b: \u0027d\u0027 } ] },\r\n equal: false\r\n },\r\n {\r\n description: \u0027not equal objects (different sub-property)\u0027,\r\n value1: { a: [ { b: \u0027c\u0027 } ] },\r\n value2: { a: [ { c: \u0027c\u0027 } ] },\r\n equal: false\r\n },\r\n {\r\n description: \u0027empty array and empty object are not equal\u0027,\r\n value1: {},\r\n value2: [],\r\n equal: false\r\n },\r\n {\r\n description: \u0027object with extra undefined properties are not equal #1\u0027,\r\n value1: {},\r\n value2: {foo: undefined},\r\n equal: false\r\n },\r\n {\r\n description: \u0027object with extra undefined properties are not equal #2\u0027,\r\n value1: {foo: undefined},\r\n value2: {},\r\n equal: false\r\n },\r\n {\r\n description: \u0027object with extra undefined properties are not equal #3\u0027,\r\n value1: {foo: undefined},\r\n value2: {bar: undefined},\r\n equal: false\r\n },\r\n {\r\n description: \u0027nulls are equal\u0027,\r\n value1: null,\r\n value2: null,\r\n equal: true\r\n },\r\n {\r\n description: \u0027null and undefined are not equal\u0027,\r\n value1: null,\r\n value2: undefined,\r\n equal: false\r\n },\r\n {\r\n description: \u0027null and empty object are not equal\u0027,\r\n value1: null,\r\n value2: {},\r\n equal: false\r\n },\r\n {\r\n description: \u0027undefined and empty object are not equal\u0027,\r\n value1: undefined,\r\n value2: {},\r\n equal: false\r\n },\r\n {\r\n description: \u0027objects with different \u0060toString\u0060 functions returning same values are equal\u0027,\r\n value1: {toString: ()=\u003E\u0027Hello world!\u0027},\r\n value2: {toString: ()=\u003E\u0027Hello world!\u0027},\r\n equal: true\r\n },\r\n {\r\n description: \u0027objects with \u0060toString\u0060 functions returning different values are not equal\u0027,\r\n value1: {toString: ()=\u003E\u0027Hello world!\u0027},\r\n value2: {toString: ()=\u003E\u0027Hi!\u0027},\r\n equal: false\r\n }\r\n ]\r\n },\r\n\r\n {\r\n description: \u0027arrays\u0027,\r\n tests: [\r\n {\r\n description: \u0027two empty arrays are equal\u0027,\r\n value1: [],\r\n value2: [],\r\n equal: true\r\n },\r\n {\r\n description: \u0027equal arrays\u0027,\r\n value1: [1, 2, 3],\r\n value2: [1, 2, 3],\r\n equal: true\r\n },\r\n {\r\n description: \u0027not equal arrays (different item)\u0027,\r\n value1: [1, 2, 3],\r\n value2: [1, 2, 4],\r\n equal: false\r\n },\r\n {\r\n description: \u0027not equal arrays (different length)\u0027,\r\n value1: [1, 2, 3],\r\n value2: [1, 2],\r\n equal: false\r\n },\r\n {\r\n description: \u0027equal arrays of objects\u0027,\r\n value1: [{a: \u0027a\u0027}, {b: \u0027b\u0027}],\r\n value2: [{a: \u0027a\u0027}, {b: \u0027b\u0027}],\r\n equal: true\r\n },\r\n {\r\n description: \u0027not equal arrays of objects\u0027,\r\n value1: [{a: \u0027a\u0027}, {b: \u0027b\u0027}],\r\n value2: [{a: \u0027a\u0027}, {b: \u0027c\u0027}],\r\n equal: false\r\n },\r\n {\r\n description: \u0027pseudo array and equivalent array are not equal\u0027,\r\n value1: {\u00270\u0027: 0, \u00271\u0027: 1, length: 2},\r\n value2: [0, 1],\r\n equal: false\r\n }\r\n ]\r\n },\r\n {\r\n description: \u0027Date objects\u0027,\r\n tests: [\r\n {\r\n description: \u0027equal date objects\u0027,\r\n value1: new Date(\u00272017-06-16T21:36:48.362Z\u0027),\r\n value2: new Date(\u00272017-06-16T21:36:48.362Z\u0027),\r\n equal: true\r\n },\r\n {\r\n description: \u0027not equal date objects\u0027,\r\n value1: new Date(\u00272017-06-16T21:36:48.362Z\u0027),\r\n value2: new Date(\u00272017-01-01T00:00:00.000Z\u0027),\r\n equal: false\r\n },\r\n {\r\n description: \u0027date and string are not equal\u0027,\r\n value1: new Date(\u00272017-06-16T21:36:48.362Z\u0027),\r\n value2: \u00272017-06-16T21:36:48.362Z\u0027,\r\n equal: false\r\n },\r\n {\r\n description: \u0027date and object are not equal\u0027,\r\n value1: new Date(\u00272017-06-16T21:36:48.362Z\u0027),\r\n value2: {},\r\n equal: false\r\n }\r\n ]\r\n },\r\n {\r\n description: \u0027RegExp objects\u0027,\r\n tests: [\r\n {\r\n description: \u0027equal RegExp objects\u0027,\r\n value1: /foo/,\r\n value2: /foo/,\r\n equal: true\r\n },\r\n {\r\n description: \u0027not equal RegExp objects (different pattern)\u0027,\r\n value1: /foo/,\r\n value2: /bar/,\r\n equal: false\r\n },\r\n {\r\n description: \u0027not equal RegExp objects (different flags)\u0027,\r\n value1: /foo/,\r\n value2: /foo/i,\r\n equal: false\r\n },\r\n {\r\n description: \u0027RegExp and string are not equal\u0027,\r\n value1: /foo/,\r\n value2: \u0027foo\u0027,\r\n equal: false\r\n },\r\n {\r\n description: \u0027RegExp and object are not equal\u0027,\r\n value1: /foo/,\r\n value2: {},\r\n equal: false\r\n }\r\n ]\r\n },\r\n {\r\n description: \u0027functions\u0027,\r\n tests: [\r\n {\r\n description: \u0027same function is equal\u0027,\r\n value1: func1,\r\n value2: func1,\r\n equal: true\r\n },\r\n {\r\n description: \u0027different functions are not equal\u0027,\r\n value1: func1,\r\n value2: func2,\r\n equal: false\r\n }\r\n ]\r\n },\r\n {\r\n description: \u0027sample objects\u0027,\r\n tests: [\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: [1, 2, {prop2: 1, prop: 2}, 4, 5]\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: [1, 2, {prop2: 1, prop: 2}, 4, 5]\r\n },\r\n subProp1: \u0027sub value1\u0027\r\n }\r\n },\r\n equal: true\r\n }\r\n ]\r\n }\r\n];\r\n\r\nfunction func1() {}\r\nfunction func2() {}","TestCases":[{"Name":"fast-deep-equal","Code":"for (const testSuite of tests) {\r\n for (const test of testSuite.tests) {\r\n try {\r\n if (equal(test.value1, test.value2) !== test.equal)\r\n console.error(\u0027different result\u0027, \u0027fast-deep-equal\u0027, testSuite.description, test.description);\r\n } catch(e) {\r\n console.error(\u0027fast-deep-equal\u0027, testSuite.description, test.description, e);\r\n }\r\n }\r\n }","IsDeferred":false},{"Name":"lodash","Code":"for (const testSuite of tests) {\r\n for (const test of testSuite.tests) {\r\n try {\r\n if (_.isEqual(test.value1, test.value2) !== test.equal)\r\n console.error(\u0027different result\u0027, \u0027isEqual\u0027, testSuite.description, test.description);\r\n } catch(e) {\r\n console.error(\u0027isEqual\u0027, testSuite.description, test.description, e);\r\n }\r\n }\r\n }","IsDeferred":false}]}