const whiteList = ['superparam', 'q', 'search', 'trim'];
const params = new URLSearchParams(search);
const banned: string[] = [];
params.forEach((_, key: string) => {
if (!whiteList.includes(key)) {
banned.push(key);
}
});
banned.forEach((key) => {
params.delete(key);
});
console.log(params.toString());
[...params.keys()].forEach(n => whiteList.includes(n) || params.delete(n));