stdlib-js / stdlib

✨ Standard library for JavaScript and Node.js. ✨
https://stdlib.io
Apache License 2.0
4.34k stars 440 forks source link

[RFC]: add `@stdlib/iter/cuevery` #2332

Open kgryte opened 3 months ago

kgryte commented 3 months ago

Description

This RFC proposes adding the package @stdlib/iter/cuevery, which cumulatively tests whether every iterated value is 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( [ true, true, true, false, true ] );

var it = iterCuEvery( arr );

var v = it.next().value;
// returns true

v = it.next().value;
// returns true

v = it.next().value;
// returns true

v = it.next().value;
// returns false

v = it.next().value;
// returns false

var bool = it.next().done;
// returns true

Related Issues

No.

Questions

No.

Other

Checklist

RidamGarg commented 3 months ago

I'd like to work on this. @kgryte

kgryte commented 3 months ago

Sounds good! Thanks for volunteering to work on this, @RidamGarg!

Dipti0704 commented 2 months ago

i would liketo work on this issue kindly assign this to me

RidamGarg commented 2 months ago

@kgryte please assign it to @Dipti0704 not getting much time to work on this. Thank You!

kgryte commented 2 months ago

Done. @Dipti0704 Please feel free to submit a PR implementing this feature.

Dipti0704 commented 2 months ago

thanks for assigning.. i will soon raise a pr sir

adityacodes30 commented 1 week ago

i am working on this will pr in ~24h