(stream, data)
| 20 | } |
| 21 | |
| 22 | function addData (stream, data) { |
| 23 | if (Buffer.isBuffer(data) || typeof data === 'string' || data instanceof Uint8Array) { |
| 24 | stream[BODY].push(Buffer.from(data)) |
| 25 | } else { |
| 26 | throw new Error(`response.write() of unexpected type: ${typeof data}`) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | module.exports = class ServerlessResponse extends http.ServerResponse { |
| 31 | static from (res) { |
no test coverage detected
searching dependent graphs…