MCPcopy Create free account
hub / github.com/cortexkit/magic-context / parseJsonObject

Function parseJsonObject

packages/cli/src/commands/migrate.ts:216–222  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

214}
215
216function parseJsonObject<T>(text: string): T {
217 const parsed = JSON.parse(text);
218 if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
219 throw new Error("Expected JSON object");
220 }
221 return parsed as T;
222}
223
224function isoFromMs(ms: number | undefined, fallback: Date): string {
225 return new Date(

Callers 4

roleFromMessageFunction · 0.85
tokensFromMessageFunction · 0.85
extractModelFunction · 0.85
convertPartToEntriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected