@hyperfrontend/immutable-api-utils/built-in-copy/weak-setweak-set
Locked, prototype-pollution-resistant copy of the global WeakSet constructor.
The WeakSet constructor is wrapped in a createWeakSet factory at module-load time and frozen into a tamper-proof namespace, so weakly-held membership tracking keeps working even if the global WeakSet 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 WeakSet using the captured WeakSet constructor. Use this instead of
new WeakSet().Parameters
| Name | Type | Description |
|---|---|---|
§iterable? | Iterable<T, any, any> | Optional iterable of values. |
Returns
WeakSet<T>A new WeakSet instance.
● Variables
(Safe copy) Namespace object containing WeakSet factory. Note: Importing this imports all methods in this namespace (no tree-shaking).