tc39 / proposal-collection-normalization

MIT License
41 stars 8 forks source link

Also "revalue" for maps? #10

Closed domenic closed 5 years ago

domenic commented 5 years ago

A lot of cases on the web platform require validating or normalizing values, not just keys. I would be very excited if this proposal would embrace that use case as well.

Similarly, sets arguably only have values, not keys, so they should not have a "rekey" argument, but instead a "revalue" argument. Moving to a dedicated issue.

Even if you consider this request out of scope, please ensure future compatibility with extending this proposal's mechanisms to cover those. That should be straightforward (just add another method to the options bag), but worth keeping in mind.

bmeck commented 5 years ago

revalue seems to be a requirement if we are faced with Sets being collections of Values. Ensuring that rekey/revalue works for both Sets and Maps would be ideal and we can add that split prior to moving forward.

bmeck commented 5 years ago

this has been added as toValue