@ljharb/through
Advanced tools
Comparing version 2.3.9 to 2.3.10
@@ -8,2 +8,9 @@ # Changelog | ||
## [v2.3.10](https://github.com/ljharb/through/compare/v2.3.9...v2.3.10) - 2023-10-10 | ||
### Commits | ||
- [Robustness] use `call-bind` [`3fc8de1`](https://github.com/ljharb/through/commit/3fc8de1dd6b5c69ebca1b212d4852ca11e853cb2) | ||
- [Dev Deps] update `aud`, `tape` [`db14fcf`](https://github.com/ljharb/through/commit/db14fcf1457d1e35b22856de42767d0bf4773fd8) | ||
## [v2.3.9](https://github.com/ljharb/through/compare/v2.3.8...v2.3.9) - 2023-07-17 | ||
@@ -10,0 +17,0 @@ |
'use strict'; | ||
var Stream = require('stream').Stream; | ||
var callBind = require('call-bind'); | ||
@@ -8,4 +9,4 @@ // create a readable writable stream. | ||
function through(write, end, opts) { | ||
write = write || function (data) { this.queue(data); }; | ||
end = end || function () { this.queue(null); }; | ||
var writeBound = callBind(write || function (data) { this.queue(data); }); | ||
var endBound = callBind(end || function () { this.queue(null); }); | ||
@@ -25,3 +26,3 @@ var ended = false; | ||
stream.write = function (data) { | ||
write.call(this, data); | ||
writeBound(this, data); | ||
return !stream.paused; | ||
@@ -67,3 +68,3 @@ }; | ||
stream.writable = false; | ||
end.call(stream); | ||
endBound(stream); | ||
if (!stream.readable && stream.autoDestroy) { stream.destroy(); } | ||
@@ -70,0 +71,0 @@ } |
{ | ||
"name": "@ljharb/through", | ||
"version": "2.3.9", | ||
"version": "2.3.10", | ||
"description": "simplified stream construction", | ||
@@ -20,3 +20,3 @@ "main": "index.js", | ||
"@ljharb/eslint-config": "^21.1.0", | ||
"aud": "^2.0.2", | ||
"aud": "^2.0.3", | ||
"auto-changelog": "^2.4.0", | ||
@@ -30,3 +30,3 @@ "eslint": "=8.8.0", | ||
"stream-spec": "^0.3.6", | ||
"tape": "^5.6.5" | ||
"tape": "^5.7.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "keywords": [ |
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
26632
347