deep-equal-ext

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i deep-equal-ext

Weekly Downloads

9

Version

1.0.0

License

MIT

Last publish

Collaborators

  • swenyang