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}
I cannot replicate the issue, because I don't know how to create a null-prototype object.
in nestJs interceptor
I don't know exactly how req.query is created, may be by
Object.create()or by a library likeqsorquerystringor something elsehowever, objects like that are not merged, but totally replaces other objects
but this works fine