Skip to content

Commit 7d5de44

Browse files
committed
docs: Remove unnecessary example that breaks CI
1 parent d83715f commit 7d5de44

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

util/_typeutil.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,19 @@ export type Promish<T> = T | Promise<T>;
66
/**
77
* Recursively flattens the nested structure of an object type, transforming
88
* each property to its resolved (non-nested) type.
9-
*
10-
* @example
11-
* ```ts
12-
* type Example = { a: { b: { c: string } } };
13-
* type FlatExample = FlatType<Example>; // { a: { b: { c: string } } }
14-
* ```
159
*/
1610
export type FlatType<T> = T extends Record<PropertyKey, unknown>
1711
? { [K in keyof T]: FlatType<T[K]> }
1812
: T;
1913

2014
/**
2115
* Extracts the first type in a tuple type.
22-
*
23-
* @example
24-
* ```ts
25-
* type First = FirstType<[string, number, boolean]>; // string
26-
* ```
2716
*/
2817
export type FirstType<T extends unknown[]> = T extends [infer F, ...infer _] ? F
2918
: never;
3019

3120
/**
3221
* Extracts the last type in a tuple type.
33-
*
34-
* @example
35-
* ```ts
36-
* type Last = LastType<[string, number, boolean]>; // boolean
37-
* ```
3822
*/
3923
export type LastType<T extends unknown[]> = T extends [...infer _, infer L] ? L
4024
: never;

0 commit comments

Comments
 (0)