MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / parseJson

Function parseJson

packages/rest/src/parse-json.ts:60–71  ·  view source on GitHub ↗
(
  text: string,
  reviver?: (key: any, value: any) => any,
  prohibitedKeys?: string[],
)

Source from the content-addressed store, hash-verified

58 * @param prohibitedKeys - An array of keys to be rejected
59 */
60export function parseJson(
61 text: string,
62 reviver?: (key: any, value: any) => any,
63 prohibitedKeys?: string[],
64) {
65 prohibitedKeys = [
66 '__proto__',
67 'constructor.prototype',
68 ...(prohibitedKeys ?? []),
69 ];
70 return JSON.parse(text, sanitizeJsonParse(reviver, prohibitedKeys));
71}

Callers 2

parseJsonIfNeededFunction · 0.90
parse-json.unit.tsFile · 0.90

Calls 2

sanitizeJsonParseFunction · 0.85
parseMethod · 0.65

Tested by

no test coverage detected