Sometimes you get a dictionary with unknown values. You can treat it as a record of unknown and then check each value.
Count how many entries are exactly true. Skip everything else. Return 0 for empty input.
function countYes(m: { [k: string]: unknown }) {
let c = 0;
for (const k in m) if (m[k] === true) c++;
return c;
}
Build a function that counts true values in a map with unknown values.