stdlib-js / stdlib

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

[RFC]: add `@stdlib/iter/cunone` #2333

Open kgryte opened 2 months ago

kgryte commented 2 months ago

Description

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

var it = iterCuNone( 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

ruthwikchikoti commented 1 month ago

Hi @kgryte , could you please assign this issue to me?

kgryte commented 1 month ago

@ruthwikchikoti Yes, and I suggest you focus on addressing RFC before working on https://github.com/stdlib-js/stdlib/issues/1632. The README issue is less useful than adding this feature.

ruthwikchikoti commented 1 month ago

@kgryte review this !!

ruthwikchikoti commented 4 weeks ago

@kgryte please review ?