Object.defineProperty(exports, '__esModule', { value: true });
function isStream(stream) {
return stream !== null
&& typeof stream === 'object'
&& typeof stream.pipe === 'function';
}
function isWritableStream(stream) {
return isStream(stream)
&& stream.writable !== false
&& typeof stream._write === 'function'
&& typeof stream._writableState === 'object';
}
function isReadableStream(stream) {
return isStream(stream)
&& stream.readable !== false
&& typeof stream._read === 'function'
&& typeof stream._readableState === 'object';
}
function isDuplexStream(stream) {
return isWritableStream(stream)
&& isReadableStream(stream);
}
function isTransformStream(stream) {
return isDuplexStream(stream)
&& typeof stream._transform === 'function';
}
exports.isDuplexStream = isDuplexStream;
exports.isReadableStream = isReadableStream;
exports.isStream = isStream;
exports.isTransformStream = isTransformStream;
exports.isWritableStream = isWritableStream;
|