main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[d565449] | 1 | deep-is
|
---|
| 2 | ==========
|
---|
| 3 |
|
---|
| 4 | Node's `assert.deepEqual() algorithm` as a standalone module. Exactly like
|
---|
| 5 | [deep-equal](https://github.com/substack/node-deep-equal) except for the fact that `deepEqual(NaN, NaN) === true`.
|
---|
| 6 |
|
---|
| 7 | This module is around [5 times faster](https://gist.github.com/2790507)
|
---|
| 8 | than wrapping `assert.deepEqual()` in a `try/catch`.
|
---|
| 9 |
|
---|
| 10 | [![browser support](http://ci.testling.com/thlorenz/deep-is.png)](http://ci.testling.com/thlorenz/deep-is)
|
---|
| 11 |
|
---|
| 12 | [![build status](https://secure.travis-ci.org/thlorenz/deep-is.png)](http://travis-ci.org/thlorenz/deep-is)
|
---|
| 13 |
|
---|
| 14 | example
|
---|
| 15 | =======
|
---|
| 16 |
|
---|
| 17 | ``` js
|
---|
| 18 | var equal = require('deep-is');
|
---|
| 19 | console.dir([
|
---|
| 20 | equal(
|
---|
| 21 | { a : [ 2, 3 ], b : [ 4 ] },
|
---|
| 22 | { a : [ 2, 3 ], b : [ 4 ] }
|
---|
| 23 | ),
|
---|
| 24 | equal(
|
---|
| 25 | { x : 5, y : [6] },
|
---|
| 26 | { x : 5, y : 6 }
|
---|
| 27 | )
|
---|
| 28 | ]);
|
---|
| 29 | ```
|
---|
| 30 |
|
---|
| 31 | methods
|
---|
| 32 | =======
|
---|
| 33 |
|
---|
| 34 | var deepIs = require('deep-is')
|
---|
| 35 |
|
---|
| 36 | deepIs(a, b)
|
---|
| 37 | ---------------
|
---|
| 38 |
|
---|
| 39 | Compare objects `a` and `b`, returning whether they are equal according to a
|
---|
| 40 | recursive equality algorithm.
|
---|
| 41 |
|
---|
| 42 | install
|
---|
| 43 | =======
|
---|
| 44 |
|
---|
| 45 | With [npm](http://npmjs.org) do:
|
---|
| 46 |
|
---|
| 47 | ```
|
---|
| 48 | npm install deep-is
|
---|
| 49 | ```
|
---|
| 50 |
|
---|
| 51 | test
|
---|
| 52 | ====
|
---|
| 53 |
|
---|
| 54 | With [npm](http://npmjs.org) do:
|
---|
| 55 |
|
---|
| 56 | ```
|
---|
| 57 | npm test
|
---|
| 58 | ```
|
---|
| 59 |
|
---|
| 60 | license
|
---|
| 61 | =======
|
---|
| 62 |
|
---|
| 63 | Copyright (c) 2012, 2013 Thorsten Lorenz <thlorenz@gmx.de>
|
---|
| 64 | Copyright (c) 2012 James Halliday <mail@substack.net>
|
---|
| 65 |
|
---|
| 66 | Derived largely from node's assert module, which has the copyright statement:
|
---|
| 67 |
|
---|
| 68 | Copyright (c) 2009 Thomas Robinson <280north.com>
|
---|
| 69 |
|
---|
| 70 | Released under the MIT license, see LICENSE for details.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.