import { IParallelEnumerable } from "../types" ; import { BasicParallelEnumerable } from "./BasicParallelEnumerable" ; param source returns export const isParallelEnumerable = ( source ) : source is IParallelEnumerable < any > => { if ( ! source ) { return false ; } if ( source instanceof BasicParallelEnumerable ) { return true ; } if ( typeof source [ Symbol . asyncIterator ] !== "function" ) { return false ; } const propertyNames = Object . getOwnPropertyNames ( BasicParallelEnumerable . prototype ) . filter ( ( v ) => v !== "constructor" ) ; const methods = source . prototype || source ; for ( const prop of propertyNames ) { if ( typeof methods [ prop ] !== "function" ) { return false ; } } return true ; } ;