Function: sanitizeJson()
sanitizeJson<Defined in: sanitize.ts:387 Sanitizes and safely parses a JSON string, removing suspicious syntax elements that could potentially result in JSON polyglot exploits or prototype pollution.T>(jsonString):T
Type Parameters
T
T
The expected type of the parsed object
Parameters
jsonString
string
The JSON string to sanitize and parse.
Returns
T
The parsed JavaScript object if valid, or null if invalid.