1 | /**
|
2 | * @deprecated Since v1.32.0. Use [[toSanitizedObject]] instead.
|
3 | * Create a header object based on the given key and value if neither key nor value are nullish.
|
4 | * @param key - Name of the header.
|
5 | * @param value - Value of the header.
|
6 | * @returns - An object containing the given key and value of an empty object.
|
7 | */
|
8 | export declare function toSanitizedHeaderObject(key: string, value: any): Record<string, any>;
|
9 | /**
|
10 | * @deprecated Since v1.32.0. Use [[pickIgnoreCase]] instead.
|
11 | *
|
12 | * Find a header in a given header object, if available, independent of the case (lower / upper).
|
13 | * @param key - Name of the header to be found.
|
14 | * @param headers - Header object to be searched for given key.
|
15 | * @returns - An object containing the given key (and value) in its original case, as found in `headers` or an empty object if not found.
|
16 | */
|
17 | export declare function getHeader(key: string, headers?: Record<string, any>): Record<string, any>;
|
18 | /**
|
19 | * @deprecated Since v1.32.0. Use [[pickIgnoreCase]] instead.
|
20 | *
|
21 | * Find headers in a given header object, if available, independent of the case (lower / upper).
|
22 | * @param keys - Name of the header to be found.
|
23 | * @param headers - Header object to be searched for given key.
|
24 | * @returns - An object containing the given keys (and values) in its original case, as found in `headers` or an empty object if not found.
|
25 | */
|
26 | export declare function getHeaders(keys: string[], headers?: Record<string, any>): Record<string, any>;
|
27 | /**
|
28 | * @deprecated Since v1.32.0. Use [[pickValueIgnoreCase]] instead.
|
29 | *
|
30 | * Get the value of a header based on the given key, independent of the case (lower / upper).
|
31 | * @param key - Name of the header to be found.
|
32 | * @param headers - Header object to be searched for given key.
|
33 | * @returns The value of the header with the given key or `undefined`.
|
34 | */
|
35 | export declare function getHeaderValue(key: string, headers?: Record<string, any>): any | undefined;
|
36 | /**
|
37 | * @deprecated Since v1.32.0. Use [[pickNonNullish]] instead.
|
38 | *
|
39 | * Filter headers that have nullish values.
|
40 | * @param headers - A header object to be filtered.
|
41 | * @returns - A filtered header object containing only headers with non-nullish values.
|
42 | */
|
43 | export declare function filterNullishValues(headers?: Record<string, any>): Record<string, any>;
|
44 | /**
|
45 | * @deprecated Since v1.32.0. Use [[mergeLeftIgnoreCase]] instead.
|
46 | *
|
47 | * Create a header object by replacing headers that are set as custom headers.
|
48 | * @param headers - A base header object that contains the headers that will be compared with `customHeaders`.
|
49 | * @param customHeaders - A header object to be compared with headers. Only headers present in `headers` will be compared.
|
50 | * @returns - An object containing all keys from the original `headers` object, where headers present in the `customHeaders` are replaced. Note that the case (upper / lower) used by `customHeaders` will be used.
|
51 | */
|
52 | export declare function replaceDuplicateKeys(headers?: Record<string, any>, customHeaders?: Record<string, any>): Record<string, any>;
|
53 | /**
|
54 | * @deprecated Since v1.32.0. Use [[mergeIgnoreCase]] instead.
|
55 | *
|
56 | * Create a header object by merging two header objects, where the custom headers take precedence.
|
57 | * @param headers - A base header object that contains the headers that will be compared with `customHeaders`.
|
58 | * @param customHeaders - A header object to be compared with headers. Only headers present in `headers` will be compared.
|
59 | * @returns - An object containing all keys from both the header objects, where headers present in the `customHeaders` are replaced. Note that the case (upper / lower) used by `customHeaders` will be used.
|
60 | */
|
61 | export declare function mergeHeaders(headers?: Record<string, any>, customHeaders?: Record<string, any>): Record<string, any>;
|
62 | //# sourceMappingURL=header-util.d.ts.map |
\ | No newline at end of file |