(
response: {
headers?: { get(name: string): string | null }
body?: ReadableStream<Uint8Array> | null
arrayBuffer?: () => Promise<ArrayBuffer>
text?: () => Promise<string>
},
options: ReadResponseWithLimitOptions
)
| 284 | } |
| 285 | |
| 286 | export async function readResponseTextWithLimit( |
| 287 | response: { |
| 288 | headers?: { get(name: string): string | null } |
| 289 | body?: ReadableStream<Uint8Array> | null |
| 290 | arrayBuffer?: () => Promise<ArrayBuffer> |
| 291 | text?: () => Promise<string> |
| 292 | }, |
| 293 | options: ReadResponseWithLimitOptions |
| 294 | ): Promise<string> { |
| 295 | return ( |
| 296 | await readResponseToBufferWithLimit(response, { ...options, preferTextFallback: true }) |
| 297 | ).toString('utf-8') |
| 298 | } |
| 299 | |
| 300 | export async function readResponseJsonWithLimit<T = unknown>( |
| 301 | response: { |
no test coverage detected