diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/readable-stream/lib/internal | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/readable-stream/lib/internal')
-rw-r--r-- | node_modules/readable-stream/lib/internal/streams/BufferList.js | 13 | ||||
-rw-r--r-- | node_modules/readable-stream/lib/internal/streams/destroy.js | 10 |
2 files changed, 15 insertions, 8 deletions
diff --git a/node_modules/readable-stream/lib/internal/streams/BufferList.js b/node_modules/readable-stream/lib/internal/streams/BufferList.js index d46761597..aefc68bd9 100644 --- a/node_modules/readable-stream/lib/internal/streams/BufferList.js +++ b/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -1,11 +1,9 @@ 'use strict'; -/*<replacement>*/ - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Buffer = require('safe-buffer').Buffer; -/*</replacement>*/ +var util = require('util'); function copyBuffer(src, target, offset) { src.copy(target, offset); @@ -71,4 +69,11 @@ module.exports = function () { }; return BufferList; -}();
\ No newline at end of file +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +}
\ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/readable-stream/lib/internal/streams/destroy.js index b3e58c33b..5a0a0d88c 100644 --- a/node_modules/readable-stream/lib/internal/streams/destroy.js +++ b/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -2,7 +2,7 @@ /*<replacement>*/ -var processNextTick = require('process-nextick-args'); +var pna = require('process-nextick-args'); /*</replacement>*/ // undocumented cb() API, needed for core, not for public API @@ -16,9 +16,9 @@ function destroy(err, cb) { if (cb) { cb(err); } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - processNextTick(emitErrorNT, this, err); + pna.nextTick(emitErrorNT, this, err); } - return; + return this; } // we set destroyed to true before firing error callbacks in order @@ -35,7 +35,7 @@ function destroy(err, cb) { this._destroy(err || null, function (err) { if (!cb && err) { - processNextTick(emitErrorNT, _this, err); + pna.nextTick(emitErrorNT, _this, err); if (_this._writableState) { _this._writableState.errorEmitted = true; } @@ -43,6 +43,8 @@ function destroy(err, cb) { cb(err); } }); + + return this; } function undestroy() { |