Skip to content

Commit

Permalink
fix: avoid overriding Transform.destroy() method (#195)
Browse files Browse the repository at this point in the history
fix compatibility with Node 14
  • Loading branch information
curbengh committed Apr 25, 2020
1 parent 1b3aa01 commit efe1fec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions lib/cache_stream.js
Expand Up @@ -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);
};
Expand Down
8 changes: 0 additions & 8 deletions test/cache_stream.spec.js
Expand Up @@ -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);
});
});

0 comments on commit efe1fec

Please sign in to comment.