Get rid of lots of unnecessary lodash calls.
This commit is contained in:
parent
b734a422a7
commit
5592892f0d
16 changed files with 99 additions and 115 deletions
server/utils
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue