Skip to content

Commit

Permalink
Create parse_headers.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mqxx authored Oct 15, 2024
1 parent d8dbe9a commit 6a56646
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/http/parse_headers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This function parses a Headers object and returns it as a parsed object.
*
* @param headers Header that should get parsed
* @returns The parsed header
*/
export default function parseHeaders(headers : Headers) : Record<string, string> {
const header : Record<string, string> = {};
for(const [key, value] of headers.entries()) {
header[key] = value;
};
return header;
}

0 comments on commit 6a56646

Please sign in to comment.