Comparing version 1.1.5 to 1.1.6
@@ -71,3 +71,3 @@ 'use strict' | ||
return this[READ](n, this.buffer.head.value) | ||
return this[READ](n || null, this.buffer.head.value) | ||
} finally { | ||
@@ -81,3 +81,3 @@ this[MAYBE_EMIT_END]() | ||
return null | ||
else if (n === chunk.length) | ||
else if (n === chunk.length || n === null) | ||
this.buffer.pop() | ||
@@ -84,0 +84,0 @@ else { |
{ | ||
"name": "minipass", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "minimal implementation of a PassThrough stream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -106,2 +106,12 @@ const MiniPass = require('../') | ||
t.test('read with no args', async t => { | ||
const butterfly = '🦋' | ||
const mp = new MiniPass({ encoding: 'utf8' }) | ||
mp.on('data', c => t.equal(c, butterfly)) | ||
mp.pause() | ||
mp.write(new Buffer(butterfly)) | ||
t.same(mp.read(), new Buffer(butterfly)) | ||
t.equal(mp.read(), null) | ||
}) | ||
t.test('partial read', async t => { | ||
@@ -108,0 +118,0 @@ const butterfly = '🦋' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138475
849