time-to-botec/squiggle/node_modules/@stdlib/assert/is-node-transform-stream-like
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

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