Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xotic750/deep-equal-x
node's assert.deepEqual algorithm.
https://github.com/xotic750/deep-equal-x
browser deep-equals ecmascript nodejs
Last synced: about 1 month ago
JSON representation
node's assert.deepEqual algorithm.
- Host: GitHub
- URL: https://github.com/xotic750/deep-equal-x
- Owner: Xotic750
- License: mit
- Created: 2015-11-23T12:37:57.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:44:02.000Z (almost 2 years ago)
- Last Synced: 2024-04-28T06:48:18.733Z (8 months ago)
- Topics: browser, deep-equals, ecmascript, nodejs
- Language: JavaScript
- Size: 3.41 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## deep-equal-x
node's deepEqual and deepStrictEqual algorithm.
### `module.exports(actual, expected, [strict])` ⇒
boolean
⏏Tests for deep equality. Primitive values are compared with the equal
comparison operator ( == ). This only considers enumerable properties.
It does not test object prototypes, attached symbols, or non-enumerable
properties. This can lead to some potentially surprising results. If
`strict` is `true` then Primitive values are compared with the strict
equal comparison operator ( === ).**Kind**: Exported function
**Returns**:boolean
- `true` if `actual` and `expected` are deemed equal,
otherwise `false`.
**See**: https://nodejs.org/api/assert.html| Param | Type | Description |
| -------- | -------------------- | -------------------------------------------- |
| actual |\*
| First comparison object. |
| expected |\*
| Second comparison object. |
| [strict] |boolean
| Comparison mode. If set to `true` use `===`. |**Example**
```js
import deepEqual from 'deep-equal-x';deepEqual(Error('a'), Error('b'));
// => true
// This does not return `false` because the properties on the Error object
// are non-enumerable:deepEqual(4, '4');
// => truedeepEqual({a: 4, b: '1'}, {b: '1', a: 4});
// => truedeepEqual(new Date(), new Date(2000, 3, 14));
// => falsedeepEqual(4, '4', true);
// => false
```