{"ScriptPreparationCode":"function fastDeepEqual(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 (!fastDeepEqual(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 (!fastDeepEqual(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\nconst fn = () =\u003E {};\r\nconst promise = Promise.resolve(\u0027foo\u0027);\r\n\r\nvar tests = [\r\n {\r\n description: \u0027primitives\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027equal numbers\u0027,\r\n shallowEqual: true,\r\n value1: 1,\r\n value2: 1,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal numbers\u0027,\r\n shallowEqual: false,\r\n value1: 1,\r\n value2: 2,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal zero\u0027,\r\n shallowEqual: true,\r\n value1: 0,\r\n value2: 0,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal positive and negative zero\u0027,\r\n shallowEqual: true,\r\n value1: -0,\r\n value2: 0,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal Infinity\u0027,\r\n shallowEqual: true,\r\n value1: Infinity,\r\n value2: Infinity,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal Infinity\u0027,\r\n shallowEqual: false,\r\n value1: -Infinity,\r\n value2: Infinity,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal number objects\u0027,\r\n shallowEqual: true,\r\n value1: new Number(1),\r\n value2: new Number(1),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal number objects\u0027,\r\n shallowEqual: false,\r\n value1: new Number(1),\r\n value2: new Number(2),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027number and array are not equal\u0027,\r\n shallowEqual: false,\r\n value1: 1,\r\n value2: [],\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u00270 and null are not equal\u0027,\r\n shallowEqual: false,\r\n value1: 0,\r\n value2: null,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027NaN and NaN are equal\u0027,\r\n shallowEqual: true,\r\n value1: NaN,\r\n value2: NaN,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal strings\u0027,\r\n shallowEqual: true,\r\n value1: \u0027a\u0027,\r\n value2: \u0027a\u0027,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal strings\u0027,\r\n shallowEqual: false,\r\n value1: \u0027a\u0027,\r\n value2: \u0027b\u0027,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal string objects\u0027,\r\n shallowEqual: true,\r\n value1: new String(\u0027foo\u0027),\r\n value2: new String(\u0027foo\u0027),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal string objects\u0027,\r\n shallowEqual: false,\r\n value1: new String(\u0027foo\u0027),\r\n value2: new String(\u0027bar\u0027),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027empty string and null are not equal\u0027,\r\n shallowEqual: false,\r\n value1: \u0027\u0027,\r\n value2: null,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027null is equal to null\u0027,\r\n shallowEqual: true,\r\n value1: null,\r\n value2: null,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal booleans (true)\u0027,\r\n shallowEqual: true,\r\n value1: true,\r\n value2: true,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal booleans (false)\u0027,\r\n shallowEqual: true,\r\n value1: false,\r\n value2: false,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal boolean objects (true)\u0027,\r\n shallowEqual: true,\r\n value1: new Boolean(true),\r\n value2: new Boolean(true),\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal boolean objects (false)\u0027,\r\n shallowEqual: true,\r\n value1: new Boolean(false),\r\n value2: new Boolean(false),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal booleans\u0027,\r\n shallowEqual: false,\r\n value1: true,\r\n value2: false,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal boolean objects\u0027,\r\n shallowEqual: false,\r\n value1: new Boolean(true),\r\n value2: new Boolean(false),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u00271 and true are not equal\u0027,\r\n shallowEqual: false,\r\n value1: 1,\r\n value2: true,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u00270 and false are not equal\u0027,\r\n shallowEqual: false,\r\n value1: 0,\r\n value2: false,\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027functions\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027function and the same function are equal\u0027,\r\n shallowEqual: true,\r\n value1: fn,\r\n value2: fn,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027function and different function are not equal\u0027,\r\n shallowEqual: false,\r\n value1: fn,\r\n value2: () =\u003E {},\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027objects\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027empty objects are equal\u0027,\r\n shallowEqual: true,\r\n value1: {},\r\n value2: {},\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal objects (same properties \u0022order\u0022)\u0027,\r\n shallowEqual: true,\r\n value1: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n },\r\n value2: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n },\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal objects (different properties \u0022order\u0022)\u0027,\r\n shallowEqual: true,\r\n value1: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n },\r\n value2: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n },\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal objects (extra property)\u0027,\r\n shallowEqual: false,\r\n value1: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n },\r\n value2: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n c: [],\r\n },\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal objects (different properties)\u0027,\r\n shallowEqual: false,\r\n value1: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n c: 3,\r\n },\r\n value2: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n d: 3,\r\n },\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal objects (different properties)\u0027,\r\n shallowEqual: false,\r\n value1: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n c: 3,\r\n },\r\n value2: {\r\n a: 1,\r\n b: \u00272\u0027,\r\n d: 3,\r\n },\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal objects (same sub-properties)\u0027,\r\n shallowEqual: false,\r\n value1: { a: [{ b: \u0027c\u0027 }] },\r\n value2: { a: [{ b: \u0027c\u0027 }] },\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal objects (different sub-property value)\u0027,\r\n shallowEqual: false,\r\n value1: { a: [{ b: \u0027c\u0027 }] },\r\n value2: { a: [{ b: \u0027d\u0027 }] },\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal objects (different sub-property)\u0027,\r\n shallowEqual: false,\r\n value1: { a: [{ b: \u0027c\u0027 }] },\r\n value2: { a: [{ c: \u0027c\u0027 }] },\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027empty array and empty object are not equal\u0027,\r\n shallowEqual: false,\r\n value1: {},\r\n value2: [],\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027object with extra undefined properties are not equal #1\u0027,\r\n shallowEqual: false,\r\n value1: {},\r\n value2: { foo: undefined },\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027object with extra undefined properties are not equal #2\u0027,\r\n shallowEqual: false,\r\n value1: { foo: undefined },\r\n value2: {},\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027object with extra undefined properties are not equal #3\u0027,\r\n shallowEqual: false,\r\n value1: { foo: undefined },\r\n value2: { bar: undefined },\r\n },\r\n ],\r\n },\r\n\r\n {\r\n description: \u0027arrays\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027two empty arrays are equal\u0027,\r\n shallowEqual: true,\r\n value1: [],\r\n value2: [],\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal arrays\u0027,\r\n shallowEqual: true,\r\n value1: [1, 2, 3],\r\n value2: [1, 2, 3],\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal arrays (different item)\u0027,\r\n shallowEqual: false,\r\n value1: [1, 2, 3],\r\n value2: [1, 2, 4],\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal arrays (different length)\u0027,\r\n shallowEqual: false,\r\n value1: [1, 2, 3],\r\n value2: [1, 2],\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal arrays of objects\u0027,\r\n shallowEqual: false,\r\n value1: [{ a: \u0027a\u0027 }, { b: \u0027b\u0027 }],\r\n value2: [{ a: \u0027a\u0027 }, { b: \u0027b\u0027 }],\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal arrays of objects\u0027,\r\n shallowEqual: false,\r\n value1: [{ a: \u0027a\u0027 }, { b: \u0027b\u0027 }],\r\n value2: [{ a: \u0027a\u0027 }, { b: \u0027c\u0027 }],\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027pseudo array and equivalent array are not equal\u0027,\r\n shallowEqual: false,\r\n value1: {\r\n 0: 0,\r\n 1: 1,\r\n length: 2,\r\n },\r\n value2: [0, 1],\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027dates\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027equal date objects\u0027,\r\n shallowEqual: true,\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 },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal date objects\u0027,\r\n shallowEqual: false,\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 },\r\n {\r\n deepEqual: false,\r\n description: \u0027date and string are not equal\u0027,\r\n shallowEqual: false,\r\n value1: new Date(\u00272017-06-16T21:36:48.362Z\u0027),\r\n value2: \u00272017-06-16T21:36:48.362Z\u0027,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027date and object are not equal\u0027,\r\n shallowEqual: false,\r\n value1: new Date(\u00272017-06-16T21:36:48.362Z\u0027),\r\n value2: {},\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027invalid dates are equal\u0027,\r\n shallowEqual: true,\r\n value1: new Date(\u0027foo\u0027),\r\n value2: new Date(\u0027bar\u0027),\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027regexps\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027equal RegExp objects\u0027,\r\n shallowEqual: true,\r\n value1: /foo/,\r\n value2: /foo/,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal RegExp objects (different pattern)\u0027,\r\n shallowEqual: false,\r\n value1: /foo/,\r\n value2: /bar/,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal RegExp objects (different flags)\u0027,\r\n shallowEqual: false,\r\n value1: /foo/g,\r\n value2: /foo/i,\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027equal RegExp objects (different flags \u0022order\u0022)\u0027,\r\n shallowEqual: true,\r\n value1: new RegExp(\u0027foo\u0027, \u0027gi\u0027),\r\n value2: new RegExp(\u0027foo\u0027, \u0027ig\u0027),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027RegExp and string are not equal\u0027,\r\n shallowEqual: false,\r\n value1: /foo/,\r\n value2: \u0027foo\u0027,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027RegExp and object are not equal\u0027,\r\n shallowEqual: false,\r\n value1: /foo/,\r\n value2: {},\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027maps\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027equal Map objects\u0027,\r\n shallowEqual: true,\r\n value1: new Map().set(\u0027foo\u0027, \u0027bar\u0027),\r\n value2: new Map().set(\u0027foo\u0027, \u0027bar\u0027),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal Map objects (different value)\u0027,\r\n shallowEqual: false,\r\n value1: new Map().set(\u0027foo\u0027, \u0027bar\u0027),\r\n value2: new Map().set(\u0027foo\u0027, \u0027baz\u0027),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal Map objects (different key)\u0027,\r\n shallowEqual: false,\r\n value1: new Map().set(\u0027foo\u0027, \u0027bar\u0027),\r\n value2: new Map().set(\u0027baz\u0027, \u0027bar\u0027),\r\n },\r\n {\r\n deepEqual: false,\r\n description:\r\n \u0027not equal Map objects (same keys / values, different pairings)\u0027,\r\n shallowEqual: false,\r\n value1: new Map().set(\u0027foo\u0027, \u0027bar\u0027),\r\n value2: new Map().set(\u0027bar\u0027, \u0027foo\u0027),\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027deep equal Map objects\u0027,\r\n shallowEqual: false,\r\n value1: new Map().set(\u0027foo\u0027, new Map().set(\u0027bar\u0027, \u0027baz\u0027)),\r\n value2: new Map().set(\u0027foo\u0027, new Map().set(\u0027bar\u0027, \u0027baz\u0027)),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027Map and object are not equal\u0027,\r\n shallowEqual: false,\r\n value1: new Map().set(\u0027foo\u0027, \u0027bar\u0027),\r\n value2: { foo: \u0027bar\u0027 },\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027Map and Set are not equal\u0027,\r\n shallowEqual: false,\r\n value1: new Map().set(\u0027foo\u0027, \u0027foo\u0027),\r\n value2: new Set().add(\u0027foo\u0027),\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027sets\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027equal Set objects\u0027,\r\n shallowEqual: true,\r\n value1: new Set().add(\u0027foo\u0027),\r\n value2: new Set().add(\u0027foo\u0027),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027not equal Set objects (different value)\u0027,\r\n shallowEqual: false,\r\n value1: new Set().add(\u0027foo\u0027),\r\n value2: new Set().add(\u0027bar\u0027),\r\n },\r\n {\r\n deepEqual: true,\r\n description: \u0027deep equal Set objects\u0027,\r\n shallowEqual: false,\r\n value1: new Set().add({ foo: \u0027bar\u0027 }),\r\n value2: new Set().add({ foo: \u0027bar\u0027 }),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027Set and array are not equal\u0027,\r\n shallowEqual: false,\r\n value1: new Set().add(\u0027foo\u0027),\r\n value2: [\u0027foo\u0027],\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027promises\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027promises are equal when strictly equal\u0027,\r\n shallowEqual: true,\r\n value1: promise,\r\n value2: promise,\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027promises are not equal when not strictly equal\u0027,\r\n shallowEqual: false,\r\n value1: promise,\r\n value2: Promise.resolve(\u0027foo\u0027),\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027react\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027simple react elements are deeply equal\u0027,\r\n shallowEqual: false,\r\n value1: React.createElement(\u0027div\u0027, {}, \u0027foo\u0027),\r\n value2: React.createElement(\u0027div\u0027, {}, \u0027foo\u0027),\r\n },\r\n {\r\n deepEqual: false,\r\n description: \u0027simple react elements are not deeply equal\u0027,\r\n shallowEqual: false,\r\n value1: React.createElement(\u0027div\u0027, {}, \u0027foo\u0027),\r\n value2: React.createElement(\u0027div\u0027, {}, \u0027bar\u0027),\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027mixed objects equal\u0027,\r\n tests: [\r\n {\r\n deepEqual: true,\r\n description: \u0027big object\u0027,\r\n shallowEqual: false,\r\n value1: {\r\n prop1: \u0027value1\u0027,\r\n prop2: fn,\r\n prop3: null,\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 {\r\n prop: 2,\r\n prop2: 1,\r\n },\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 prop7: /foo/,\r\n },\r\n value2: {\r\n prop1: \u0027value1\u0027,\r\n prop2: fn,\r\n prop3: null,\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 {\r\n prop: 2,\r\n prop2: 1,\r\n },\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 prop7: /foo/,\r\n },\r\n },\r\n ],\r\n },\r\n {\r\n description: \u0027mixed objects not equal\u0027,\r\n tests: [\r\n {\r\n deepEqual: false,\r\n description: \u0027big object\u0027,\r\n shallowEqual: false,\r\n value1: {\r\n prop1: \u0027value1\u0027,\r\n prop2: fn,\r\n prop3: null,\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 {\r\n prop: 2,\r\n prop2: 1,\r\n },\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 prop7: /foo/,\r\n },\r\n value2: {\r\n prop1: \u0027value1\u0027,\r\n prop2: fn,\r\n prop3: null,\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 {\r\n prop: 2,\r\n prop2: 1,\r\n },\r\n 4,\r\n 5,\r\n ],\r\n },\r\n },\r\n prop5: 1000,\r\n prop6: new Date(\u00272017/04/17\u0027),\r\n prop7: /foo/,\r\n },\r\n },\r\n ],\r\n },\r\n];\r\n\r\n\r\n\r\n\r\nfunction runTests(equalFunc) {\r\n for (const testSuite of tests) {\r\n for (const test of testSuite.tests) {\r\n if (test.description != \u0027pseudo array and equivalent array are not equal\u0027)\r\n equalFunc(test.value1, test.value2);\r\n }\r\n }\r\n}","TestCases":[{"Name":"JSON.stringify","Code":"runTests(function(a, b) {JSON.stringify(a) === JSON.stringify(b)})","IsDeferred":false},{"Name":"lodash.isEqual","Code":"runTests(_.isEqual)","IsDeferred":false},{"Name":"fast-deep-equal","Code":"runTests(fastDeepEqual)","IsDeferred":false},{"Name":"fast-equals","Code":"runTests(window[\u0022fast-equals\u0022].deepEqual)","IsDeferred":false}]}