Skip to main content

parseJsonSafe

Summary

Safely parses JSON with prototype pollution protection. Filters out dangerous keys like proto, constructor, and prototype.

Signature

static parseJsonSafe<T = any>(jsonString: string): T;

Parameters

jsonString

Type:string The JSON string to parse

Returns

Type:T Safely parses JSON with prototype pollution protection. Filters out dangerous keys like proto, constructor, and prototype.

Examples

Example 1