MCPcopy Index your code
hub / github.com/callstack/agent-device / buildScrollStateSignature

Function buildScrollStateSignature

src/utils/scroll-edge-state.ts:275–295  ·  view source on GitHub ↗
(nodes: SnapshotNode[])

Source from the content-addressed store, hash-verified

273}
274
275function buildScrollStateSignature(nodes: SnapshotNode[]): string {
276 return nodes
277 .map((node) => {
278 const rectSignature = node.rect
279 ? ['x', 'y', 'width', 'height']
280 .map((key) =>
281 roundSignatureNumber(node.rect?.[key as keyof NonNullable<SnapshotNode['rect']>]),
282 )
283 .join(',')
284 : '';
285 return [
286 String(node.index ?? ''),
287 String(node.parentIndex ?? ''),
288 String(node.type ?? ''),
289 String(node.label ?? ''),
290 String(node.value ?? ''),
291 rectSignature,
292 ].join('|');
293 })
294 .join('\n');
295}
296
297function compareSpecificScrollContainer(a: SnapshotNode, b: SnapshotNode): number {
298 return rectArea(a.rect) - rectArea(b.rect);

Callers 1

analyzeScrollEdgeStateFunction · 0.85

Calls 1

roundSignatureNumberFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…