Add baseUniqBy.

This commit is contained in:
John-David Dalton
2015-08-26 21:43:12 -07:00
parent d0b3b8de44
commit 936c5f5d3d

View File

@@ -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,