Comparing version 2.7.1 to 2.7.2
@@ -727,3 +727,3 @@ const { EventEmitter } = require('events') | ||
return new Promise((resolve, reject) => { | ||
if (stream._duplexState & DESTROYED) return resolve() | ||
if (stream._duplexState & DESTROYED) return resolve({ value: undefined, done: true }) | ||
stream.once('close', function () { | ||
@@ -730,0 +730,0 @@ if (err) reject(err) |
{ | ||
"name": "streamx", | ||
"version": "2.7.1", | ||
"version": "2.7.2", | ||
"description": "An iteration of the Node.js core streams with a series of improvements", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -132,1 +132,18 @@ const tape = require('tape') | ||
}) | ||
tape('cleaning up a closed iterator', async function (t) { | ||
const r = new Readable() | ||
r.push('a') | ||
t.plan(1) | ||
const fn = async () => { | ||
for await (const chunk of r) { | ||
r.destroy() | ||
await new Promise(resolve => r.once('close', resolve)) | ||
t.same(chunk, 'a') | ||
return | ||
} | ||
} | ||
await fn() | ||
t.end() | ||
}) |
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
55678
1470