Skip to content

Commit

Permalink
Replace bindCb by bindCb4 where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Feb 4, 2021
1 parent 341ad30 commit eaba5b5
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions modules/_createReduce.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import bindCb from './_bindCb.js';
import bindCb4 from './_bindCb4.js';

// Create a reducing function iterating in the same way as `loop` (e.g.
// `_.find`).
Expand All @@ -23,6 +23,6 @@ export default function createReduce(loop) {

return function(obj, iteratee, memo, context) {
var initial = arguments.length >= 3;
return reducer(obj, bindCb(iteratee, context), memo, initial);
return reducer(obj, bindCb4(iteratee, context), memo, initial);
};
}
4 changes: 2 additions & 2 deletions modules/each.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import bindCb from './_bindCb.js';
import bindCb4 from './_bindCb4.js';
import find from './find.js';

// The cornerstone for collection functions, an `each`
// implementation, aka `forEach`.
// Handles raw objects in addition to array-likes. Treats all
// sparse array-likes as if they were dense.
export default function each(obj, iteratee, context) {
iteratee = bindCb(iteratee, context);
iteratee = bindCb4(iteratee, context);
find(obj, function(value, key, obj) {
iteratee(value, key, obj);
// We omit the return value so that iteration continues until the end.
Expand Down
4 changes: 2 additions & 2 deletions modules/pick.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import restArguments from './restArguments.js';
import isFunction from './isFunction.js';
import bindCb from './_bindCb.js';
import bindCb4 from './_bindCb4.js';
import allKeys from './allKeys.js';
import keyInObj from './_keyInObj.js';
import flatten from './_flatten.js';
Expand All @@ -11,7 +11,7 @@ export default restArguments(function(obj, keys) {
var result = {}, iteratee = keys[0];
if (obj == null) return result;
if (isFunction(iteratee)) {
iteratee = bindCb(iteratee, keys[1]);
iteratee = bindCb4(iteratee, keys[1]);
keys = allKeys(obj);
} else {
iteratee = keyInObj;
Expand Down
4 changes: 2 additions & 2 deletions modules/times.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import bindCb from './_bindCb.js';
import bindCb4 from './_bindCb4.js';

// Run a function **n** times.
export default function times(n, iteratee, context) {
var accum = Array(Math.max(0, n));
iteratee = bindCb(iteratee, context);
iteratee = bindCb4(iteratee, context);
for (var i = 0; i < n; i++) accum[i] = iteratee(i);
return accum;
}
8 changes: 4 additions & 4 deletions underscore-esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion underscore-esm.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions underscore.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion underscore.js.map

Large diffs are not rendered by default.

0 comments on commit eaba5b5

Please # to comment.