I don’t think this will ever be true.
And I’m not sure this is a useful case.
I think perhaps you are confused about how the data is structured. You are working with a nested array. Each element is either A) an element on its own or B) a sub-array of elements. You should only have two cases.