import { ArgumentOutOfRangeException } from "../../shared" ; import { IEnumerable } from "../../types" ; import { BasicEnumerable } from "../BasicEnumerable" ; param element param count returns export const repeat = < TResult > ( element , count ) : IEnumerable < TResult > => { if ( count < 0 ) { throw new ArgumentOutOfRangeException ( `count` ) ; } function * iterator ( ) { for ( let i = 0 ; i < count ; i ++ ) { yield element ; } } return new BasicEnumerable ( iterator ) ; } ;