Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC]: add @stdlib/iter/cusome #2334

Closed
3 tasks done
kgryte opened this issue Jun 8, 2024 · 2 comments · Fixed by #2561
Closed
3 tasks done

[RFC]: add @stdlib/iter/cusome #2334

kgryte opened this issue Jun 8, 2024 · 2 comments · Fixed by #2561
Assignees
Labels
Accepted RFC feature request which has been accepted. difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! JavaScript Issue involves or relates to JavaScript. priority: Normal Normal priority concern or feature request. RFC Request for comments. Feature requests and proposed changes.

Comments

@kgryte
Copy link
Member

kgryte commented Jun 8, 2024

Description

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

Related Issues

No.

Questions

No.

Other

  • See also @stdlib/iter/some

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@kgryte kgryte added RFC Request for comments. Feature requests and proposed changes. Feature Issue or pull request for adding a new feature. Accepted RFC feature request which has been accepted. Good First Issue A good first issue for new contributors! priority: Normal Normal priority concern or feature request. JavaScript Issue involves or relates to JavaScript. difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. labels Jun 8, 2024
@TheNourhan
Copy link
Contributor

Can you assign this to me please?

@kgryte
Copy link
Member Author

kgryte commented Jul 10, 2024

@TheNourhan Thanks for volunteering to work on this. Please feel free to submit a PR implementing this feature.

@kgryte kgryte closed this as completed in aa707da Jul 22, 2024
gunjjoshi pushed a commit to gunjjoshi/stdlib that referenced this issue Aug 21, 2024
PR-URL: stdlib-js#2561
Closes: stdlib-js#2334
Co-authored-by: Athan Reines <kgryte@gmail.com>
Reviewed-by: Athan Reines <kgryte@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted RFC feature request which has been accepted. difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! JavaScript Issue involves or relates to JavaScript. priority: Normal Normal priority concern or feature request. RFC Request for comments. Feature requests and proposed changes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants