Fix Record|Map label lookup typing for the leadership filter summary.

Narrow after the Map check so tsc accepts Record index access on the push gate.
This commit is contained in:
Francisco Ignácio Fontoura Solla 2026-07-28 01:48:18 -03:00
parent aa11262104
commit e87c0aa059

View file

@ -147,7 +147,8 @@ const municipalityLabel = (
): string => {
if (!labels) return `Município #${id}`
if (labels instanceof Map) return labels.get(id) ?? `Município #${id}`
return labels[id] ?? `Município #${id}`
const record = labels as Readonly<Record<number, string>>
return record[id] ?? `Município #${id}`
}
export const formatLeadershipActiveFiltersSummary = (