Update: These checks are meant for compile time, not at runtime. In my example, the failed cases are all caught at compile
From Typescript: Can I define an n-length tuple type?, programmatically, with dynamic length:
type Tuple = [TItem, ...TItem[]] & { length: TLength }; type Tuple9 = Tuple;