From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- .../readable-stream/lib/internal/streams/BufferList.js | 13 +++++++++---- .../readable-stream/lib/internal/streams/destroy.js | 10 ++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'node_modules/readable-stream/lib/internal/streams') 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'; -/**/ - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Buffer = require('safe-buffer').Buffer; -/**/ +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 @@ /**/ -var processNextTick = require('process-nextick-args'); +var pna = require('process-nextick-args'); /**/ // 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() { -- cgit v1.2.3