Is there a way to make only array type interface fields required, not all of them? The Required operator currently makes every field mandatory, but I specifically need just the array fields to be required.
`
interface IExample {
a: number,
b?: string,
c?: number[]
}
function getTest(data: IExample): Required<IExample> {
return {
...data,
c: data.c ?? []
}
}
//Issue arises as 'c' field is also being checked, even though it is not an array. How can we validate arrays only?
`
Appreciate any help or suggestions.
I've tried experimenting with tuples as a possible solution, but haven't been able to make it work so far.