Bump to v4.0.4.

This commit is contained in:
John-David Dalton
2016-02-02 23:10:13 -08:00
parent 0152377457
commit 5f90c0b163
157 changed files with 2020 additions and 1541 deletions

View File

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

View File

@@ -33,27 +33,39 @@ var reIsOctal = /^0o[0-7]+$/i;
var freeParseInt = parseInt;
/**
* Gets the index at which the first occurrence of `NaN` is found in `array`.
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to search.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched `NaN`, else `-1`.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function indexOfNaN(array, fromIndex, fromRight) {
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 0 : -1);
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
var other = array[index];
if (other !== other) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
/** Used for built-in method references. */
var objectProto = Object.prototype;
@@ -104,7 +116,7 @@ function lastIndexOf(array, value, fromIndex) {
) + 1;
}
if (value !== value) {
return indexOfNaN(array, index, true);
return baseFindIndex(array, baseIsNaN, index - 1, true);
}
while (index--) {
if (array[index] === value) {
@@ -122,8 +134,7 @@ function lastIndexOf(array, value, fromIndex) {
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
@@ -206,8 +217,7 @@ function isObjectLike(value) {
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
@@ -259,7 +269,7 @@ function toFinite(value) {
/**
* Converts `value` to an integer.
*
* **Note:** This function is loosely based on
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
*
* @static

View File

@@ -1,6 +1,6 @@
{
"name": "lodash.lastindexof",
"version": "4.0.3",
"version": "4.0.4",
"description": "The lodash method `_.lastIndexOf` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",