@hyperfrontend/immutable-api-utils/built-in-copy/regexpregexp
Locked, prototype-pollution-resistant copy of the global RegExp constructor.
The RegExp constructor is wrapped in a createRegExp factory at module-load time and frozen into a tamper-proof namespace, so pattern construction keeps working even if the global RegExp 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 RegExp using the captured RegExp constructor. Use this instead of
new RegExp().Parameters
Returns
RegExpA new RegExp instance.
● Variables
(Safe copy) Namespace object containing RegExp factory. Note: Importing this imports all methods in this namespace (no tree-shaking).