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

Function evaluateMotion

packages/cli/src/utils/motionAudit.ts:215–237  ·  view source on GitHub ↗
(
  frames: MotionFrame[],
  assertions: MotionAssertion[],
  canvas: Canvas,
)

Source from the content-addressed store, hash-verified

213 * inspect's existing dedupe/collapse/limit/format pipeline.
214 */
215export function evaluateMotion(
216 frames: MotionFrame[],
217 assertions: MotionAssertion[],
218 canvas: Canvas,
219): LayoutIssue[] {
220 if (frames.length === 0) return [];
221 return assertions.flatMap((assertion) => {
222 switch (assertion.kind) {
223 case "appearsBy":
224 return appearsBy(frames, assertion.selector, assertion.bySec);
225 case "before":
226 return before(frames, assertion.a, assertion.b);
227 case "staysInFrame":
228 return staysInFrame(frames, assertion.selector, canvas);
229 case "keepsMoving":
230 return keepsMoving(
231 frames,
232 assertion.withinSelector,
233 assertion.maxStaticSec ?? DEFAULT_MAX_STATIC_SEC,
234 );
235 }
236 });
237}
238
239/**
240 * Selectors and liveness scopes the in-page sampler must read for a spec.

Callers 2

runMotionPassFunction · 0.85

Calls 4

appearsByFunction · 0.85
beforeFunction · 0.85
staysInFrameFunction · 0.85
keepsMovingFunction · 0.85

Tested by

no test coverage detected