mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
URL filter functionality.
This commit is contained in:
parent
6bc371352c
commit
4fded49b03
27 changed files with 251 additions and 117 deletions
15
lib/url.js
15
lib/url.js
|
|
@ -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 '';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue