In typescript how would I create a conditional type that states:
If array has x
then it must also have y
and z
.
Example:
const allGroups = [ 'w', 'x', 'y', 'z']
const group1 = [ 'w' ] // valid
const group2 = [ 'x' ] // invalid
const group3 = [ 'x', 'y' ] // invalid
const group4 = [ 'x', 'y', 'z' ] // valid