MCPcopy Create free account
hub / github.com/cloudflare/agents / parseJsonFileContent

Function parseJsonFileContent

packages/shell/src/helpers.ts:124–131  ·  view source on GitHub ↗
(content: string, path: string)

Source from the content-addressed store, hash-verified

122}
123
124export function parseJsonFileContent(content: string, path: string): unknown {
125 try {
126 return JSON.parse(content) as unknown;
127 } catch (error) {
128 const message = error instanceof Error ? error.message : String(error);
129 throw new Error(`Invalid JSON in ${path}: ${message}`);
130 }
131}
132
133export function stringifyJsonFileContent(
134 value: unknown,

Callers 1

readJsonMethod · 0.90

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected