Comparing version 1.5.1 to 1.5.2
@@ -5,4 +5,4 @@ if (!typeof Promise !== 'function') { | ||
module.exports = (s, _maxsize) => | ||
new Promise((resolve, reject) => { | ||
module.exports = function(s, _maxsize) { | ||
return new Promise(function (resolve, reject) { | ||
if (Buffer.isBuffer(s) || Array.isArray(s) || typeof s === 'string') { | ||
@@ -15,3 +15,3 @@ return resolve(Buffer.from(s)); | ||
var size = 0; | ||
s.on('data', d => { | ||
s.on('data', function (d) { | ||
bufs.push(d); | ||
@@ -37,1 +37,2 @@ size += d.length; | ||
}); | ||
}; |
{ | ||
"name": "as-buffer", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "stream or anything to buffer as a Promise", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
2456