deep-equal-ext
v1.0.0
Published
Extend deep-equal to compare more values like function, regexp, getter, setter etc.
Downloads
21
Readme
deep-equal-ext
Extends node-deep-equal
to support comparing these values:
- Function
- RegExp
- Getter
- Setter
Note that above values are compared by calling toString()
and matching strings.
How To Use
npm i --save deep-equal-ext
import deepEqualExt from 'deep-equal-ext'
const objectA = {
reg: /\w+/,
func: function(a, b) { return a + b },
obj: { a : [ 2, 3 ], b : [ 4 ] },
get x() {
return this.mX
},
set x(v) {
this.mX = v
}
}
const objectB = {
reg: /\w+/,
func: function(a, b) { return a + b },
obj: { a : [ 2, 3 ], b : [ 4 ] },
get x() {
return this.mX
},
set x(v) {
this.mX = v
}
}
deepEqualExt(objectA, objectB) // true