(obj: Record<string, unknown>, key: string)
| 366 | } |
| 367 | |
| 368 | function pickNonEmptyString(obj: Record<string, unknown>, key: string): string | undefined { |
| 369 | const v = obj[key]; |
| 370 | return typeof v === "string" && v.length > 0 ? v : undefined; |
| 371 | } |
| 372 | |
| 373 | /** Like `pickNonEmptyString` but rejects values containing control chars. */ |
| 374 | function pickHeaderSafeString(obj: Record<string, unknown>, key: string): string | undefined { |
no outgoing calls
no test coverage detected