@hyperfrontend/immutable-api-utils/built-in-copy/mapmap
Locked, prototype-pollution-resistant copy of the global Map constructor.
The Map constructor is wrapped in a createMap factory and Map.groupBy (where available) is captured at module-load time and frozen into a tamper-proof namespace, so keyed-collection construction keeps working even if the global Map is later patched. Effective only when imported before any untrusted code has had a chance to mutate the prototype chain.
API Reference
ƒ Functions
(Safe copy) Creates a new Map using the captured Map constructor. Use this instead of
new Map().Parameters
| Name | Type | Description |
|---|---|---|
§iterable? | Iterable<unknown, any, any> | Optional iterable of key-value pairs. |
Returns
Map<K, V>A new Map instance.