npmtest-auto-install (v0.0.1)

Code coverage report for node-npmtest-auto-install/auto-install/src/includes-polyfill.js

Statements: 80.95% (17 / 21)      Branches: 70.59% (12 / 17)      Functions: 100% (1 / 1)      Lines: 85% (17 / 20)      Ignored: none     

All files » node-npmtest-auto-install/auto-install/src/ » includes-polyfill.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311 915       915 915 915 2   913 913 913 913         913 913 60005 60005   612   59393   301      
Array.prototype.includes = function includes(searchElement) {
    Iif (this == null) {
        throw new TypeError('Array.prototype.includes called on null or undefined');
    }
 
    let O = Object(this);
    let len = parseInt(O.length, 10) || 0;
    if (len === 0) {
        return false;
    }
    let n = parseInt(arguments[1], 10) || 0;
    let k;
    Eif (n >= 0) {
        k = n;
    } else {
        k = len + n;
        if (k < 0) { k = 0; }
    }
    let currentElement;
    while (k < len) {
        currentElement = O[k];
        if (searchElement === currentElement ||
     (searchElement !== searchElement && currentElement !== currentElement)) { // NaN !== NaN
            return true;
        }
        k++;
    }
    return false;
};