MCPcopy Create free account
hub / github.com/Microck/opencode-studio / validateJson

Function validateJson

client-next/src/app/config/page.tsx:35–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33 };
34
35 const validateJson = (): boolean => {
36 try {
37 JSON.parse(content);
38 return true;
39 } catch (e) {
40 setError(`Invalid JSON: ${(e as Error).message}`);
41 return false;
42 }
43 };
44
45 const handleSave = async () => {
46 if (!validateJson()) return;

Callers 1

handleSaveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected