You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, I like the idea -- one last breaking change that fixes an inconsistency. It's odd that map returns an array for Maps and Sets, but not for objects.
What would the iteratee signatures look like? mapValues(obj, function (value, key, cb) {...}, done) / mapKeys(obj, function (value, key, cb) {...}, done)?
Would mapValues/mapKeys work with Maps too?
This would also come in Series and Limit flavors too.
There was another issue/pr? for this I made sometime last year but currently map can produce either an object or array because of this line:
https://github.com/caolan/async/blob/master/lib/internal/map.js#L11
I would prefer we follow underscore/lodash lead and produce only arrays from map and then add
mapValues
andmapKeys
for mapping objects (#1133).This is one of the last changes I want to get into v2. Thoughts @aearly
The text was updated successfully, but these errors were encountered: