(points)
| 1600 | } |
| 1601 | |
| 1602 | function 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 | |
| 1622 | function uniqueUnitPoints(points) { |
| 1623 | const seen = new Set(); |
no outgoing calls
no test coverage detected