UNPKG

810 BJavaScriptView Raw
1/**
2 * @ignore
3 */
4export function bindCallback(func, thisArg, argCount) {
5 if (typeof thisArg === 'undefined') {
6 return func;
7 }
8 switch (argCount) {
9 case 0:
10 return function () {
11 return func.call(thisArg);
12 };
13 case 1:
14 return function (arg) {
15 return func.call(thisArg, arg);
16 };
17 case 2:
18 return function (value, index) {
19 return func.call(thisArg, value, index);
20 };
21 case 3:
22 return function (value, index, collection) {
23 return func.call(thisArg, value, index, collection);
24 };
25 }
26 return function () {
27 return func.apply(thisArg, arguments);
28 };
29}
30
31//# sourceMappingURL=bindcallback.mjs.map