1 | <a
|
2 | href="https://travis-ci.org/Xotic750/deep-equal-x"
|
3 | title="Travis status">
|
4 | <img
|
5 | src="https://travis-ci.org/Xotic750/deep-equal-x.svg?branch=master"
|
6 | alt="Travis status" height="18">
|
7 | </a>
|
8 | <a
|
9 | href="https://david-dm.org/Xotic750/deep-equal-x"
|
10 | title="Dependency status">
|
11 | <img src="https://david-dm.org/Xotic750/deep-equal-x/status.svg"
|
12 | alt="Dependency status" height="18"/>
|
13 | </a>
|
14 | <a
|
15 | href="https://david-dm.org/Xotic750/deep-equal-x?type=dev"
|
16 | title="devDependency status">
|
17 | <img src="https://david-dm.org/Xotic750/deep-equal-x/dev-status.svg"
|
18 | alt="devDependency status" height="18"/>
|
19 | </a>
|
20 | <a
|
21 | href="https://badge.fury.io/js/deep-equal-x"
|
22 | title="npm version">
|
23 | <img src="https://badge.fury.io/js/deep-equal-x.svg"
|
24 | alt="npm version" height="18">
|
25 | </a>
|
26 | <a
|
27 | href="https://www.jsdelivr.com/package/npm/deep-equal-x"
|
28 | title="jsDelivr hits">
|
29 | <img src="https://data.jsdelivr.com/v1/package/npm/deep-equal-x/badge?style=rounded"
|
30 | alt="jsDelivr hits" height="18">
|
31 | </a>
|
32 | <a
|
33 | href="https://bettercodehub.com/results/Xotic750/deep-equal-x"
|
34 | title="bettercodehub score">
|
35 | <img src="https://bettercodehub.com/edge/badge/Xotic750/deep-equal-x?branch=master"
|
36 | alt="bettercodehub score" height="18">
|
37 | </a>
|
38 | <a
|
39 | href="https://coveralls.io/github/Xotic750/deep-equal-x?branch=master"
|
40 | title="Coverage Status">
|
41 | <img src="https://coveralls.io/repos/github/Xotic750/deep-equal-x/badge.svg?branch=master"
|
42 | alt="Coverage Status" height="18">
|
43 | </a>
|
44 |
|
45 | <a name="module_deep-equal-x"></a>
|
46 |
|
47 | ## deep-equal-x
|
48 |
|
49 | node's deepEqual and deepStrictEqual algorithm.
|
50 |
|
51 | <a name="exp_module_deep-equal-x--module.exports"></a>
|
52 |
|
53 | ### `module.exports(actual, expected, [strict])` ⇒ <code>boolean</code> ⏏
|
54 |
|
55 | Tests for deep equality. Primitive values are compared with the equal
|
56 | comparison operator ( == ). This only considers enumerable properties.
|
57 | It does not test object prototypes, attached symbols, or non-enumerable
|
58 | properties. This can lead to some potentially surprising results. If
|
59 | `strict` is `true` then Primitive values are compared with the strict
|
60 | equal comparison operator ( === ).
|
61 |
|
62 | **Kind**: Exported function
|
63 | **Returns**: <code>boolean</code> - `true` if `actual` and `expected` are deemed equal,
|
64 | otherwise `false`.
|
65 | **See**: https://nodejs.org/api/assert.html
|
66 |
|
67 | | Param | Type | Description |
|
68 | | -------- | -------------------- | -------------------------------------------- |
|
69 | | actual | <code>\*</code> | First comparison object. |
|
70 | | expected | <code>\*</code> | Second comparison object. |
|
71 | | [strict] | <code>boolean</code> | Comparison mode. If set to `true` use `===`. |
|
72 |
|
73 | **Example**
|
74 |
|
75 | ```js
|
76 | import deepEqual from 'deep-equal-x';
|
77 |
|
78 | deepEqual(Error('a'), Error('b'));
|
79 | // => true
|
80 | // This does not return `false` because the properties on the Error object
|
81 | // are non-enumerable:
|
82 |
|
83 | deepEqual(4, '4');
|
84 | // => true
|
85 |
|
86 | deepEqual({a: 4, b: '1'}, {b: '1', a: 4});
|
87 | // => true
|
88 |
|
89 | deepEqual(new Date(), new Date(2000, 3, 14));
|
90 | // => false
|
91 |
|
92 | deepEqual(4, '4', true);
|
93 | // => false
|
94 | ```
|