1
0
Fork 0
mirror of https://github.com/xHyroM/waki.git synced 2024-11-27 17:01:06 +01:00

perf: dont stringify everytime

This commit is contained in:
Jozef Steinhübl 2024-05-20 13:24:27 +02:00
parent de12eb244f
commit fb60d0880c
No known key found for this signature in database
GPG key ID: E6BC90C91973B08F

View file

@ -38,7 +38,8 @@ export async function parseBody(request: Request): Promise<() => BodyInit> {
if (contentType === "application/json") { if (contentType === "application/json") {
const data = await request.json(); const data = await request.json();
return () => JSON.stringify(data); const stringified = JSON.stringify(data);
return () => stringified;
} }
const text = await request.text(); const text = await request.text();