2020-03-04から1日間の記事一覧

TypeScript で型レベル Permutations

遊びです. 真に受けないでください. 動作確認している TypeScript のバージョンは 3.8.3 です. ゴール タプル型 XS から, 要素の置換 (permutations) の union 型を作る Permutations<XS> を作ります. type P = Permutations<["A", "B", "C"]>; // P = ["A", "B"</xs>…