Apply even more let/const transforms.

This commit is contained in:
John-David Dalton
2017-01-09 12:23:34 -08:00
parent e6152a97e8
commit dc687c1d85
177 changed files with 433 additions and 437 deletions

View File

@@ -1,7 +1,6 @@
import arrayMap from './_arrayMap.js';
import baseIntersection from './_baseIntersection.js';
import baseIteratee from './_baseIteratee.js';
import baseRest from './_baseRest.js';
import castArrayLikeObject from './_castArrayLikeObject.js';
import last from './last.js';
@@ -28,9 +27,9 @@ import last from './last.js';
* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }]
*/
var intersectionBy = baseRest(arrays => {
var iteratee = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
function intersectionBy(...arrays) {
let iteratee = last(arrays);
const mapped = arrayMap(arrays, castArrayLikeObject);
if (iteratee === last(mapped)) {
iteratee = undefined;
@@ -40,6 +39,6 @@ var intersectionBy = baseRest(arrays => {
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, baseIteratee(iteratee, 2))
: [];
});
}
export default intersectionBy;