getMultiValueHeadersMap
@h4ad/serverless-adapter > getMultiValueHeadersMap
(function) getMultiValueHeadersMap
Transforms a header map into a multi-value map header.
Signature:
export declare function getMultiValueHeadersMap(headersMap: BothValueHeaders): Record<string, string[]>;
Parameters
Parameter | Type | Description |
---|---|---|
headersMap | BothValueHeaders | The initial headers |
Returns:
Record<string, string[]>
Example
const headers = \{ 'accept-encoding': 'gzip', 'connection': ['keep-alive'] };
const multiValueHeaders = getMultiValueHeadersMap(headers);
console.log(multiValueHeaders);
// \{ 'accept-encoding': ['gzip'], 'connection': ['keep-alive'] }