UNPKG

lenye_base

Version:

基础方法

13 lines (10 loc) 436 B
import { b as _toConsumableArray } from './internal/_rollupPluginBabelHelpers.js'; /** * Returns every element that exists in any of the two arrays once, * after applying the provided function to each array element of both. */ var unionBy = (a, b, fn) => { var s = new Set(a.map(fn)); return Array.from(new Set([].concat(_toConsumableArray(a), _toConsumableArray(b.filter(x => !s.has(fn(x))))))); }; export default unionBy;