export default function mapObjectValues( object: { [key: string]: T }, fn: (input: T) => R, ): { [key: string]: R } { const mappedObject: { [key: string]: R } = {}; Object.entries(object).forEach(([key, value]) => { mappedObject[key] = fn(value); }); return mappedObject; }