UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

81 lines (41 loc) 1.34 kB
--- lang: en title: 'API docs: rest.sanitizejsonparse' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest permalink: /doc/en/lb4/apidocs.rest.sanitizejsonparse.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [sanitizeJsonParse](./rest.sanitizejsonparse.md) ## sanitizeJsonParse() function Factory to create a reviver function for `JSON.parse` to sanitize keys **Signature:** ```typescript export declare function sanitizeJsonParse(reviver?: (key: any, value: any) => any, prohibitedKeys?: string[]): (key: string, value: any) => any; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td markdown="1"> reviver </td><td markdown="1"> (key: any, value: any) =&gt; any </td><td markdown="1"> _(Optional)_ Reviver function </td></tr> <tr><td markdown="1"> prohibitedKeys </td><td markdown="1"> string\[\] </td><td markdown="1"> _(Optional)_ An array of keys to be rejected </td></tr> </tbody></table> **Returns:** (key: string, value: any) =&gt; any