This RFC proposes adding the package @stdlib/iter/cusome, which cumulatively tests whether at least n iterated values are truthy. The function should be a transform iterator, continuing to iterate while source iterator values are available.
var array2iterator = require( '@stdlib/array/to-iterator' );
var arr = array2iterator( [ false, false, false, true, true ] );
var it = iterCuSome( arr, 2 );
var v = it.next().value;
// returns false
v = it.next().value;
// returns false
v = it.next().value;
// returns false
v = it.next().value;
// returns false
v = it.next().value;
// returns true
var bool = it.next().done;
// returns true
Description
This RFC proposes adding the package
@stdlib/iter/cusome
, which cumulatively tests whether at leastn
iterated values are truthy. The function should be a transform iterator, continuing to iterate while source iterator values are available.Related Issues
No.
Questions
No.
Other
@stdlib/iter/some
Checklist
RFC:
.