Solución
solution.tsTypeScript
interface User {
id: number;
name: string;
email: string;
}
type ReturnUpdateProfile = ReturnType<typeof updateProfile>;
// type ReturnUpdateProfile = User
export function updateProfile(current: User, changes: Partial<User>): User {
// Combina el usuario actual con los cambios y retorna el usuario actualizado
return { ...current, ...changes };
}0respuestas