From 257d957dfb9febfb1517c2a6ef5f55876d352f85 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 30 Aug 2015 05:11:35 -0700 Subject: [PATCH] Add `baseSortedUniqBy`. --- lodash.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index 7025fe642..b3734d1ee 100644 --- a/lodash.js +++ b/lodash.js @@ -2586,15 +2586,26 @@ } /** - * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without - * support for callback shorthands. + * The base implementation of `_.sortedUniq`. + * + * @private + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array) { + return baseSortedUniqBy(array); + } + + /** + * The base implementation of `_.sortedUniqBy` 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 baseSortedUniq(array, iteratee) { + function baseSortedUniqBy(array, iteratee) { var length = array.length; if (!length) { return []; @@ -5167,7 +5178,7 @@ */ function sortedUniqBy(array, iteratee) { return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee)) + ? baseSortedUniqBy(array, getIteratee(iteratee)) : []; }