URL filter functionality.
This commit is contained in:
1 parent
6bc371352c
commit
4fded49b03
27 files changed
+251
-117
No files matched your search
+15
@@ -13,3 +13,18 @@ export function getDomainName(str) {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
export function getQueryString(params) {
|
||||
const map = Object.keys(params).reduce((arr, key) => {
|
||||
if (params[key] !== undefined) {
|
||||
return arr.concat(`${key}=${encodeURIComponent(params[key])}`);
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
|
||||
if (map.length) {
|
||||
return `?${map.join('&')}`;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
Reference in new issue
Block a user