Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle objects with null prototype in metadata #220

Merged
merged 3 commits into from
Jul 10, 2023

Conversation

curledUpSheep
Copy link
Contributor

@curledUpSheep curledUpSheep commented Jul 2, 2023

I was facing an issue where winston-mongodb didn't properly remove dots from object keys in metadata. It turns out that these object keys were inside an object with null prototype, which therefore returns false for an instanceof Object check.

Before performing the actual code change, I added a bunch of tests to safeguard the existing functionality.

@curledUpSheep curledUpSheep changed the title Properly handle objects with null prototype Properly handle objects with null prototype in metadata Jul 2, 2023
Copy link
Contributor

@DABH DABH left a comment

Choose a reason for hiding this comment

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

Thank you for the fix, and particularly the extra tests!!

@DABH DABH merged commit 31e2c81 into winstonjs:master Jul 10, 2023
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