# 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 #### JSON (Safe copy) Namespace object containing all JSON methods. Note: Importing this imports all methods in this namespace (no tree-shaking). ```typescript const JSON: Readonly<{ parse: (text: string, reviver?: (this: any, key: string, value: any) => any) => any; stringify: (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number) => string }> ``` **Value** `...` #### parse (Safe copy) Converts a JavaScript Object Notation (JSON) string into an object. ```typescript const parse: (text: string, reviver?: (this: any, key: string, value: any) => any) => any ``` **Value** `_JSON.parse` #### stringify (Safe copy) Converts a JavaScript value to a JavaScript Object Notation (JSON) string. ```typescript const stringify: (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number) => string ``` **Value** `_JSON.stringify` --- Canonical page: https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/json/ This file: https://www.hyperfrontend.dev/docs/libraries/utils/immutable-api/built-in-copy/json.md Documentation index: https://www.hyperfrontend.dev/llms.txt