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
Starting with node8, anonymous decorations are showing in pg responses (you can check it at vitaly-t/pg-promise#165), the problem is you're using a strong check using lodash.isPlainObject, which identifies them as NOT plain objects
Could it be a good idea to replace it with lodash.isObject? It looks correct enough to me and won't force postgres users to do a shallow copy before using NestHydrationJS
Greetings!
Juan Arias
The text was updated successfully, but these errors were encountered:
If this is what I think it is, it's not a Node 8 problem.
I hit this problem a while back, and iirc, node-postgrescreates an object with a prototype for performance and other reasons. The solution in userland is to remove the prototype from these objects before passing them into the library. Though I agree with the change to lodash.isObject to fix the problem.
const nest = nestHydration().nest;
// data is a response from pg-promise
Reflect.setPrototypeOf(data, null);
return nest(data, definition);
Hi there!
Starting with node8, anonymous decorations are showing in pg responses (you can check it at vitaly-t/pg-promise#165), the problem is you're using a strong check using lodash.isPlainObject, which identifies them as NOT plain objects
Could it be a good idea to replace it with lodash.isObject? It looks correct enough to me and won't force postgres users to do a shallow copy before using NestHydrationJS
Greetings!
Juan Arias
The text was updated successfully, but these errors were encountered: