-
Notifications
You must be signed in to change notification settings - Fork 579
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
[Umbrella] collections
APIs
#1173
Comments
collections
module ToDoscollections
ToDos
Note: we sometimes drop the items from proposal when the implementation is too trivial. This Luca's comment describes the reasoning behind it well. |
I will keep them in the list |
As we approach being pretty much API complete compared to the Kotlin package that inspired this (and removing the ones that we have deemed not fitting for JS right now), I would like to propose three last functions to complete the modules API for now. All three are taken mostly directly from Comments welcome, I will add them to the list above soon :-)
|
I added the above functions to the list and will shamelessly ping the recent contributors to the module, maybe someone wants do implement one of them :-) CC @grian32 @majidsajadi @ayame113 @getspooky |
@LionC good , i will look into |
so I take |
@LionC can you please confirm this example: const users = [
{ id: 'a2e', userName: 'Anna' },
{ id: '5f8', userName: 'Arnold' },
{ id: 'd2c', userName: 'Kim' },
]
const usersByLength = associateWith(users, it => it.userName.length)
assertEquals(usersByLength, {
'4': { id: 'a2e', userName: 'Anna' },
'6': { id: '5f8', userName: 'Arnold' },
'3': { id: 'd2c', userName: 'Kim' },
}) |
That is A correct example would be: const names = [ 'Kim', 'Lara', 'Jonathan' ]
const namesToLength = associateWith(names, it => it.length)
assertEquals(namesToLength, {
'Kim': 3,
'Lara': 4,
'Jonathan': 8,
}) |
@LionC great work on seeing this proposal through in full! Also thanks to @getspooky, @majidsajadi, @grian32, @ayame113 and other contributors for help implementing all the APIs. This module is a very valuable addition to the standard library! |
collections
This is an umbrella issue for the
collections
module, which has landed instd
with this initial PR and a lot of new contributions since. The goal of this issue is to give an overview about functions that have alreayd been implemented, are being worked on and have not been started yet.For more details on the idea behind the module, check out its Readme and contribution guide. For more details on the history of the module and its proposed signatures, see the original proposal PR.
If you want to implement one of the missing functions, please open a separate PR for it and keep discussion in that PR. Please read the contribution guide and make sure to keep the checklist in mind before opening your PR / marking it ready for review.
If you want to add onto or discuss the list, please do that here.
Unstarted / Suggestions
None right now
In Progress
filterNotNullishfeat(collections): add filterNotNullish #1168filterValuesNotNullishfeat(collections): add filterValuesNotNullish #1186withoutfeat(collections): Returns an array excluding single given value #1074Done
aggregateGroups
#1553associatewith
#1213deepMerge
#1075includesValue
#1184mapNotNullish
tocollections
#1103runningReduce
#1226The text was updated successfully, but these errors were encountered: