import { type FlattenDeep } from "https://deno.land/x/fonction@v2.1.0-beta.4/src/flattenDeep.ts";
Infer deep flatted array.
Examples
Example 1
Example 1
FlattenDeep<[]> // []
FlattenDeep<[[1, [2, [3, [4]], 5]]> // [1, 2, 3, 4, 5]
definition: T extends readonly [infer A, ...infer Rest] ? A extends readonly unknown[] ? [...FlattenDeep<A>, ...FlattenDeep<Rest>] : [A, ...FlattenDeep<Rest>] : [...T]