mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07: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';
|
||||
|
||||
/**
|
||||
@@ -20,11 +19,11 @@ import castArrayLikeObject from './_castArrayLikeObject.js';
|
||||
* _.intersection([2, 1], [2, 3]);
|
||||
* // => [2]
|
||||
*/
|
||||
var intersection = baseRest(arrays => {
|
||||
var mapped = arrayMap(arrays, castArrayLikeObject);
|
||||
function intersection(...arrays) {
|
||||
const mapped = arrayMap(arrays, castArrayLikeObject);
|
||||
return (mapped.length && mapped[0] === arrays[0])
|
||||
? baseIntersection(mapped)
|
||||
: [];
|
||||
});
|
||||
}
|
||||
|
||||
export default intersection;
|
||||
|
||||
Reference in New Issue
Block a user