Bump to v4.11.1.

This commit is contained in:
John-David Dalton
2016-05-12 00:21:19 -07:00
parent ca37606709
commit bbba424ef1
4 changed files with 71 additions and 43 deletions

View File

@@ -1,4 +1,4 @@
# lodash v4.11.0 # lodash v4.11.1
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.

View File

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

View File

@@ -1,5 +1,5 @@
/** /**
* lodash 4.11.0 (Custom Build) <https://lodash.com/> * lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./` * Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/> * Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license> * Released under MIT license <https://lodash.com/license>
@@ -36,20 +36,6 @@ var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Built-in method references without a dependency on `root`. */ /** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt; var freeParseInt = parseInt;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}
/** Used for built-in method references. */ /** Used for built-in method references. */
var objectProto = Object.prototype; var objectProto = Object.prototype;
@@ -61,7 +47,7 @@ var objectProto = Object.prototype;
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
/** /**
* The base implementation of `_.nth` which doesn't coerce `n` to an integer. * The base implementation of `_.nth` which doesn't coerce arguments.
* *
* @private * @private
* @param {Array} array The array to query. * @param {Array} array The array to query.
@@ -78,8 +64,23 @@ function baseNth(array, n) {
} }
/** /**
* Gets the nth element of `array`. If `n` is negative, the nth element * Checks if `value` is a valid array-like index.
* from the end is returned. *
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* Gets the element at index `n` of `array`. If `n` is negative, the nth
* element from the end is returned.
* *
* @static * @static
* @memberOf _ * @memberOf _
@@ -110,8 +111,7 @@ function nth(array, n) {
* @since 0.1.0 * @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a function, else `false`.
* else `false`.
* @example * @example
* *
* _.isFunction(_); * _.isFunction(_);
@@ -194,8 +194,7 @@ function isObjectLike(value) {
* @since 4.0.0 * @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* else `false`.
* @example * @example
* *
* _.isSymbol(Symbol.iterator); * _.isSymbol(Symbol.iterator);
@@ -209,10 +208,45 @@ function isSymbol(value) {
(isObjectLike(value) && objectToString.call(value) == symbolTag); (isObjectLike(value) && objectToString.call(value) == symbolTag);
} }
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
/** /**
* Converts `value` to an integer. * 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). * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
* *
* @static * @static
@@ -223,7 +257,7 @@ function isSymbol(value) {
* @returns {number} Returns the converted integer. * @returns {number} Returns the converted integer.
* @example * @example
* *
* _.toInteger(3); * _.toInteger(3.2);
* // => 3 * // => 3
* *
* _.toInteger(Number.MIN_VALUE); * _.toInteger(Number.MIN_VALUE);
@@ -232,20 +266,14 @@ function isSymbol(value) {
* _.toInteger(Infinity); * _.toInteger(Infinity);
* // => 1.7976931348623157e+308 * // => 1.7976931348623157e+308
* *
* _.toInteger('3'); * _.toInteger('3.2');
* // => 3 * // => 3
*/ */
function toInteger(value) { function toInteger(value) {
if (!value) { var result = toFinite(value),
return value === 0 ? value : 0; remainder = result % 1;
}
value = toNumber(value); return result === result ? (remainder ? result - remainder : result) : 0;
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
var remainder = value % 1;
return value === value ? (remainder ? value - remainder : value) : 0;
} }
/** /**
@@ -259,8 +287,8 @@ function toInteger(value) {
* @returns {number} Returns the number. * @returns {number} Returns the number.
* @example * @example
* *
* _.toNumber(3); * _.toNumber(3.2);
* // => 3 * // => 3.2
* *
* _.toNumber(Number.MIN_VALUE); * _.toNumber(Number.MIN_VALUE);
* // => 5e-324 * // => 5e-324
@@ -268,8 +296,8 @@ function toInteger(value) {
* _.toNumber(Infinity); * _.toNumber(Infinity);
* // => Infinity * // => Infinity
* *
* _.toNumber('3'); * _.toNumber('3.2');
* // => 3 * // => 3.2
*/ */
function toNumber(value) { function toNumber(value) {
if (typeof value == 'number') { if (typeof value == 'number') {

View File

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