From aa822e7466b248ef418f23bc580636da352f19f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Thu, 7 Nov 2024 17:40:57 +0100 Subject: [PATCH] fix(ArrayTail): not working with optional parameters --- source/array-tail.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/array-tail.d.ts b/source/array-tail.d.ts index efac9c497..6ed076ba2 100644 --- a/source/array-tail.d.ts +++ b/source/array-tail.d.ts @@ -1,5 +1,3 @@ -import type {UnknownArrayOrTuple} from './internal'; - /** Extracts the type of an array or tuple minus the first element. @@ -22,4 +20,4 @@ add3(4); @category Array */ -export type ArrayTail = TArray extends readonly [unknown, ...infer Tail] ? Tail : []; +export type ArrayTail = TArray extends readonly [] ? TArray : TArray extends readonly [unknown?, ...infer Tail] ? Tail : TArray;