123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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';
- var intersectionBy = baseRest(function(arrays) {
- var iteratee = last(arrays),
- mapped = arrayMap(arrays, castArrayLikeObject);
- if (iteratee === last(mapped)) {
- iteratee = undefined;
- } else {
- mapped.pop();
- }
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped, baseIteratee(iteratee, 2))
- : [];
- });
- export default intersectionBy;
|