Comparing version 2.18.0 to 2.19.0
@@ -1113,5 +1113,7 @@ const { EventEmitter } = require('events') | ||
function getStreamError (stream) { | ||
function getStreamError (stream, opts = {}) { | ||
const err = (stream._readableState && stream._readableState.error) || (stream._writableState && stream._writableState.error) | ||
return err === STREAM_DESTROYED ? null : err // only explicit errors | ||
// avoid implicit errors by default | ||
return (!opts.all && err === STREAM_DESTROYED) ? null : err | ||
} | ||
@@ -1118,0 +1120,0 @@ |
{ | ||
"name": "streamx", | ||
"version": "2.18.0", | ||
"version": "2.19.0", | ||
"description": "An iteration of the Node.js core streams with a series of improvements", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -462,2 +462,12 @@ # streamx | ||
## Helpers | ||
#### `bool = isStream(stream)` | ||
#### `bool = isStreamx(stream)` | ||
#### `err = getStreamError(stream, [options])` | ||
Returns `null` if the stream has no errors. | ||
## Utilities | ||
@@ -464,0 +474,0 @@ |
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
50455
938
490