Code coverage report for src/takeWhile.js

Statements: 100% (47 / 47)      Branches: 100% (26 / 26)      Functions: 100% (2 / 2)      Lines: 100% (5 / 5)      Ignored: 6 statements, 3 branches     

All files » src/ » takeWhile.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  6 6   22             17          
function *takeWhile(xs, iteratee, thisArg) {
    let fn = thisArg ? iteratee.bind(thisArg) : iteratee;
    let i = 0;
 
    for (let x of xs) {
        if (fn(x, i, xs)) {
            yield x;
        } else {
            break;
        }
 
        i += 1;
    }
}
 
export default takeWhile;