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

Function readVariableDefault

packages/sdk/src/engine/variableModel.ts:40–45  ·  view source on GitHub ↗
(document: Document, id: string)

Source from the content-addressed store, hash-verified

38 * the attribute is absent, the JSON is invalid, or no entry matches the id.
39 */
40export function readVariableDefault(document: Document, id: string): unknown {
41 const decls = readDecls(document);
42 if (!decls) return undefined;
43 const idx = indexOfId(decls.arr, id);
44 return idx < 0 ? undefined : decls.arr[idx]?.default;
45}
46
47/**
48 * Upsert a variable's `default`. No-ops (returns false) when the attribute is

Callers 1

handleSetVariableValueFunction · 0.85

Calls 2

readDeclsFunction · 0.85
indexOfIdFunction · 0.85

Tested by

no test coverage detected