回答編集履歴
1
readonlyのつけ忘れ
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
type ToArray<T extends readonly unknown[]> = T extends [] ? []
|
10
10
|
|
11
|
-
: T extends [infer U, ...infer V] ? [U[], ...ToArray<V>]
|
11
|
+
: T extends readonly [infer U, ...infer V] ? [U[], ...ToArray<V>]
|
12
12
|
|
13
13
|
: T[];
|
14
14
|
|