type ValueOf<T> = T extends any[] ? T[number] : T[KeyOf<T>]
Extracts the value types from an object or array
Extracts the value types from an object or array