1 line
9.9 KiB
JSON
1 line
9.9 KiB
JSON
{"ast":null,"code":"'use strict'; // undocumented cb() API, needed for core, not for public API\n\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err) {\n if (!this._writableState) {\n process.nextTick(emitErrorNT, this, err);\n } else if (!this._writableState.errorEmitted) {\n this._writableState.errorEmitted = true;\n process.nextTick(emitErrorNT, this, err);\n }\n }\n\n return this;\n } // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n } // if this is a duplex stream mark the writable part as destroyed as well\n\n\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n if (!_this._writableState) {\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else if (!_this._writableState.errorEmitted) {\n _this._writableState.errorEmitted = true;\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n } else if (cb) {\n process.nextTick(emitCloseNT, _this);\n cb(err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n });\n\n return this;\n}\n\nfunction emitErrorAndCloseNT(self, err) {\n emitErrorNT(self, err);\n emitCloseNT(self);\n}\n\nfunction emitCloseNT(self) {\n if (self._writableState && !self._writableState.emitClose) return;\n if (self._readableState && !self._readableState.emitClose) return;\n self.emit('close');\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finalCalled = false;\n this._writableState.prefinished = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nfunction errorOrDestroy(stream, err) {\n // We have tests that rely on errors being emitted\n // in the same tick, so changing this is semver major.\n // For now when you opt-in to autoDestroy we allow\n // the error to be emitted nextTick. In a future\n // semver major update we should change the default to this.\n var rState = stream._readableState;\n var wState = stream._writableState;\n if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy,\n errorOrDestroy: errorOrDestroy\n};","map":{"version":3,"sources":["/Users/tylerkoenig/Code/personal/react-scss2/node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/destroy.js"],"names":["destroy","err","cb","_this","readableDestroyed","_readableState","destroyed","writableDestroyed","_writableState","process","nextTick","emitErrorNT","errorEmitted","_destroy","emitErrorAndCloseNT","emitCloseNT","self","emitClose","emit","undestroy","reading","ended","endEmitted","ending","finalCalled","prefinished","finished","errorOrDestroy","stream","rState","wState","autoDestroy","module","exports"],"mappings":"AAAA,a,CAAc;;AAEd,SAASA,OAAT,CAAiBC,GAAjB,EAAsBC,EAAtB,EAA0B;AACxB,MAAIC,KAAK,GAAG,IAAZ;;AAEA,MAAIC,iBAAiB,GAAG,KAAKC,cAAL,IAAuB,KAAKA,cAAL,CAAoBC,SAAnE;AACA,MAAIC,iBAAiB,GAAG,KAAKC,cAAL,IAAuB,KAAKA,cAAL,CAAoBF,SAAnE;;AAEA,MAAIF,iBAAiB,IAAIG,iBAAzB,EAA4C;AAC1C,QAAIL,EAAJ,EAAQ;AACNA,MAAAA,EAAE,CAACD,GAAD,CAAF;AACD,KAFD,MAEO,IAAIA,GAAJ,EAAS;AACd,UAAI,CAAC,KAAKO,cAAV,EAA0B;AACxBC,QAAAA,OAAO,CAACC,QAAR,CAAiBC,WAAjB,EAA8B,IAA9B,EAAoCV,GAApC;AACD,OAFD,MAEO,IAAI,CAAC,KAAKO,cAAL,CAAoBI,YAAzB,EAAuC;AAC5C,a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AACA,MAAIyB,MAAM,GAAGF,MAAM,CAACpB,cAApB;AACA,MAAIqB,MAAM,IAAIA,MAAM,CAACE,WAAjB,IAAgCD,MAAM,IAAIA,MAAM,CAACC,WAArD,EAAkEH,MAAM,CAAC5B,OAAP,CAAeC,GAAf,EAAlE,KAA2F2B,MAAM,CAACV,IAAP,CAAY,OAAZ,EAAqBjB,GAArB;AAC5F;;AAED+B,MAAM,CAACC,OAAP,GAAiB;AACfjC,EAAAA,OAAO,EAAEA,OADM;AAEfmB,EAAAA,SAAS,EAAEA,SAFI;AAGfQ,EAAAA,cAAc,EAAEA;AAHD,CAAjB","sourcesContent":["'use strict'; // undocumented cb() API, needed for core, not for public API\n\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err) {\n if (!this._writableState) {\n process.nextTick(emitErrorNT, this, err);\n } else if (!this._writableState.errorEmitted) {\n this._writableState.errorEmitted = true;\n process.nextTick(emitErrorNT, this, err);\n }\n }\n\n return this;\n } // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n } // if this is a duplex stream mark the writable part as destroyed as well\n\n\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n if (!_this._writableState) {\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else if (!_this._writableState.errorEmitted) {\n _this._writableState.errorEmitted = true;\n process.nextTick(emitErrorAndCloseNT, _this, err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n } else if (cb) {\n process.nextTick(emitCloseNT, _this);\n cb(err);\n } else {\n process.nextTick(emitCloseNT, _this);\n }\n });\n\n return this;\n}\n\nfunction emitErrorAndCloseNT(self, err) {\n emitErrorNT(self, err);\n emitCloseNT(self);\n}\n\nfunction emitCloseNT(self) {\n if (self._writableState && !self._writableState.emitClose) return;\n if (self._readableState && !self._readableState.emitClose) return;\n self.emit('close');\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finalCalled = false;\n this._writableState.prefinished = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nfunction errorOrDestroy(stream, err) {\n // We have tests that rely on errors being emitted\n // in the same tick, so changing this is semver major.\n // For now when you opt-in to autoDestroy we allow\n // the error to be emitted nextTick. In a future\n // semver major update we should change the default to this.\n var rState = stream._readableState;\n var wState = stream._writableState;\n if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy,\n errorOrDestroy: errorOrDestroy\n};"]},"metadata":{},"sourceType":"script"} |