MCPcopy
hub / github.com/dougmoscrop/serverless-http / addData

Function addData

lib/response.js:20–26  ·  view source on GitHub ↗
(stream, data)

Source from the content-addressed store, hash-verified

18}
19
20function addData(stream, data) {
21 if (Buffer.isBuffer(data) || typeof data === 'string' || data instanceof Uint8Array) {
22 stream[BODY].push(Buffer.from(data));
23 } else {
24 throw new Error(`response.write() of unexpected type: ${typeof data}`);
25 }
26}
27
28module.exports = class ServerlessResponse extends http.ServerResponse {
29

Callers 1

constructorMethod · 0.85

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected