Attempted to understand volume code and retry fixes

This commit is contained in:
abalabahaha
2016-03-12 21:53:34 -08:00
parent 5e64d96272
commit 13055f67d2
4 changed files with 20 additions and 34 deletions

View File

@@ -11,10 +11,11 @@ var Transform = require('stream').Transform;
var Volume = (function (_Transform) {
_inherits(Volume, _Transform);
function Volume() {
function Volume(volume) {
_classCallCheck(this, Volume);
_Transform.apply(this, arguments);
_Transform.call(this);
this.set(volume);
}
Volume.prototype.get = function get() {
@@ -22,7 +23,7 @@ var Volume = (function (_Transform) {
};
Volume.prototype.set = function set(volume) {
this.volume = volume;
this.volume = volume === undefined ? 1 : volume;
};
Volume.prototype._transform = function _transform(buffer, encoding, callback) {