(type?: string)
| 311 | } |
| 312 | |
| 313 | export function ensureTransport(type?: string): 'stdio' | 'sse' | 'http' { |
| 314 | if (!type) return 'stdio' |
| 315 | |
| 316 | if (type !== 'stdio' && type !== 'sse' && type !== 'http') { |
| 317 | throw new Error( |
| 318 | `Invalid transport type: ${type}. Must be one of: stdio, sse, http`, |
| 319 | ) |
| 320 | } |
| 321 | |
| 322 | return type as 'stdio' | 'sse' | 'http' |
| 323 | } |
| 324 | |
| 325 | export function parseHeaders(headerArray: string[]): Record<string, string> { |
| 326 | const headers: Record<string, string> = {} |
no outgoing calls
no test coverage detected