MCPcopy Index your code
hub / github.com/totaljs/framework / destroyStream

Function destroyStream

internal.js:3215–3224  ·  view source on GitHub ↗

* Destroy the stream * @param {Stream} stream * @return {Stream} * @author Jonathan Ong * @license MIT * @see https://github.com/stream-utils/destroy

(stream)

Source from the content-addressed store, hash-verified

3213 * @see {@link https://github.com/stream-utils/destroy}
3214 */
3215function destroyStream(stream) {
3216 if (stream instanceof ReadStream) {
3217 stream.destroy();
3218 typeof(stream.close) === 'function' && stream.on('open', function() {
3219 typeof(this.fd) === 'number' && this.close();
3220 });
3221 } else if (stream instanceof Stream)
3222 typeof(stream.destroy) === 'function' && stream.destroy();
3223 return stream;
3224}
3225
3226function isFinished(stream) {
3227

Callers 1

internal.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected