Bump to v4.2.0.

This commit is contained in:
John-David Dalton
2016-04-07 23:43:26 -07:00
parent 3c2a06a119
commit fdf249c94e
562 changed files with 23863 additions and 21738 deletions

View File

@@ -1,4 +1,4 @@
# lodash.sorteduniq v4.1.0
# lodash.sorteduniq v4.2.0
The [lodash](https://lodash.com/) method `_.sortedUniq` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var sortedUniq = require('lodash.sorteduniq');
```
See the [documentation](https://lodash.com/docs#sortedUniq) or [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash.sorteduniq) for more details.
See the [documentation](https://lodash.com/docs#sortedUniq) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.sorteduniq) for more details.

View File

@@ -6,7 +6,33 @@
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
var baseSortedUniq = require('lodash._basesorteduniq');
/**
* The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseSortedUniq(array, iteratee) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
if (!index || !eq(computed, seen)) {
var seen = computed;
result[resIndex++] = value === 0 ? 0 : value;
}
}
return result;
}
/**
* This method is like `_.uniq` except that it's designed and optimized
@@ -29,4 +55,40 @@ function sortedUniq(array) {
: [];
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
module.exports = sortedUniq;

View File

@@ -1,6 +1,6 @@
{
"name": "lodash.sorteduniq",
"version": "4.1.0",
"version": "4.2.0",
"description": "The lodash method `_.sortedUniq` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
@@ -13,8 +13,5 @@
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
],
"repository": "lodash/lodash",
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" },
"dependencies": {
"lodash._basesorteduniq": "~4.12.0"
}
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
}