From 2291ec54fcf4addda896825d579975decdb0d193 Mon Sep 17 00:00:00 2001 From: MDLeom <43627182+curbengh@users.noreply.github.com> Date: Sat, 25 Apr 2020 13:37:56 +0930 Subject: [PATCH] fix: avoid overriding Transform.destroy() method (#195) fix compatibility with Node 14 --- lib/cache_stream.js | 4 ---- test/cache_stream.spec.js | 8 -------- 2 files changed, 12 deletions(-) diff --git a/lib/cache_stream.js b/lib/cache_stream.js index 91e65124..54a38bc0 100644 --- a/lib/cache_stream.js +++ b/lib/cache_stream.js @@ -18,10 +18,6 @@ CacheStream.prototype._transform = function(chunk, enc, callback) { callback(); }; -CacheStream.prototype.destroy = function() { - this._cache.length = 0; -}; - CacheStream.prototype.getCache = function() { return Buffer.concat(this._cache); }; diff --git a/test/cache_stream.spec.js b/test/cache_stream.spec.js index 4b6766e4..08638fb8 100644 --- a/test/cache_stream.spec.js +++ b/test/cache_stream.spec.js @@ -20,12 +20,4 @@ describe('CacheStream', () => { cacheStream.getCache().should.eql(content); }); }); - - it('destroy', () => { - const cacheStream = new CacheStream(); - cacheStream._cache = [Buffer.alloc(1)]; - - cacheStream.destroy(); - cacheStream._cache.should.have.length(0); - }); });