UNPKG

445 BTypeScriptView Raw
1import { Has } from '../Union/Has';
2import { List } from './List';
3/**
4 * Get the longest [[List]] of `L` & `L1`
5 * (`L` has priority if both lengths are equal)
6 * @param L to compare length
7 * @param L1 to compare length
8 * @returns `L | L1`
9 * @example
10 * ```ts
11 * ```
12 */
13export declare type Longest<L extends List, L1 extends List> = L extends unknown ? L1 extends unknown ? {
14 0: L1;
15 1: L;
16}[Has<keyof L, keyof L1>] : never : never;