Skip to content

Commit

Permalink
fix(ArrayTail): not working with optional parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ferferga authored Nov 7, 2024
1 parent b93f54a commit aa822e7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions source/array-tail.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type {UnknownArrayOrTuple} from './internal';

/**
Extracts the type of an array or tuple minus the first element.
Expand All @@ -22,4 +20,4 @@ add3(4);
@category Array
*/
export type ArrayTail<TArray extends UnknownArrayOrTuple> = TArray extends readonly [unknown, ...infer Tail] ? Tail : [];
export type ArrayTail<TArray> = TArray extends readonly [] ? TArray : TArray extends readonly [unknown?, ...infer Tail] ? Tail : TArray;

0 comments on commit aa822e7

Please sign in to comment.