| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 72 | function *flattenDeep(xs) {
if (typeof xs === 'string' && xs.length === 1) {
yield xs;
} else {
for (let x of xs) {
if (x && x[Symbol.iterator]) {
yield *flattenDeep(x, x);
} else {
yield x;
}
}
}
}
export default flattenDeep;
|