( map: Map<number, Array<ResponseAlternative>>, status: number, contentType: string, decode: ResponseDecoder )
| 1312 | } |
| 1313 | |
| 1314 | function addResponseAlternative( |
| 1315 | map: Map<number, Array<ResponseAlternative>>, |
| 1316 | status: number, |
| 1317 | contentType: string, |
| 1318 | decode: ResponseDecoder |
| 1319 | ) { |
| 1320 | const normalizedContentType = MediaType.normalize(contentType) |
| 1321 | const alternatives = map.get(status) |
| 1322 | if (alternatives === undefined) { |
| 1323 | map.set(status, [{ contentType: normalizedContentType, decode }]) |
| 1324 | } else { |
| 1325 | alternatives.push({ contentType: normalizedContentType, decode }) |
| 1326 | } |
| 1327 | } |
| 1328 | |
| 1329 | function makeResponseDecoder(alternatives: ReadonlyArray<ResponseAlternative>): ResponseDecoder { |
| 1330 | const first = alternatives[0] |
no test coverage detected