Skip to content

Commit 8682fae

Browse files
authored
Update union_to_array_union.ts
1 parent c3da088 commit 8682fae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/type/union_to_array_union.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/**
22
* This type creates an array of each type in the Union.
33
*
4+
* @example
5+
* ```ts
6+
* type MyUnion = string | number | number[];
7+
* type MyArray = UnionToArrayUnion<MyUnion>;
8+
* // type MyArray = string[] | number[] | number[][];
9+
* ```
410
* @template Type The type of the union from which to create a new array type
511
*/
612
// deno-lint-ignore no-explicit-any

0 commit comments

Comments
 (0)