# weak-map

Locked, prototype-pollution-resistant copy of the global `WeakMap` constructor.

The `WeakMap` constructor is wrapped in a [`createWeakMap`](https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/weak-map/#api-createWeakMap) factory at module-load time and frozen into a tamper-proof namespace, so private-state storage keeps working even if the global `WeakMap` is later patched. Effective only when imported before any untrusted code has had a chance to mutate the prototype chain.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/weak-map/
This file: https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/weak-map.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
