1 | import { List } from './List';
|
2 | import { _UnNest } from './UnNest';
|
3 | import { Cast } from '../Any/Cast';
|
4 | import { Equals } from '../Any/Equals';
|
5 | import { Iteration } from '../Iteration/Iteration';
|
6 | import { IterationOf } from '../Iteration/IterationOf';
|
7 | import { Extends } from '../Any/Extends';
|
8 | import { Next } from '../Iteration/Next';
|
9 | import { Or } from '../Boolean/Or';
|
10 | import { Boolean } from '../Boolean/_Internal';
|
11 |
|
12 |
|
13 |
|
14 | declare type __Flatten<L extends List, LO extends List, strict extends Boolean, limit extends Iteration, I extends Iteration = IterationOf<0>> = {
|
15 | 0: __Flatten<_UnNest<L, strict>, L, strict, limit, Next<I>>;
|
16 | 1: L;
|
17 | }[Or<Equals<L, LO>, Extends<limit, I>>];
|
18 |
|
19 |
|
20 |
|
21 | export declare type _Flatten<L extends List, strict extends Boolean, limit extends number = number> = __Flatten<L, [], strict, IterationOf<limit>> extends infer X ? Cast<X, List> : never;
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export declare type Flatten<L extends List, strict extends Boolean = 1, limit extends number = number> = L extends unknown ? _Flatten<L, strict, limit> : never;
|
33 | export {};
|