mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Remove remaining rest helper use.
This commit is contained in:
5
cond.js
5
cond.js
@@ -1,7 +1,6 @@
|
||||
import apply from './_apply.js';
|
||||
import arrayMap from './_arrayMap.js';
|
||||
import baseIteratee from './_baseIteratee.js';
|
||||
import baseRest from './_baseRest.js';
|
||||
|
||||
/** Error message constants. */
|
||||
const FUNC_ERROR_TEXT = 'Expected a function';
|
||||
@@ -46,7 +45,7 @@ function cond(pairs) {
|
||||
return [toIteratee(pair[0]), pair[1]];
|
||||
});
|
||||
|
||||
return baseRest(function(args) {
|
||||
return (...args) => {
|
||||
let index = -1;
|
||||
while (++index < length) {
|
||||
const pair = pairs[index];
|
||||
@@ -54,7 +53,7 @@ function cond(pairs) {
|
||||
return apply(pair[1], this, args);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default cond;
|
||||
|
||||
Reference in New Issue
Block a user