feat(read-chunk): handle 0 size
This commit is contained in:
parent
538253cdc1
commit
959c955616
@ -1,5 +1,7 @@
|
||||
exports.readChunk = (stream, size) =>
|
||||
new Promise((resolve, reject) => {
|
||||
size === 0
|
||||
? Promise.resolve(Buffer.alloc(0))
|
||||
: new Promise((resolve, reject) => {
|
||||
function onEnd() {
|
||||
resolve(null)
|
||||
removeListeners()
|
||||
|
Loading…
Reference in New Issue
Block a user