-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
I cannot replicate the issue, because I don't know how to create a null-prototype object.
in nestJs interceptor
let req = context.switchToHttp().getRequest();
console.log(req.query); // Empty <[Object: null prototype] {}>{ x: 1 }
I don't know exactly how req.query is created, may be by Object.create() or by a library like qs or querystring or something else
however, objects like that are not merged, but totally replaces other objects
let query = { y:1 }
merge(query, req.query); // Empty <[Object: null prototype] {}>{ x: 1 }
but this works fine
let query = { y:1 }
merge(query, {...req.query}); // {x: 1, y: 1}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels