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

Function stringifyJsonFileContent

packages/shell/src/helpers.ts:133–143  ·  view source on GitHub ↗
(
  value: unknown,
  path: string,
  spaces = 2
)

Source from the content-addressed store, hash-verified

131}
132
133export function stringifyJsonFileContent(
134 value: unknown,
135 path: string,
136 spaces = 2
137): string {
138 const serialized = JSON.stringify(value, null, spaces);
139 if (serialized === undefined) {
140 throw new Error(`Unable to serialize JSON for ${path}`);
141 }
142 return serialized + "\n";
143}
144
145export function searchTextContent(
146 content: string,

Callers 2

writeJsonMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected