util.d.ts 623 B

123456789101112131415161718
  1. export namespace util {
  2. /**
  3. * Retrieves a header name and returns its lowercase value.
  4. * @param value Header name
  5. */
  6. export function headerNameToString(value: string | Buffer): string;
  7. /**
  8. * Receives a header object and returns the parsed value.
  9. * @param headers Header object
  10. * @param obj Object to specify a proxy object. Used to assign parsed values.
  11. * @returns If `obj` is specified, it is equivalent to `obj`.
  12. */
  13. export function parseHeaders(
  14. headers: (Buffer | string | (Buffer | string)[])[],
  15. obj?: Record<string, string | string[]>
  16. ): Record<string, string | string[]>;
  17. }