hapijs / boom

HTTP-friendly error objects
Other
2.94k stars 192 forks source link

Add proper index type to headers property #281

Closed icopp closed 3 years ago

icopp commented 3 years ago

object doesn't allow properly looking up values on headers (for example, headers['Authorization'] will be rejected by Typescript). Using Partial<Record<string, string>> allows this lookup and accounts for potentially undefined headers.