UNPKG

449 BTypeScriptView Raw
1/**
2 * Merge two arrays, their elements uniqueness decided by the callback.
3 * In case of a duplicate, elements of `arr2` are taken.
4 * If there is a duplicate within an array, the last element is being taken.
5 * @param arr1 Base array
6 * @param arr2 Array to overwrite the first one if there is a match
7 * @param cb The function to calculate uniqueness
8 */
9export declare function mergeBy<T>(arr1: T[], arr2: T[], cb: (element: T) => string): T[];