1.0.0 • Published 6 years ago

deep-equal-ext v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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