function $2b78b8a8e56cc629$var$destroy(err1, cb) {
    var _this = this;
    var readableDestroyed = this._readableState && this._readableState.destroyed;
    var writableDestroyed = this._writableState && this._writableState.destroyed;
    if (readableDestroyed || writableDestroyed) {
        if (cb) cb(err1);
        else if (err1) {
            if (!this._writableState) process.nextTick($2b78b8a8e56cc629$var$emitErrorNT, this, err1);
            else if (!this._writableState.errorEmitted) {
                this._writableState.errorEmitted = true;
                process.nextTick($2b78b8a8e56cc629$var$emitErrorNT, this, err1);
            }
        }
        return this;
    } // we set destroyed to true before firing error callbacks in order
    // to make it re-entrance safe in case destroy() is called within callbacks
    if (this._readableState) this._readableState.destroyed = true;
     // if this is a duplex stream mark the writable part as destroyed as well
    if (this._writableState) this._writableState.destroyed = true;
    this._destroy(err1 || null, function(err) {
        if (!cb && err) {
            if (!_this._writableState) process.nextTick($2b78b8a8e56cc629$var$emitErrorAndCloseNT, _this, err);
            else if (!_this._writableState.errorEmitted) {
                _this._writableState.errorEmitted = true;
                process.nextTick($2b78b8a8e56cc629$var$emitErrorAndCloseNT, _this, err);
            } else process.nextTick($2b78b8a8e56cc629$var$emitCloseNT, _this);
        } else if (cb) {
            process.nextTick($2b78b8a8e56cc629$var$emitCloseNT, _this);
            cb(err);
        } else process.nextTick($2b78b8a8e56cc629$var$emitCloseNT, _this);
    });
    return this;
}
// undocumented cb() API, needed for core, not for public API
undocumented cb() API, needed for core, not for public API
undocumented cb () API needed for core not for public API
function $2b78b8a8e56cc629$var$destroy(err1, cb) {
    var _this = this;
    var readableDestroyed = this._readableState && this._readableState.destroyed;
    var writableDestroyed = this._writableState && this._writableState.destroyed;
    if (readableDestroyed || writableDestroyed) {
        if (cb) cb(err1);
        else if (err1) {
            if (!this._writableState) process.nextTick($2b78b8a8e56cc629$var$emitErrorNT, this, err1);
            else if (!this._writableState.errorEmitted) {
                this._writableState.errorEmitted = true;
                process.nextTick($2b78b8a8e56cc629$var$emitErrorNT, this, err1);
            }
        }
        return this;
    } 
    if (this._readableState) this._readableState.destroyed = true;
    if (this._writableState) this._writableState.destroyed = true;
    this._destroy(err1 || null, function(err) {
        if (!cb && err) {
            if (!_this._writableState) process.nextTick($2b78b8a8e56cc629$var$emitErrorAndCloseNT, _this, err);
            else if (!_this._writableState.errorEmitted) {
                _this._writableState.errorEmitted = true;
                process.nextTick($2b78b8a8e56cc629$var$emitErrorAndCloseNT, _this, err);
            } else process.nextTick($2b78b8a8e56cc629$var$emitCloseNT, _this);
        } else if (cb) {
            process.nextTick($2b78b8a8e56cc629$var$emitCloseNT, _this);
            cb(err);
        } else process.nextTick($2b78b8a8e56cc629$var$emitCloseNT, _this);
    });
    return this;
}
function $2b78b8a8e56cc629$var$destroy ( err1 , cb ) { var _this = this ; var readableDestroyed = this . _readableState && this . _readableState . destroyed ; var writableDestroyed = this . _writableState && this . _writableState . destroyed ; if ( readableDestroyed || writableDestroyed ) { if ( cb ) cb ( err1 ) ; else if ( err1 ) { if ( ! this . _writableState ) process . nextTick ( $2b78b8a8e56cc629$var$emitErrorNT , this , err1 ) ; else if ( ! this . _writableState . errorEmitted ) { this . _writableState . errorEmitted = true ; process . nextTick ( $2b78b8a8e56cc629$var$emitErrorNT , this , err1 ) ; } } return this ; } if ( this . _readableState ) this . _readableState . destroyed = true ; if ( this . _writableState ) this . _writableState . destroyed = true ; this . _destroy ( err1 || null , function ( err ) { if ( ! cb && err ) { if ( ! _this . _writableState ) process . nextTick ( $2b78b8a8e56cc629$var$emitErrorAndCloseNT , _this , err ) ; else if ( ! _this . _writableState . errorEmitted ) { _this . _writableState . errorEmitted = true ; process . nextTick ( $2b78b8a8e56cc629$var$emitErrorAndCloseNT , _this , err ) ; } else process . nextTick ( $2b78b8a8e56cc629$var$emitCloseNT , _this ) ; } else if ( cb ) { process . nextTick ( $2b78b8a8e56cc629$var$emitCloseNT , _this ) ; cb ( err ) ; } else process . nextTick ( $2b78b8a8e56cc629$var$emitCloseNT , _this ) ; } ) ; return this ; }
undocumented cb() API, needed for core, not for public API
undocumented cb () API needed for core not for public API
// we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks // if this is a duplex stream mark the writable part as destroyed as well