From 08b74ec61bf9ea2cac816f9fa855b104263a3918 Mon Sep 17 00:00:00 2001 From: Flummi Date: Tue, 18 Mar 2025 11:36:17 +0100 Subject: [PATCH] refactor: update json return type to JSON and format function parameters --- src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index c9ccae6..9a76b2a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ type ResponseData = { body: http.IncomingMessage; headers: http.IncomingHttpHeaders; text: () => Promise; - json: () => Promise; + json: () => Promise; buffer: () => Promise; arrayBuffer: () => Promise; }; @@ -43,7 +43,10 @@ const readData = ( .on("error", reject); }); -export default async (urlString: string, options: ExtendedRequestOptions = {}): Promise => { +export default async ( + urlString: string, + options: ExtendedRequestOptions = {} +): Promise => { const { protocol, hostname, pathname, search, port } = new URL(urlString); const body =