Comparing version 2.21.0 to 2.21.1
17
index.js
@@ -101,2 +101,3 @@ const { EventEmitter } = require('events') | ||
const READ_UPDATE_SYNC_STATUS = READ_UPDATING | OPEN_STATUS | READ_NEXT_TICK | READ_PRIMARY | ||
const READ_NEXT_TICK_OR_OPENING = READ_NEXT_TICK | OPENING | ||
@@ -116,4 +117,2 @@ // Combined write state | ||
const DISTURBED_STATUS = OPEN_STATUS | READ_RESUMED_READ_AHEAD | WRITE_QUEUED | ||
const asyncIterator = Symbol.asyncIterator || Symbol('asyncIterator') | ||
@@ -424,2 +423,8 @@ | ||
updateNextTickIfOpen () { | ||
if ((this.stream._duplexState & READ_NEXT_TICK_OR_OPENING) !== 0) return | ||
this.stream._duplexState |= READ_NEXT_TICK | ||
if ((this.stream._duplexState & READ_UPDATING) === 0) queueTick(this.afterUpdateNextTick) | ||
} | ||
updateNextTick () { | ||
@@ -736,3 +741,3 @@ if ((this.stream._duplexState & READ_NEXT_TICK) !== 0) return | ||
push (data) { | ||
this._readableState.updateNextTick() | ||
this._readableState.updateNextTickIfOpen() | ||
return this._readableState.push(data) | ||
@@ -742,3 +747,3 @@ } | ||
unshift (data) { | ||
this._readableState.updateNextTick() | ||
this._readableState.updateNextTickIfOpen() | ||
return this._readableState.unshift(data) | ||
@@ -1145,3 +1150,3 @@ } | ||
function isDisturbed (stream) { | ||
return (stream._duplexState & DISTURBED_STATUS) !== OPENING | ||
return (stream._duplexState & OPENING) !== OPENING || (stream._duplexState & ACTIVE_OR_TICKING) !== 0 | ||
} | ||
@@ -1172,5 +1177,5 @@ | ||
isStreamx, | ||
isDisturbed, | ||
isEnded, | ||
isFinished, | ||
isDisturbed, | ||
getStreamError, | ||
@@ -1177,0 +1182,0 @@ Stream, |
{ | ||
"name": "streamx", | ||
"version": "2.21.0", | ||
"version": "2.21.1", | ||
"description": "An iteration of the Node.js core streams with a series of improvements", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
51397
961