@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
Returns
Map<K, V>A new Map instance.
● Variables
(Safe copy) Namespace object containing Map factory. Note: Importing this imports all methods in this namespace (no tree-shaking).
(Safe copy) Groups elements by key using the captured Map.groupBy if available. Note: Available only in ES2024+ environments.