Code coverage report for cjs/util/bindCallback.js

Statements: 52.94% (9 / 17)      Branches: 50% (3 / 6)      Functions: 33.33% (2 / 6)      Lines: 52.94% (9 / 17)      Ignored: none     

All files » cjs/util/ » bindCallback.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 31 32 33 34 35 36    1 1   1 165 158   7                   7 27                           1  
'use strict';
 
exports.__esModule = true;
exports['default'] = bindCallback;
 
function bindCallback(func, thisArg, argCount) {
    if (typeof thisArg === 'undefined') {
        return func;
    }
    switch (argCount) {
        case 0:
            return function () {
                return func.call(thisArg);
            };
        case 1:
            return function (arg) {
                return func.call(thisArg, arg);
            };
        case 2:
            return function (value, index) {
                return func.call(thisArg, value, index);
            };
        case 3:
            return function (value, index, collection) {
                return func.call(thisArg, value, index, collection);
            };
    }
    return function () {
        return func.apply(thisArg, arguments);
    };
}
 
;
//# sourceMappingURL=bindCallback.js.map
module.exports = exports['default'];
//# sourceMappingURL=bindCallback.js.map