UNPKG

656 BTypeScriptView Raw
1/**
2 * Factory to create a reviver function for `JSON.parse` to sanitize keys
3 * @param reviver - Reviver function
4 * @param prohibitedKeys - An array of keys to be rejected
5 */
6export declare function sanitizeJsonParse(reviver?: (key: any, value: any) => any, prohibitedKeys?: string[]): (key: string, value: any) => any;
7/**
8 * Parse a json string that rejects prohibited keys
9 * @param text - JSON string
10 * @param reviver - Optional reviver function for `JSON.parse`
11 * @param prohibitedKeys - An array of keys to be rejected
12 */
13export declare function parseJson(text: string, reviver?: (key: any, value: any) => any, prohibitedKeys?: string[]): any;