(body)
| 76 | } |
| 77 | |
| 78 | function convertBodyToStream(body) { |
| 79 | if (common.isStream(body)) { |
| 80 | return body |
| 81 | } |
| 82 | |
| 83 | if (body === undefined) { |
| 84 | return new ReadableBuffers([]) |
| 85 | } |
| 86 | |
| 87 | if (Buffer.isBuffer(body)) { |
| 88 | return new ReadableBuffers([body]) |
| 89 | } |
| 90 | |
| 91 | if (typeof body !== 'string') { |
| 92 | body = JSON.stringify(body) |
| 93 | } |
| 94 | |
| 95 | return new ReadableBuffers([Buffer.from(body)]) |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Play back an interceptor using the given request and mock response. |
no outgoing calls
no test coverage detected
searching dependent graphs…