denoland / std

The Deno Standard Library
https://jsr.io/@std
MIT License
3.17k stars 621 forks source link

feat(collections/unstable): support `Iterable` argument in `takeWhile()` #5911

Closed Liam-Tait closed 1 month ago

Liam-Tait commented 2 months ago

Support Iterable for collections takeWhile

5470

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.27%. Comparing base (6a4eb6c) to head (b36d8ec).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5911 +/- ## ========================================== - Coverage 96.28% 96.27% -0.01% ========================================== Files 496 497 +1 Lines 39605 39621 +16 Branches 5841 5843 +2 ========================================== + Hits 38134 38147 +13 - Misses 1429 1432 +3 Partials 42 42 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kt3k commented 2 months ago

how do you prefer we handle this, in terms of stability?

I'd prefer to avoid overloading with this.

How about considering this as 'refactor' or 'fix'?

kt3k commented 2 months ago

Or, maybe we can just land this as feat(collections/unstable) without overloading, but with note of something like Iterable input is unstable. WDYT?

iuioiua commented 2 months ago

Or, maybe we can just land this as feat(collections/unstable) without overloading, but with note of something like Iterable input is unstable. WDYT?

SGTM

iuioiua commented 1 month ago

Sorry for the delay. We're deciding how to best handle these changes that should probably be considered unstable.

Liam-Tait commented 1 month ago

No problem. Let me know if you need anything from me

kt3k commented 1 month ago

We decided to separate unstable feature from stable features more clearly (as described in #5920 ) to make it clear which part is stable and which part is not.

We are going to move this PR's implementation to unstable_take_while.ts (which will be available from JSR with the path jsr:@std/collections/unstable-take-while ) before merging, and keep the existing implementation as is.