mirror of
https://github.com/hanzoai/prettier.git
synced 2026-09-24 17:02:04 +00:00
11 lines
201 B
JavaScript
11 lines
201 B
JavaScript
/* @flow */
|
|
|
|
type NestedArray<T> = Array<T | NestedArray<T>>;
|
|
|
|
function flatten<T>(arrArg: NestedArray<T>) {
|
|
let arr = arrArg;
|
|
while (true) {
|
|
arr = Array.prototype.concat.apply([], arr);
|
|
}
|
|
}
|