Code coverage report for src/flattenDeep.js

Statements: 100% (51 / 51)      Branches: 100% (31 / 31)      Functions: 100% (2 / 2)      Lines: 100% (2 / 2)      Ignored: 6 statements, 4 branches     

All files » src/ » flattenDeep.js
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;