export function pick(obj: T, ...keys: K[]): Pick { const filtered = {} as Pick keys.forEach((key) => { filtered[key] = obj[key] }) return filtered } export function exclude( obj: T, ...keys: K[] ): Omit { const filtered = { ...obj } keys.forEach((key) => { delete filtered[key] }) return filtered } export function keysOf>(obj: T) { return Object.keys(obj) as Array }