import { IIterator , iter , IterableOrArrayLike } from './iter' ; param object param step returns export function stride < T > ( object , step ) { return new StrideIterator < T > ( iter ( object ) , step ) ; } /**
 * An iterator which traverses a source iterator step-wise.
 */ export class StrideIterator < T > implements IIterator < T > { param source param step constructor ( source , step ) { this . _source = source ; this . _step = step ; } returns iter ( ) { return this ; } returns clone ( ) { return new StrideIterator < T > ( this . _source . clone ( ) , this . _step ) ; } returns next ( ) { let value = this . _source . next ( ) ; for ( let n = this . _step - 1 ; n > 0 ; -- n ) { this . _source . next ( ) ; } return value ; } private _source : IIterator < T > ; private _step : number ; }