I tried mapping a TypeScript Tuple into another Tuple using Array.map like so:
const tuple1: [number, number, number] = [1, 2, 3];
const tuple2: [number, number, number] = tuple1.map(x => x * 2);
console.log(tuple2);
But the typescript compiler is telling me this is not possible:
Type 'number[]' is not assignable to type '[number, number, number]'.
Target requires 3 element(s) but source may have fewer.
Is there a clean way to map a tuple into a new tuple without using Array.map or a way to use Array.map that the compiler does understand?