File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 1+ type Keys =
2+ | "accept"
3+ | "accept-encoding"
4+ | "accept-language"
5+ | "connection"
6+ | "host"
7+ | "referer"
8+ | "sec-ch-ua"
9+ | "sec-ch-ua-mobile"
10+ | "sec-ch-ua-platform"
11+ | "sec-fetch-dest"
12+ | "sec-fetch-mode"
13+ | "sec-fetch-site"
14+ | "user-agent"
15+ // deno-lint-ignore ban-types
16+ | ( string & { } )
17+
118/**
219 * This function parses a Headers object and returns it as a parsed object.
320 *
421 * @param headers Header that should get parsed
522 * @returns The parsed header
623 */
7- export default function parseHeaders ( headers : Headers ) : Record < string , string > {
8- const header : Record < string , string > = { } ;
24+ export default function parseHeaders ( headers : Headers ) : Record < Keys , string > {
25+ const header : Record < Keys | string , string > = { } ;
926 for ( const [ key , value ] of headers . entries ( ) ) {
1027 header [ key ] = value ;
1128 } ;
You can’t perform that action at this time.
0 commit comments