Use spread operator
This commit is contained in:
@@ -20,11 +20,7 @@ module.exports = function cleanUpQueryParamsMiddleware (customQueryParams = [])
|
||||
}
|
||||
|
||||
return function cleanUpQueryParams (req, res, next) {
|
||||
var allowedQueryParams = REQUEST_QUERY_PARAMS_WHITELIST;
|
||||
|
||||
if (Array.isArray(customQueryParams)) {
|
||||
allowedQueryParams = allowedQueryParams.concat(customQueryParams);
|
||||
}
|
||||
const allowedQueryParams = [...REQUEST_QUERY_PARAMS_WHITELIST, ...customQueryParams];
|
||||
|
||||
req.query = _.pick(req.query, allowedQueryParams);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user