MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / uniquePoints

Function uniquePoints

scripts/integration/cli.mjs:1602–1620  ·  view source on GitHub ↗
(points)

Source from the content-addressed store, hash-verified

1600}
1601
1602function uniquePoints(points) {
1603 const seen = new Set();
1604 const unique = [];
1605 for (const point of points) {
1606 if (!Number.isFinite(point.x) || !Number.isFinite(point.y)) {
1607 continue;
1608 }
1609 const rounded = {
1610 x: Math.round(point.x),
1611 y: Math.round(point.y),
1612 };
1613 const key = `${rounded.x},${rounded.y}`;
1614 if (!seen.has(key)) {
1615 seen.add(key);
1616 unique.push(rounded);
1617 }
1618 }
1619 return unique;
1620}
1621
1622function uniqueUnitPoints(points) {
1623 const seen = new Set();

Callers 2

buttonCandidatePointsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected