Sha256: 8d531a82e2bd8150e5e50b7e2237fcef5163fd4ee63919ec3b1aca73b2420d9e

Contents?: true

Size: 698 Bytes

Versions: 277

Compression:

Stored size: 698 Bytes

Contents

var baseIteratee = require('./_baseIteratee'),
    baseSortedUniq = require('./_baseSortedUniq');

/**
 * This method is like `_.uniqBy` except that it's designed and optimized
 * for sorted arrays.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Array
 * @param {Array} array The array to inspect.
 * @param {Function} [iteratee] The iteratee invoked per element.
 * @returns {Array} Returns the new duplicate free array.
 * @example
 *
 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
 * // => [1.1, 2.3]
 */
function sortedUniqBy(array, iteratee) {
  return (array && array.length)
    ? baseSortedUniq(array, baseIteratee(iteratee, 2))
    : [];
}

module.exports = sortedUniqBy;

Version data entries

277 entries across 275 versions & 31 rubygems

Version Path
sumomo-0.8.17 data/sumomo/api_modules/node_modules/lodash/sortedUniqBy.js
sumomo-0.8.16 data/sumomo/api_modules/node_modules/lodash/sortedUniqBy.js
disco_app-0.18.0 test/dummy/node_modules/lodash/sortedUniqBy.js
disco_app-0.18.2 test/dummy/node_modules/lodash/sortedUniqBy.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/lodash/sortedUniqBy.js
trusty-cms-5.0.7 node_modules/lodash/sortedUniqBy.js
appmap-0.72.2 ./node_modules/lodash/sortedUniqBy.js
trusty-cms-5.0.6 node_modules/lodash/sortedUniqBy.js
appmap-0.72.1 ./node_modules/lodash/sortedUniqBy.js
appmap-0.72.0 ./node_modules/lodash/sortedUniqBy.js
trusty-cms-5.0.5 node_modules/lodash/sortedUniqBy.js
trusty-cms-5.0.4 node_modules/lodash/sortedUniqBy.js
appmap-0.71.0 ./node_modules/lodash/sortedUniqBy.js
disco_app-0.16.1 test/dummy/node_modules/lodash/sortedUniqBy.js
appmap-0.70.2 ./node_modules/lodash/sortedUniqBy.js
sumomo-0.8.14 data/sumomo/api_modules/node_modules/lodash/sortedUniqBy.js
appmap-0.70.1 ./node_modules/lodash/sortedUniqBy.js
appmap-0.70.0 ./node_modules/lodash/sortedUniqBy.js
appmap-0.69.0 ./node_modules/lodash/sortedUniqBy.js
sumomo-0.8.13 data/sumomo/api_modules/node_modules/lodash/sortedUniqBy.js