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

Function updateAnimationInScript

packages/parsers/src/gsapParser.ts:1418–1434  ·  view source on GitHub ↗
(
  script: string,
  animationId: string,
  updates: Partial<GsapAnimation> & { easeEach?: string; resetKeyframeEases?: boolean },
)

Source from the content-addressed store, hash-verified

1416}
1417
1418export function updateAnimationInScript(
1419 script: string,
1420 animationId: string,
1421 updates: Partial<GsapAnimation> & { easeEach?: string; resetKeyframeEases?: boolean },
1422): string {
1423 let parsed: ParsedGsapAst;
1424 try {
1425 parsed = parseGsapAst(script);
1426 } catch (e) {
1427 console.warn("[gsap-parser] updateAnimationInScript parse failed:", e);
1428 return script;
1429 }
1430 const target = parsed.located.find((l) => l.id === animationId);
1431 if (!target) return script;
1432 applyUpdatesToCall(target.call, updates);
1433 return recast.print(parsed.ast).code;
1434}
1435
1436export function shiftPositionsInScript(
1437 script: string,

Calls 4

parseGsapAstFunction · 0.85
applyUpdatesToCallFunction · 0.85
warnMethod · 0.80
findMethod · 0.65

Tested by

no test coverage detected