Skip to content

Conversation

danbeam
Copy link
Contributor

@danbeam danbeam commented Feb 16, 2024

Addresses #492

I was recently trying to use diff to compare output from a library that makes use of Object.create(null). This seems valid (if not encouraged) in some situations, but diff was throwing as the typeof this is 'object' and it is !== null but obj.hasOwnProperty does not exist.

Instead, use Object.prototype.hasOwnProperty.call(obj, key) similar to the way that Object.prototyope.toString is used elsewhere in this library.

Copy link
Collaborator

@ExplodingCabbage ExplodingCabbage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch; much appreciated!

@ExplodingCabbage ExplodingCabbage merged commit f38e47d into kpdecker:master Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants