mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Continue to use more ES2015.
This commit is contained in:
@@ -27,12 +27,12 @@ import last from './last.js';
|
||||
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
|
||||
* // => [{ 'x': 1 }, { 'x': 2 }]
|
||||
*/
|
||||
const unionBy = (...arrays) => {
|
||||
function unionBy(...arrays) {
|
||||
let iteratee = last(arrays);
|
||||
if (isArrayLikeObject(iteratee)) {
|
||||
iteratee = undefined;
|
||||
}
|
||||
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2));
|
||||
};
|
||||
}
|
||||
|
||||
export default unionBy;
|
||||
|
||||
Reference in New Issue
Block a user