MCPcopy Create free account
hub / github.com/massCodeIO/massCode / parseJsonFile

Function parseJsonFile

src/main/import/snippets/vscode.ts:51–61  ·  view source on GitHub ↗
(file: ImportFile)

Source from the content-addressed store, hash-verified

49])
50
51function parseJsonFile(file: ImportFile): Record<string, unknown> | null {
52 try {
53 const parsed = JSON.parse(file.content)
54 return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
55 ? (parsed as Record<string, unknown>)
56 : null
57 }
58 catch {
59 return null
60 }
61}
62
63function getSnippetBody(value: unknown): string | null {
64 if (typeof value === 'string') {

Callers 1

parseVSCodeSnippetFilesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected