I've nested array of object, how can I refactor typeScript? imagine I have more than 2 property on 1 level, it would have so many more code duplication.
type Option = {
id: string
name: string
childOptions?: {
id: string
name: string
}[]
}