* Parses a header string into an array of key-value pair objects. * * The input string is expected to have headers separated by newline characters. * Each non-empty line is processed and converted into an object with `key` and `value` properties. * * @param headerString - The raw head
(headerString: string)
| 118 | * @returns An array of objects, where each object represents a header with `key` and `value` properties. |
| 119 | */ |
| 120 | static parse(headerString: string): { key: string; value: string }[] { |
| 121 | return headerString |
| 122 | .split('\n') |
| 123 | .filter(kvPart => kvPart.trim() !== '') |
| 124 | .map(kvPart => Header.parseSingle(kvPart)); |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Parses a single HTTP header string into an object containing the key and value. |
nothing calls this directly
no test coverage detected