mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Apply even more let/const transforms.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import arrayMap from './_arrayMap.js';
|
||||
import baseIntersection from './_baseIntersection.js';
|
||||
import baseRest from './_baseRest.js';
|
||||
import castArrayLikeObject from './_castArrayLikeObject.js';
|
||||
import last from './last.js';
|
||||
|
||||
@@ -25,9 +24,9 @@ import last from './last.js';
|
||||
* _.intersectionWith(objects, others, _.isEqual);
|
||||
* // => [{ 'x': 1, 'y': 2 }]
|
||||
*/
|
||||
var intersectionWith = baseRest(arrays => {
|
||||
var comparator = last(arrays),
|
||||
mapped = arrayMap(arrays, castArrayLikeObject);
|
||||
function intersectionWith(...arrays) {
|
||||
let comparator = last(arrays);
|
||||
const mapped = arrayMap(arrays, castArrayLikeObject);
|
||||
|
||||
comparator = typeof comparator == 'function' ? comparator : undefined;
|
||||
if (comparator) {
|
||||
@@ -36,6 +35,6 @@ var intersectionWith = baseRest(arrays => {
|
||||
return (mapped.length && mapped[0] === arrays[0])
|
||||
? baseIntersection(mapped, undefined, comparator)
|
||||
: [];
|
||||
});
|
||||
}
|
||||
|
||||
export default intersectionWith;
|
||||
|
||||
Reference in New Issue
Block a user