File: readme.md

package info (click to toggle)
node-deepmerge 4.3.1%2B~1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 276 kB
  • sloc: javascript: 917; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# is-mergeable-object

<!--js
const isMergeableObject = require('./')
-->

The biggest difficulty deep merge libraries run into is figuring out which properties of an object should be recursively iterated over.

This module contains the algorithm used by [`deepmerge`](https://github.com/KyleAMathews/deepmerge/).

<!--js
const someReactElement = {
	$$typeof: Symbol.for('react.element')
}
-->

```js
isMergeableObject(null) // => false

isMergeableObject({}) // => true

isMergeableObject(new RegExp('wat')) // => false

isMergeableObject(undefined) // => false

isMergeableObject(new Object()) // => true

isMergeableObject(new Date()) // => false

isMergeableObject(someReactElement) // => false
```