GT2/GT2-iOS/node_modules/superagent/lib/node/parsers/image.js

13 lines
227 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
'use strict';
module.exports = (res, fn) => {
const data = []; // Binary data needs binary storage
res.on('data', chunk => {
data.push(chunk);
});
res.on('end', () => {
fn(null, Buffer.concat(data));
});
};