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

Function collectSamplingTargets

packages/cli/src/utils/motionAudit.ts:243–265  ·  view source on GitHub ↗
(assertions: MotionAssertion[])

Source from the content-addressed store, hash-verified

241 * Selectors feed the per-element matrix; scopes feed keepsMoving liveness.
242 */
243export function collectSamplingTargets(assertions: MotionAssertion[]): {
244 selectors: string[];
245 livenessScopes: string[];
246} {
247 const selectors = new Set<string>();
248 const scopes = new Set<string>();
249 for (const assertion of assertions) {
250 switch (assertion.kind) {
251 case "appearsBy":
252 case "staysInFrame":
253 selectors.add(assertion.selector);
254 break;
255 case "before":
256 selectors.add(assertion.a);
257 selectors.add(assertion.b);
258 break;
259 case "keepsMoving":
260 scopes.add(assertion.withinSelector ?? "*");
261 break;
262 }
263 }
264 return { selectors: [...selectors], livenessScopes: [...scopes] };
265}

Callers 2

runMotionPassFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected