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

Function buildKeyframeValueNode

packages/parsers/src/gsapParser.ts:1993–2003  ·  view source on GitHub ↗

Build a keyframe value AST node from properties and optional ease.

(
  properties: Record<string, number | string>,
  ease?: string,
)

Source from the content-addressed store, hash-verified

1991
1992/** Build a keyframe value AST node from properties and optional ease. */
1993function buildKeyframeValueNode(
1994 properties: Record<string, number | string>,
1995 ease?: string,
1996): AstNode {
1997 const effectiveEase = ease ?? (typeof properties.ease === "string" ? properties.ease : undefined);
1998 const entries = Object.entries(properties)
1999 .filter(([k]) => k !== "ease")
2000 .map(([k, v]) => `${safeKey(k)}: ${valueToCode(v)}`);
2001 if (effectiveEase) entries.push(`ease: ${JSON.stringify(effectiveEase)}`);
2002 return parseExpr(`{ ${entries.join(", ")} }`);
2003}
2004
2005/** Parse + locate a target animation, returning null on failure. */
2006function locateAnimation(

Callers 2

addKeyframeToScriptFunction · 0.85
updateKeyframeInScriptFunction · 0.85

Calls 4

safeKeyFunction · 0.85
valueToCodeFunction · 0.85
parseExprFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected