source: trip-planner-front/node_modules/deep-equal/readme.markdown@ ceaed42

Last change on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1# deep-equal
2
3Node's `assert.deepEqual() algorithm` as a standalone module.
4
5This module is around [5 times faster](https://gist.github.com/2790507)
6than wrapping `assert.deepEqual()` in a `try/catch`.
7
8[![browser support](https://ci.testling.com/substack/node-deep-equal.png)](https://ci.testling.com/substack/node-deep-equal)
9
10[![build status](https://secure.travis-ci.org/substack/node-deep-equal.png)](https://travis-ci.org/substack/node-deep-equal)
11
12# example
13
14``` js
15var equal = require('deep-equal');
16console.dir([
17 equal(
18 { a : [ 2, 3 ], b : [ 4 ] },
19 { a : [ 2, 3 ], b : [ 4 ] }
20 ),
21 equal(
22 { x : 5, y : [6] },
23 { x : 5, y : 6 }
24 )
25]);
26```
27
28# methods
29
30``` js
31var deepEqual = require('deep-equal')
32```
33
34## deepEqual(a, b, opts)
35
36Compare objects `a` and `b`, returning whether they are equal according to a
37recursive equality algorithm.
38
39If `opts.strict` is `true`, use strict equality (`===`) to compare leaf nodes.
40The default is to use coercive equality (`==`) because that's how
41`assert.deepEqual()` works by default.
42
43# install
44
45With [npm](http://npmjs.org) do:
46
47```
48npm install deep-equal
49```
50
51# test
52
53With [npm](http://npmjs.org) do:
54
55```
56npm test
57```
Note: See TracBrowser for help on using the repository browser.