Simple ~1 liner to do this with Object.entries and Object.fromEntries as well.
Object.entries
Object.fromEntries
const renameKey = (obj, oldKey, newKey) => Object.fromEntries(Object.entries(obj).map(([key, value]) => [ key === oldKey ? newKey : key, value ]));