(headers: unknown, hasBody: boolean)
| 100 | } |
| 101 | |
| 102 | function buildHeaders(headers: unknown, hasBody: boolean): Record<string, string> { |
| 103 | const output: Record<string, string> = {} |
| 104 | |
| 105 | if (hasBody) { |
| 106 | output['Content-Type'] = 'application/json' |
| 107 | } |
| 108 | |
| 109 | if (headers && typeof headers === 'object') { |
| 110 | for (const [key, value] of Object.entries(headers as Record<string, unknown>)) { |
| 111 | if (typeof value === 'string') output[key] = value |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | return output |
| 116 | } |
| 117 | |
| 118 | function parseOptionalSchema<S extends ApiSchema | undefined>( |
| 119 | schema: S, |
no outgoing calls
no test coverage detected