MCPcopy Index your code
hub / github.com/simstudioai/sim / parseJson

Function parseJson

apps/sim/lib/credentials/client-state.ts:23–30  ·  view source on GitHub ↗
(raw: string | null)

Source from the content-addressed store, hash-verified

21}
22
23function parseJson<T>(raw: string | null): T | null {
24 if (!raw) return null
25 try {
26 return JSON.parse(raw) as T
27 } catch {
28 return null
29 }
30}
31
32export function readPendingOAuthCredentialDraft(): PendingOAuthCredentialDraft | null {
33 if (typeof window === 'undefined') return null

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected