/** * Replaces the keys of an object with the result of the callback function. * @param obj The object to replace the keys of. * @param callback The callback function to replace the keys with. * @since 0.11.0 */ export function replaceObjKeys( obj: Record, callback: (key: O) => N, ): Record { const result = {} as Record; for (const key in obj) { result[callback(key)] = obj[key]; } return result; }