mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
perf(rest): use Object.keys() instead
This commit is contained in:
@@ -44,8 +44,13 @@ export async function processQueue(id: string) {
|
||||
// IF THIS IS A GET REQUEST, CHANGE THE BODY TO QUERY PARAMETERS
|
||||
const query =
|
||||
queuedRequest.request.method.toUpperCase() === "GET" && queuedRequest.payload.body
|
||||
? Object.entries(queuedRequest.payload.body)
|
||||
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value as string)}`)
|
||||
? Object.keys(queuedRequest.payload.body)
|
||||
.map(
|
||||
(key) =>
|
||||
`${encodeURIComponent(key)}=${encodeURIComponent(
|
||||
(queuedRequest.payload.body as Record<string, string>)[key]
|
||||
)}`
|
||||
)
|
||||
.join("&")
|
||||
: "";
|
||||
const urlToUse =
|
||||
|
||||
Reference in New Issue
Block a user