const transform = (transform) => {
let entries = Object.entries(transform);
let capsEntries = entries .map (([k, v]) => [k [0].toUpperCase () + k.slice(1), v])
let capsPopulations = Object.fromEntries(capsEntries);
return capsPopulations
}
console.log(transform({ london: 'text', beijing: 21.54, mumbai: {moscow:23 }}))
Исключать node_modules из правила с js стандартная практика