import { ArgumentOutOfRangeException } from "../../shared" ; import { IEnumerable } from "../../types" ; import { BasicEnumerable } from "../BasicEnumerable" ; param start param count throws returns export const range = ( start , count ) : IEnumerable < number > => { if ( start < 0 || ( start + count - 1 ) > Number . MAX_SAFE_INTEGER ) { throw new ArgumentOutOfRangeException ( `start` ) ; } function * iterator ( ) { const max = start + count ; for ( let i = start ; i < max ; i ++ ) { yield i ; } } return new BasicEnumerable ( iterator ) ; } ;