Get rid of lots of unnecessary lodash calls.

This commit is contained in:
baldo 2022-07-28 13:16:13 +02:00
parent b734a422a7
commit 5592892f0d
16 changed files with 99 additions and 115 deletions
server/utils

View file

@ -1,4 +1,3 @@
import _ from "lodash"
import {config} from "../config"
import {MonitoringToken, Url} from "../types"
@ -12,15 +11,10 @@ function formUrl(route: string, queryParams?: { [key: string]: string }): Url {
}
if (queryParams) {
url += '?';
url += _.join(
_.map(
queryParams,
function (value, key) {
return encodeURIComponent(key) + '=' + encodeURIComponent(value);
}
),
'&'
);
url +=
Object.entries(queryParams)
.map(([key, value]) => encodeURIComponent(key) + '=' + encodeURIComponent(value))
.join("&");
}
return url as Url;
}