1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

continue typescript & chakra v1 migrations [skip ci]

This commit is contained in:
checktheroads
2020-12-13 01:49:13 -07:00
parent 59e767e501
commit 8c454cf0ae
20 changed files with 119 additions and 157 deletions

View File

@@ -6,3 +6,9 @@ export function all(...iter: any[]) {
}
return true;
}
export function flatten<T extends unknown>(arr: any[][]): T[] {
return arr.reduce(function (flat, toFlatten) {
return flat.concat(Array.isArray(toFlatten) ? flatten(toFlatten) : toFlatten);
}, []);
}