export function omit<T, U extends keyof T>(obj: T, keys: U[]): Omit<T, U> {
return Object.keys(obj).reduce(
(acc, curr) => (keys.includes(curr as U) ? acc : { ...acc, [curr]: obj[curr] }),
{}
) as Omit<T, U>;
}
Encountering an error with message
TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'unknown'.
The goal is to eliminate all error messages and ensure the function is correctly typed.