(rating)
| 98 | } |
| 99 | |
| 100 | export function formatRatingStars(rating) { |
| 101 | const numeric = Number(rating); |
| 102 | if (!Number.isFinite(numeric) || numeric < 1) { |
| 103 | return null; |
| 104 | } |
| 105 | |
| 106 | const clamped = Math.min(5, Math.max(1, Math.round(numeric))); |
| 107 | return `${'⭐'.repeat(clamped)} (${clamped}/5)`; |
| 108 | } |
| 109 | |
| 110 | export async function resolveUserAuthor(client, userId) { |
| 111 | if (!userId) { |
no outgoing calls
no test coverage detected