import { AsyncIterableX } from './asynciterablex' ; import { throwIfAborted } from '../aborterror' ; class RangeAsyncIterable extends AsyncIterableX < number > { private _start : number ; private _count : number ; constructor ( start , count ) { super ( ) ; this . _start = start ; this . _count = count ; } async * [ Symbol . asyncIterator ] ( signal ? ) { throwIfAborted ( signal ) ; for ( let current = this . _start , end = this . _start + this . _count ; current < end ; current ++ ) { yield current ; } } } param { number } start param { number } count returns { AsyncIterableX < number > } export function range ( start , count ) { return new RangeAsyncIterable ( start , count ) ; }