Transform Stream-like

Test if a value is Node transform stream-like.

Usage

var isNodeTransformStreamLike = require( '@stdlib/assert/is-node-transform-stream-like' );

isNodeTransformStreamLike( value )

Tests if a value is Node transform stream-like.

var transformStream = require( '@stdlib/streams/node/transform' );

var bool = isNodeTransformStreamLike( transformStream() );
// returns true

Examples

var stream = require( 'stream' );
var transformStream = require( '@stdlib/streams/node/transform' );
var isNodeTransformStreamLike = require( '@stdlib/assert/is-node-transform-stream-like' );

var bool = isNodeTransformStreamLike( new stream.Transform() );
// returns true

bool = isNodeTransformStreamLike( transformStream() );
// returns true

bool = isNodeTransformStreamLike( new stream.Stream() );
// returns false

bool = isNodeTransformStreamLike( new stream.Readable() );
// returns false

bool = isNodeTransformStreamLike( new stream.Writable() );
// returns false

bool = isNodeTransformStreamLike( new stream.Duplex() );
// returns false

bool = isNodeTransformStreamLike( {} );
// returns false

bool = isNodeTransformStreamLike( [] );
// returns false

bool = isNodeTransformStreamLike( null );
// returns false

function Stream() {
    return this;
}

bool = isNodeTransformStreamLike( Stream );
// returns false

bool = isNodeTransformStreamLike( new Stream() );
// returns false
Did you find this page helpful?