theKashey / proxyequal

There is a bit more smart way to compare things, than a shallow equal.
MIT License
72 stars 7 forks source link

Cannot read property 'name' of undefined #23

Closed user753 closed 4 years ago

user753 commented 4 years ago

https://github.com/theKashey/proxyequal/blob/35c3d4998aa52125451442e2232c00d68c43c350/src/shouldInstrument.js#L39 constructor could be undefined, for example

Object.create(null)

In my case graphql package could return such object. Something like

export function shouldInstrument(obj) {
  const name = obj.constructor === undefined && typeof obj === 'object ? 'Object' : constructor.name;
}

should fix it

theKashey commented 4 years ago

👍

theKashey commented 4 years ago

released v2.1.2