Add node modules and new code for release (#168)

Co-authored-by: OliverMKing <OliverMKing@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2022-02-02 10:11:19 -05:00
committed by GitHub
parent ca8d2604ac
commit a0f00e5017
8092 changed files with 1732166 additions and 149 deletions
+23
View File
@@ -0,0 +1,23 @@
// Internal function that returns an efficient (for current engines) version
// of the passed-in callback, to be repeatedly applied in other Underscore
// functions.
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 were 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);
};
}
module.exports = optimizeCb;