UNPKG

datum-focus

Version:

Data shape, model, metadata, JSON, JSON Schema, GraphQL, MongoDB query and aggregations, iterator generators

8 lines (6 loc) 262 B
import { Stream } from 'stream'; import { FUNCTION } from './function'; import { isNull } from './maybe'; import { isObject } from './record'; export const isStream = (val: any): val is Stream => !isNull(val) && isObject(val) && typeof val.pipe === FUNCTION;