Creates a sink collecting the items of the feed into a map under extracted keys.
Keys and values are made immutable as they are collected, in source order. Keys must be unique: an item
whose key was already collected fails the sink rather than silently overwriting the entry standing under it. Keys
are compared with SameValueZero semantics, so NaN matches itself and -0 matches 0.
The returned map is frozen, with set, delete and clear shadowed by own properties that throw: entries cannot
be altered through the map, although mutating methods invoked directly on Map.prototype still reach the internal
slots backing them.
Accumulates the whole feed in memory. For large or infinite feeds, this may exhaust memory or never complete.
Freezing clones structured keys, giving them a fresh identity: entries are not reachable through the original key reference, and the same mutable key extracted twice yields two distinct entries rather than a duplicate key error. Extract structured keys as immutable values to keep their identity stable.
The type of items in the feed
The type of map keys
A sink resolving to the deeply immutable read-only map pairing each extracted key with the item it was extracted from
Creates a sink collecting extracted values into a map under extracted keys.
Collects like toMap without a value argument, pairing each key with an extracted value rather than with
the item itself.
The type of items in the feed
The type of map keys
The type of map values
A sink resolving to the deeply immutable read-only map pairing each extracted key with the value extracted alongside it
Creates a sink collecting items or extracted values into a map under extracted keys.