import { List } from '../types' ; name export function arrayFrom < A > ( iterable ) { if ( isIterator ( iterable ) ) return Array . from ( toIterable ( iterable ) ) ; return Array . from ( iterable as Iterable < A > | List < A > ) ; } function isIterator < A > ( x ) { return x && typeof ( x as Iterator < A > ) . next === 'function' ; } function toIterable < A > ( iterator ) { return { [ Symbol . iterator ] ( ) { return iterator ; } , } ; }