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

Function uniqueUnitPoints

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

Source from the content-addressed store, hash-verified

1620}
1621
1622function uniqueUnitPoints(points) {
1623 const seen = new Set();
1624 const unique = [];
1625 for (const point of points) {
1626 if (!Number.isFinite(point.x) || !Number.isFinite(point.y)) {
1627 continue;
1628 }
1629 const rounded = {
1630 x: Math.max(0, Math.min(1, Number(point.x.toFixed(4)))),
1631 y: Math.max(0, Math.min(1, Number(point.y.toFixed(4)))),
1632 };
1633 const key = `${rounded.x},${rounded.y}`;
1634 if (!seen.has(key)) {
1635 seen.add(key);
1636 unique.push(rounded);
1637 }
1638 }
1639 return unique;
1640}
1641
1642function looksLikeOpenUrlPrompt(snapshot) {
1643 return (

Callers 1

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected