From b2403901b329e57641a791c387932a8aa1414001 Mon Sep 17 00:00:00 2001 From: Jake Son Date: Sun, 28 Nov 2021 21:58:23 +0900 Subject: [PATCH] test: add more type test of 'tail' --- src/types/Tail.ts | 2 +- type-check/types/Tail.test.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/Tail.ts b/src/types/Tail.ts index 7368570f..2f5aa5f9 100644 --- a/src/types/Tail.ts +++ b/src/types/Tail.ts @@ -1,3 +1,3 @@ -type Tail = T extends [any, ...infer B] ? B : []; +type Tail = T extends [any, ...infer U] ? U : []; export default Tail; diff --git a/type-check/types/Tail.test.ts b/type-check/types/Tail.test.ts index a0f15f59..28eedbef 100644 --- a/type-check/types/Tail.test.ts +++ b/type-check/types/Tail.test.ts @@ -8,4 +8,6 @@ checks([ check, [], Test.Pass>(), check, [2], Test.Pass>(), check, [2, 3], Test.Pass>(), + check, [2, "abc"], Test.Pass>(), + check, [number, boolean], Test.Pass>(), ]);