Code coverage report for cjs/util/bindCallback.js

Statements: 100% (15 / 15)      Branches: 100% (6 / 6)      Functions: 100% (6 / 6)      Lines: 100% (15 / 15)      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 291 189 171   18   2 2     2 2     10 32     2 2     2 2     1    
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);
    };
}
exports.bindCallback = bindCallback;
;
//# sourceMappingURL=bindCallback.js.map