(headers: Record<string, string> | undefined)
| 37 | * Creates a Headers object from a record of string key-value pairs, and returns undefined if it fails. |
| 38 | */ |
| 39 | export function createHeadersSafely(headers: Record<string, string> | undefined): Headers | undefined { |
| 40 | try { |
| 41 | return new Headers(headers); |
| 42 | } catch { |
| 43 | // noop |
| 44 | return undefined; |
| 45 | } |
| 46 | } |
no outgoing calls
no test coverage detected