Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
26 lines
732 B
Plaintext
26 lines
732 B
Plaintext
# Util
|
|
|
|
Utility API for third-party implementations of the dispatcher API.
|
|
|
|
## `parseHeaders(headers, [obj])`
|
|
|
|
Receives a header object and returns the parsed value.
|
|
|
|
Arguments:
|
|
|
|
- **headers** `(Buffer | string | (Buffer | string)[])[]` (required) - Header object.
|
|
|
|
- **obj** `Record<string, string | string[]>` (optional) - Object to specify a proxy object. The parsed value is assigned to this object. But, if **headers** is an object, it is not used.
|
|
|
|
Returns: `Record<string, string | string[]>` If **obj** is specified, it is equivalent to **obj**.
|
|
|
|
## `headerNameToString(value)`
|
|
|
|
Retrieves a header name and returns its lowercase value.
|
|
|
|
Arguments:
|
|
|
|
- **value** `string | Buffer` (required) - Header name.
|
|
|
|
Returns: `string`
|