(assertions: MotionAssertion[])
| 241 | * Selectors feed the per-element matrix; scopes feed keepsMoving liveness. |
| 242 | */ |
| 243 | export 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 | } |
no test coverage detected