Page Contents

Home > @loopback/rest > parseJson

parseJson() function

Parse a json string that rejects prohibited keys

Signature:

export declare function parseJson(text: string, reviver?: (key: any, value: any) => any, prohibitedKeys?: string[]): any;

Parameters

Parameter Type Description
text string JSON string
reviver (key: any, value: any) => any (Optional) Optional reviver function for JSON.parse
prohibitedKeys string[] (Optional) An array of keys to be rejected

Returns:

any