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
+
1
18
/**
2
19
* This function parses a Headers object and returns it as a parsed object.
3
20
*
4
21
* @param headers Header that should get parsed
5
22
* @returns The parsed header
6
23
*/
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 > = { } ;
9
26
for ( const [ key , value ] of headers . entries ( ) ) {
10
27
header [ key ] = value ;
11
28
} ;
You can’t perform that action at this time.
0 commit comments