(kind, type, title, detail = "")
| 1637 | const raw = Number(value); |
| 1638 | if (!Number.isFinite(raw)) return 80; |
| 1639 | const percentage = raw > 0 && raw <= 1 ? raw * 100 : raw; |
| 1640 | return Math.max(0, Math.min(100, Math.round(percentage))); |
| 1641 | } |
| 1642 | |
| 1643 | function paperDisplayTags(paper) { |
| 1644 | const rawCategories = Array.isArray(paper?.categories) |
| 1645 | ? paper.categories |
| 1646 | : String(paper?.categories || "").split(/[,;]\s*/); |
| 1647 | const categories = rawCategories |
| 1648 | .map((item) => String(item || "").trim()) |
| 1649 | .filter((item) => item && /^[a-z-]+(\.[A-Z]{2})?$/i.test(item)) |
| 1650 | .slice(0, 4); |
| 1651 | if (categories.length) return categories; |
no test coverage detected