(meta)
| 1713 | } |
| 1714 | |
| 1715 | function formatSourceBadgeText(meta) { |
| 1716 | const name = String(meta?.name || '').trim(); |
| 1717 | const typeLabel = formatSourceTypeLabel(meta?.type || ''); |
| 1718 | if (typeLabel && name) { |
| 1719 | if (typeLabel.toLowerCase() === name.toLowerCase()) return name; |
| 1720 | return `${typeLabel}: ${name}`; |
| 1721 | } |
| 1722 | return name || typeLabel; |
| 1723 | } |
| 1724 | |
| 1725 | function setSourceBadge(titleEl, sourceId) { |
| 1726 | if (!titleEl) return; |
no test coverage detected