MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / formatJSON

Function formatJSON

apps/web/ui/Message/BlockCode/utilities.ts:29–35  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

27}
28
29function formatJSON(code: string): string {
30 try {
31 return JSON.stringify(JSON.parse(code), null, 2);
32 } catch (exception) {
33 return code;
34 }
35}
36
37// list of known languages, generated via `highlight.listLanguages()
38

Callers 1

formatCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected