import { IIterator } from './iter' ; param value param count returns export function repeat < T > ( value , count ) { return new RepeatIterator < T > ( value , count ) ; } param value returns export function once < T > ( value ) { return new RepeatIterator < T > ( value , 1 ) ; } /**
 * An iterator which repeats a value a specified number of times.
 */ export class RepeatIterator < T > implements IIterator < T > { param value param count constructor ( value , count ) { this . _value = value ; this . _count = count ; } returns iter ( ) { return this ; } returns clone ( ) { return new RepeatIterator < T > ( this . _value , this . _count ) ; } returns next ( ) { if ( this . _count <= 0 ) { return undefined ; } this . _count -- ; return this . _value ; } private _value : T ; private _count : number ; }