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

Function createPaddableMockTimeline

packages/core/src/runtime/init.test.ts:36–47  ·  view source on GitHub ↗
(duration: number)

Source from the content-addressed store, hash-verified

34}
35
36function createPaddableMockTimeline(duration: number): RuntimeTimelineLike {
37 const timeline = createMockTimeline(duration) as RuntimeTimelineLike & {
38 to: (_target: object, vars: { duration: number }, position: number) => void;
39 };
40 const baseDuration = timeline.duration;
41 let paddedDuration = baseDuration();
42 timeline.duration = () => paddedDuration;
43 timeline.to = (_target, vars, position) => {
44 paddedDuration = Math.max(paddedDuration, position + Math.max(0, Number(vars.duration) || 0));
45 };
46 return timeline;
47}
48
49function createManualRaf() {
50 let now = 0;

Callers 1

init.test.tsFile · 0.85

Calls 1

createMockTimelineFunction · 0.70

Tested by

no test coverage detected