You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I had a hard time debugging when trying to find out why a library I use doesn't work as expected.
The base root cause is by this library which checks if an object is a base-object.
It tries to do so by checking the prototype of new Object().
As I found out today, the prototype of a new object is not always the same. This becomes evident when running your code in a NodeJS vm.
Please find a way to check for plain objects without using the constructor or note at a place that this package is not stable when using in more than one NodeJS contexts.
The text was updated successfully, but these errors were encountered:
Any suggestions? A lot of trial and error went into getting the proper logic in isBasicObject a long time ago. So I'm hesitant to change it, but if there's some solution to this problem that's been documented elsewhere and all tests still pass, it's worth trying to support this use case.
Today I had a hard time debugging when trying to find out why a library I use doesn't work as expected.
The base root cause is by this library which checks if an object is a base-object.
It tries to do so by checking the prototype of
new Object()
.As I found out today, the prototype of a new object is not always the same. This becomes evident when running your code in a NodeJS
vm
.The code produces the following output:
Please find a way to check for plain objects without using the constructor or note at a place that this package is not stable when using in more than one NodeJS contexts.
The text was updated successfully, but these errors were encountered: