@hyperfrontend/immutable-api-utils/built-in-copy/json

json

Locked, prototype-pollution-resistant copies of the global JSON methods.

References to JSON.parse and JSON.stringify are captured at module-load time and frozen into a tamper-proof namespace, so serialization stays trustworthy even if the global JSON is later patched. Effective only when imported before any untrusted code has had a chance to mutate the prototype chain.

API Reference

Variables

§type

JSON

(Safe copy) Namespace object containing all JSON methods. Note: Importing this imports all methods in this namespace (no tree-shaking).
§type

parse

(Safe copy) Converts a JavaScript Object Notation (JSON) string into an object.
§type

stringify

(Safe copy) Converts a JavaScript value to a JavaScript Object Notation (JSON) string.