export const mapValues = ( object: T, fn: (value: T[keyof T]) => U, ): Record => { const entries = Object.entries(object).map(([key, value]) => [ key, fn(value), ]); return Object.fromEntries(entries); };