(collection, grouper, context)
| 374 | } |
| 375 | |
| 376 | export function countByFactory(collection, grouper, context) { |
| 377 | const groups = Map().asMutable(); |
| 378 | collection.__iterate((v, k) => { |
| 379 | groups.update(grouper.call(context, v, k, collection), 0, (a) => a + 1); |
| 380 | }); |
| 381 | return groups.asImmutable(); |
| 382 | } |
| 383 | |
| 384 | export function groupByFactory(collection, grouper, context) { |
| 385 | const isKeyedIter = isKeyed(collection); |