1 line
12 KiB
JSON
1 line
12 KiB
JSON
{"ast":null,"code":"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n'use strict';\n/*<replacement>*/\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n\n for (var key in obj) {\n keys.push(key);\n }\n\n return keys;\n};\n/*</replacement>*/\n\n\nmodule.exports = Duplex;\n\nvar Readable = require('./_stream_readable');\n\nvar Writable = require('./_stream_writable');\n\nrequire('inherits')(Duplex, Readable);\n\n{\n // Allow the keys array to be GC'ed.\n var keys = objectKeys(Writable.prototype);\n\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n Readable.call(this, options);\n Writable.call(this, options);\n this.allowHalfOpen = true;\n\n if (options) {\n if (options.readable === false) this.readable = false;\n if (options.writable === false) this.writable = false;\n\n if (options.allowHalfOpen === false) {\n this.allowHalfOpen = false;\n this.once('end', onend);\n }\n }\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n}); // the no-half-open enforcer\n\nfunction onend() {\n // If the writable side ended, then we're ok.\n if (this._writableState.ended) return; // no more data can be written.\n // But allow more writes to happen in this tick.\n\n process.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});","map":{"version":3,"sources":["/Users/tylerkoenig/Code/personal/react-scss2/node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_duplex.js"],"names":["objectKeys","Object","keys","obj","key","push","module","exports","Duplex","Readable","require","Writable","prototype","v","length","method","options","call","allowHalfOpen","readable","writable","once","onend","defineProperty","enumerable","get","_writableState","highWaterMark","getBuffer","ended","process","nextTick","onEndNT","self","end","_readableState","undefined","destroyed","set","value"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAIA,UAAU,GAAGC,MAAM,CAACC,IAAP,IAAe,UAAUC,GAAV,EAAe;AAC7C,MAAID,IAAI,GAAG,EAAX;;AAEA,OAAK,IAAIE,GAAT,IAAgBD,GAAhB,EAAqB;AACnBD,IAAAA,IAAI,CAACG,IAAL,CAAUD,GAAV;AACD;;AAED,SAAOF,IAAP;AACD,CARD;AASA;;;AAGAI,MAAM,CAACC,OAAP,GAAiBC,MAAjB;;AAEA,IAAIC,QAAQ,GAAGC,OAAO,CAAC,oBAAD,CAAtB;;AAEA,IAAIC,QAAQ,GAAGD,OAAO,CAAC,oBAAD,CAAtB;;AAEAA,OAAO,CAAC,UAAD,CAAP,CAAoBF,MAApB,EAA4BC,QAA5B;;AAEA;AACE;AACA,MAAIP,IAAI,GAAGF,UAAU,CAACW,QAAQ,CAACC,SAAV,CAArB;;AAEA,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGX,IAAI,CAACY,MAAzB,EAAiCD,CAAC,EAAlC,EAAsC;AACpC,QAAIE,MAAM,GAAGb,IAAI,CAACW,CAAD,CAAjB;AACA,QAAI,CAACL,MAAM,CAACI,SAAP,CAAiBG,MAAjB,CAAL,EAA+BP,MAAM,CAACI,SAAP,CAAiBG,MAAjB,IAA2BJ,QAAQ,CAACC,SAAT,CAAmBG,MAAnB,CAA3B;AAChC;AACF;;AAED,SAASP,MAAT,CAAgBQ,OAAhB,EAAyB;AACvB,MAAI,EAAE,gBAAgBR,MAAlB,CAAJ,EAA+B,OAAO,IAAIA,MAAJ,CAAWQ,OAAX,CAAP;AAC/BP,EAAAA,QAAQ,CAACQ,IAAT,CAAc,I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,cAAL,CAAoBG,KAAxB,EAA+B,OAFhB,CAEwB;AACvC;;AAEAC,EAAAA,OAAO,CAACC,QAAR,CAAiBC,OAAjB,EAA0B,IAA1B;AACD;;AAED,SAASA,OAAT,CAAiBC,IAAjB,EAAuB;AACrBA,EAAAA,IAAI,CAACC,GAAL;AACD;;AAEDjC,MAAM,CAACsB,cAAP,CAAsBf,MAAM,CAACI,SAA7B,EAAwC,WAAxC,EAAqD;AACnD;AACA;AACA;AACAY,EAAAA,UAAU,EAAE,KAJuC;AAKnDC,EAAAA,GAAG,EAAE,SAASA,GAAT,GAAe;AAClB,QAAI,KAAKU,cAAL,KAAwBC,SAAxB,IAAqC,KAAKV,cAAL,KAAwBU,SAAjE,EAA4E;AAC1E,aAAO,KAAP;AACD;;AAED,WAAO,KAAKD,cAAL,CAAoBE,SAApB,IAAiC,KAAKX,cAAL,CAAoBW,SAA5D;AACD,GAXkD;AAYnDC,EAAAA,GAAG,EAAE,SAASA,GAAT,CAAaC,KAAb,EAAoB;AACvB;AACA;AACA,QAAI,KAAKJ,cAAL,KAAwBC,SAAxB,IAAqC,KAAKV,cAAL,KAAwBU,SAAjE,EAA4E;AAC1E;AACD,KALsB,CAKrB;AACF;;;AAGA,SAAKD,cAAL,CAAoBE,SAApB,GAAgCE,KAAhC;AACA,SAAKb,cAAL,CAAoBW,SAApB,GAAgCE,KAAhC;AACD;AAvBkD,CAArD","sourcesContent":["// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n'use strict';\n/*<replacement>*/\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n\n for (var key in obj) {\n keys.push(key);\n }\n\n return keys;\n};\n/*</replacement>*/\n\n\nmodule.exports = Duplex;\n\nvar Readable = require('./_stream_readable');\n\nvar Writable = require('./_stream_writable');\n\nrequire('inherits')(Duplex, Readable);\n\n{\n // Allow the keys array to be GC'ed.\n var keys = objectKeys(Writable.prototype);\n\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n Readable.call(this, options);\n Writable.call(this, options);\n this.allowHalfOpen = true;\n\n if (options) {\n if (options.readable === false) this.readable = false;\n if (options.writable === false) this.writable = false;\n\n if (options.allowHalfOpen === false) {\n this.allowHalfOpen = false;\n this.once('end', onend);\n }\n }\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.highWaterMark;\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState && this._writableState.getBuffer();\n }\n});\nObject.defineProperty(Duplex.prototype, 'writableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._writableState.length;\n }\n}); // the no-half-open enforcer\n\nfunction onend() {\n // If the writable side ended, then we're ok.\n if (this._writableState.ended) return; // no more data can be written.\n // But allow more writes to happen in this tick.\n\n process.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});"]},"metadata":{},"sourceType":"script"} |