MCPcopy
hub / github.com/axios/axios / collect

Function collect

tests/unit/helpers/formDataToStream.test.js:29–35  ·  tests/unit/helpers/formDataToStream.test.js::collect
(stream)

Source from the content-addressed store, hash-verified

27});
28
29const collect = async (stream) => {
30 const chunks = [];
31 for await (const chunk of stream) {
32 chunks.push(Buffer.from(chunk));
33 }
34 return Buffer.concat(chunks).toString(class="st">'utf8');
35};
36
37describe(class="st">'formDataToStream', () => {
38 it(class="st">'should strip CRLF sequences from blob.type to prevent multipart header injection', async () => {

Callers 1

Calls 3

toStringMethod · 0.80
concatMethod · 0.80
fromMethod · 0.45

Tested by

no test coverage detected