Thanks to visit codestin.com Credit goes to angular.dev
Gets the item type of an object that is possibly an array.
type ItemType<T extends Object> = T extends ReadonlyArray<any> ? T[number] : T[keyof T]