After extensive searching online, I have yet to find a suitable solution for my problem. Here is a simplified outline of what I am attempting to achieve:
interface list {
people: Person | Array<Person>
}
interface officialList {
people: Array<Person>
}
toOfficialList(list: List): officialList {
//Seeking method to determine if the list.people consists of a single person or an array of people
//Function will return an official list, converting "Person" into "[Person]"
}
If a list containing an array of people is inputted, the function will not need to make any changes and can simply return the same list.
However, if the list has only one person in it, the function should convert that individual into an array with one element.