export function asyncIterableFromArray < A > ( array ) { return { [ Symbol . asyncIterator ] ( ) { let index = 0 ; return { next ( ) { if ( index === array . length ) { return Promise . resolve ( { value : null , done : true } ) ; } return Promise . resolve ( { value : array [ index ++ ] , done : false } ) ; } , } ; } , } ; }