mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Add baseUniqBy.
This commit is contained in:
17
lodash.js
17
lodash.js
@@ -2658,15 +2658,26 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.uniq` and `_.uniqBy` without support for
|
* The base implementation of `_.uniq`.
|
||||||
* callback shorthands.
|
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array} array The array to inspect.
|
* @param {Array} array The array to inspect.
|
||||||
* @param {Function} [iteratee] The function invoked per iteration.
|
* @param {Function} [iteratee] The function invoked per iteration.
|
||||||
* @returns {Array} Returns the new duplicate free array.
|
* @returns {Array} Returns the new duplicate free array.
|
||||||
*/
|
*/
|
||||||
function baseUniq(array, iteratee) {
|
function baseUniq(array) {
|
||||||
|
return baseUniqBy(array);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.uniqBy` without support for callback shorthands.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array} array The array to inspect.
|
||||||
|
* @param {Function} [iteratee] The function invoked per iteration.
|
||||||
|
* @returns {Array} Returns the new duplicate free array.
|
||||||
|
*/
|
||||||
|
function baseUniqBy(array, iteratee) {
|
||||||
var index = -1,
|
var index = -1,
|
||||||
indexOf = getIndexOf(),
|
indexOf = getIndexOf(),
|
||||||
length = array.length,
|
length = array.length,
|
||||||
|
|||||||
Reference in New Issue
Block a user