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

Function objectExpressionToRecord

packages/parsers/src/gsapParser.ts:345–361  ·  view source on GitHub ↗
(node: AstNode, scope: ScopeBindings)

Source from the content-addressed store, hash-verified

343}
344
345function objectExpressionToRecord(node: AstNode, scope: ScopeBindings): Record<string, unknown> {
346 const result: Record<string, unknown> = {};
347 if (node?.type !== "ObjectExpression") return result;
348 for (const prop of node.properties ?? []) {
349 if (prop.type !== "ObjectProperty" && prop.type !== "Property") continue;
350 const key = prop.key?.name ?? prop.key?.value;
351 if (!key) continue;
352 const resolved = resolveNode(prop.value, scope);
353 if (resolved !== undefined) {
354 result[key] = resolved;
355 } else {
356 // Preserve unresolvable values as raw source text so they survive round-trips
357 result[key] = `__raw:${recast.print(prop.value).code}`;
358 }
359 }
360 return result;
361}
362
363// ── Timeline Variable Detection ─────────────────────────────────────────────
364

Callers 9

extractTimelineDefaultsFunction · 0.70
parsePercentageKeyframesFunction · 0.70
parseMotionPathNodeFunction · 0.70
tweenCallToAnimationFunction · 0.70
addKeyframeToScriptFunction · 0.70
removeKeyframeFromScriptFunction · 0.70

Calls 1

resolveNodeFunction · 0.70

Tested by

no test coverage detected