Code coverage report for src/map.js

Statements: 100% (46 / 46)      Branches: 100% (30 / 30)      Functions: 100% (3 / 3)      Lines: 100% (5 / 5)      Ignored: 6 statements, 5 branches     

All files » src/ » map.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15        17 17   168   168          
import identity from './identity';
 
 
function *map(xs, iteratee=identity, thisArg=undefined) {
    let fn = thisArg ? iteratee.bind(thisArg) : iteratee;
    let i = 0;
 
    for (let x of xs) {
        yield fn(x, i, xs);
        i += 1;
    }
}
 
export default map;