-
Notifications
You must be signed in to change notification settings - Fork 122
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
fix: use own object flattening function that supports class objects #402
fix: use own object flattening function that supports class objects #402
Conversation
ac63129
to
41d815b
Compare
85cfa95
to
4eb9a95
Compare
|
||
const { flatten } = require("../../src/utils"); | ||
|
||
if (process.versions.node.split(".")[0] < 14) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is This filter necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really. it's because node 10 and 12 does not have "crypto" lib in their core but I can remove the UUID from the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't have included ObjectId
in the test because I don't wanted to add the mongodb lib as a dependency just for a tiny test.
💡 But I have an idea. I'll create a tiny homemade class that mimics an ObjectId and that will be compatible with all node versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, or you can use Date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
This PR removes the
flat
npm package to replace the flattening function by an homemade one that only flattens plain old javascript objects and let other structures as is.fixes #401