siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
1 lines • 4.16 kB
JavaScript
Ext.data.JsonP.Siesta_Util_Role_CanCompareObjects({"tagname":"class","name":"Siesta.Util.Role.CanCompareObjects","autodetected":{},"files":[{"filename":"CanCompareObjects.js","href":"CanCompareObjects.html#Siesta-Util-Role-CanCompareObjects"}],"members":[{"name":"compareObjects","tagname":"method","owner":"Siesta.Util.Role.CanCompareObjects","id":"method-compareObjects","meta":{}}],"alternateClassNames":[],"aliases":{},"id":"class-Siesta.Util.Role.CanCompareObjects","component":false,"superclasses":[],"subclasses":[],"mixedInto":["Siesta.Test"],"mixins":[],"parentMixins":[],"requires":[],"uses":[],"html":"<div><pre class=\"hierarchy\"><h4>Mixed into</h4><div class='dependency'><a href='#!/api/Siesta.Test' rel='Siesta.Test' class='docClass'>Siesta.Test</a></div><h4>Files</h4><div class='dependency'><a href='source/CanCompareObjects.html#Siesta-Util-Role-CanCompareObjects' target='_blank'>CanCompareObjects.js</a></div></pre><div class='doc-contents'><p>A mixin, providing the \"compareObjects\" method.</p>\n</div><div class='members'><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-method'>Methods</h3><div class='subsection'><div id='method-compareObjects' class='member first-child not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='Siesta.Util.Role.CanCompareObjects'>Siesta.Util.Role.CanCompareObjects</span><br/><a href='source/CanCompareObjects.html#Siesta-Util-Role-CanCompareObjects-method-compareObjects' target='_blank' class='view-source'>view source</a></div><a href='#!/api/Siesta.Util.Role.CanCompareObjects-method-compareObjects' class='name expandable'>compareObjects</a>( <span class='pre'>obj1, obj2, strict, onlyPrimitives, asObjects</span> ) : Boolean<span class=\"signature\"></span></div><div class='description'><div class='short'>This method performs a deep comparison of the passed JavaScript objects. ...</div><div class='long'><p>This method performs a deep comparison of the passed JavaScript objects. Objects must not contain cyclic references.\nSupported objects are: Object, Array, Function, RegExp, Date, Map (the latter only for keys of primitive values - strings, numbers and browser >= MS Edge).\nWhen comparing Maps, the order of insertion does not matter.</p>\n\n<p>You can use this method in your own assertions, since it does not create an actual assertion in the test results,\nbut rather just returns a boolean value with comparison result.</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>obj1</span> : Mixed<div class='sub-desc'><p>The 1st object to compare</p>\n</div></li><li><span class='pre'>obj2</span> : Mixed<div class='sub-desc'><p>The 2nd object to compare</p>\n</div></li><li><span class='pre'>strict</span> : Boolean<div class='sub-desc'><p>When passed the <code>true</code> value, the comparison of the primitive values will be performed with the\n<code>===</code> operator (so [ 1 ] and [ \"1\" ] object will be different). Additionally, when this flag is set to <code>true</code>, then\nwhen comparing Function, RegExp and Date instances, additional check that objects contains the same set of own properties (\"hasOwnProperty\")\nwill be performed.</p>\n</div></li><li><span class='pre'>onlyPrimitives</span> : Boolean<div class='sub-desc'><p>When set to <code>true</code>, the function will not recurse into composite objects (like [] or {}) and will just report that\nobjects are different. Use this mode when you are only interested in comparison of primitive values (numbers, strings, etc).</p>\n</div></li><li><span class='pre'>asObjects</span> : Boolean<div class='sub-desc'><p>When set to <code>true</code>, the function will compare various special Object instances, like Functions, RegExp etc,\nby comparison of their properties only and not taking the anything else into account.</p>\n</div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'>Boolean</span><div class='sub-desc'><p><code>true</code> if the passed objects are equal</p>\n</div></li></ul></div></div></div></div></div></div></div>","meta":{}});