mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Apply even more let/const transforms.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user