You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.4 KiB

  1. deep-is
  2. ==========
  3. Node's `assert.deepEqual() algorithm` as a standalone module. Exactly like
  4. [deep-equal](https://github.com/substack/node-deep-equal) except for the fact that `deepEqual(NaN, NaN) === true`.
  5. This module is around [5 times faster](https://gist.github.com/2790507)
  6. than wrapping `assert.deepEqual()` in a `try/catch`.
  7. [![browser support](http://ci.testling.com/thlorenz/deep-is.png)](http://ci.testling.com/thlorenz/deep-is)
  8. [![build status](https://secure.travis-ci.org/thlorenz/deep-is.png)](http://travis-ci.org/thlorenz/deep-is)
  9. example
  10. =======
  11. ``` js
  12. var equal = require('deep-is');
  13. console.dir([
  14. equal(
  15. { a : [ 2, 3 ], b : [ 4 ] },
  16. { a : [ 2, 3 ], b : [ 4 ] }
  17. ),
  18. equal(
  19. { x : 5, y : [6] },
  20. { x : 5, y : 6 }
  21. )
  22. ]);
  23. ```
  24. methods
  25. =======
  26. var deepIs = require('deep-is')
  27. deepIs(a, b)
  28. ---------------
  29. Compare objects `a` and `b`, returning whether they are equal according to a
  30. recursive equality algorithm.
  31. install
  32. =======
  33. With [npm](http://npmjs.org) do:
  34. ```
  35. npm install deep-is
  36. ```
  37. test
  38. ====
  39. With [npm](http://npmjs.org) do:
  40. ```
  41. npm test
  42. ```
  43. license
  44. =======
  45. Copyright (c) 2012, 2013 Thorsten Lorenz <thlorenz@gmx.de>
  46. Copyright (c) 2012 James Halliday <mail@substack.net>
  47. Derived largely from node's assert module, which has the copyright statement:
  48. Copyright (c) 2009 Thomas Robinson <280north.com>
  49. Released under the MIT license, see LICENSE for details.