MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / asJsonObject

Function asJsonObject

packages/cli/src/auth/store.ts:331–336  ·  view source on GitHub ↗

Narrow `raw` to a plain JSON object or throw a labelled error.

(raw: unknown, label: string)

Source from the content-addressed store, hash-verified

329
330/** Narrow `raw` to a plain JSON object or throw a labelled error. */
331function asJsonObject(raw: unknown, label: string): Record<string, unknown> {
332 if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
333 throw ErrInvalidStore(`${label} must be a JSON object`);
334 }
335 return raw as Record<string, unknown>;
336}
337
338/**
339 * Return a shallow copy of every entry in `obj` whose key is not in

Callers 2

parseOAuthFunction · 0.85
parseUserFunction · 0.85

Calls 1

ErrInvalidStoreFunction · 0.85

Tested by

no test coverage detected