typescript conditional type extends array