type ReturnType = T extends [infer L, ...infer R] ? [...(L extends any[] ? ReturnType : [L]), ...ReturnType] : []; /** * 将数组扁 arr 平化处理。 * @param 待处理集合 * @returns 扁平化处理后的结果 * @see {@link https://hyhello.github.io/utils/#/flatten 在线文档} */ export default function flatten(arr: T, depth?: number | boolean): T | ReturnType; export {};