/
dany
/
ReshenijaBotInformationSite
Обзор
Документация
Войти
/
dany
/
ReshenijaBotInformationSite
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
node_modules/underscore/modules/_optimizeCb.js
21 строка
810 B
Daniil
Initial commit
31 окт 2023, 01:10
31 окт 2023, 01:10
a171ae1
Код
Авторство
О чём код?
// Internal function that returns an efficient (for current engines) version // of the passed-in callback, to be repeatedly applied in other Underscore // functions. export default function optimizeCb(func, context, argCount) { if (context === void 0) return func; switch (argCount == null ? 3 : argCount) { case 1: return function(value) { return func.call(context, value); }; // The 2-argument case is omitted because we’re not using it. case 3: return function(value, index, collection) { return func.call(context, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(context, accumulator, value, index, collection); }; } return function() { return func.apply(context, arguments); }; }