lodash.slice
Advanced tools
Comparing version 4.0.4 to 4.0.5
109
index.js
/** | ||
* lodash 4.0.4 (Custom Build) <https://lodash.com/> | ||
* lodash 4.0.5 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
* Copyright jQuery Foundation and other contributors <https://jquery.org/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
* Available under MIT license <https://lodash.com/license> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ | ||
@@ -19,3 +19,4 @@ var baseSlice = require('lodash._baseslice'); | ||
var funcTag = '[object Function]', | ||
genTag = '[object GeneratorFunction]'; | ||
genTag = '[object GeneratorFunction]', | ||
symbolTag = '[object Symbol]'; | ||
@@ -79,4 +80,5 @@ /** Used to match leading and trailing whitespace. */ | ||
* | ||
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) | ||
* that affects Safari on at least iOS 8.1-8.3 ARM64. | ||
* **Note:** This function is used to avoid a | ||
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects | ||
* Safari on at least iOS 8.1-8.3 ARM64. | ||
* | ||
@@ -96,3 +98,4 @@ * @private | ||
* @param {*} object The potential iteratee object argument. | ||
* @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. | ||
* @returns {boolean} Returns `true` if the arguments are from an iteratee call, | ||
* else `false`. | ||
*/ | ||
@@ -105,4 +108,5 @@ function isIterateeCall(value, index, object) { | ||
if (type == 'number' | ||
? (isArrayLike(object) && isIndex(index, object.length)) | ||
: (type == 'string' && index in object)) { | ||
? (isArrayLike(object) && isIndex(index, object.length)) | ||
: (type == 'string' && index in object) | ||
) { | ||
return eq(object[index], value); | ||
@@ -116,7 +120,9 @@ } | ||
* | ||
* **Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice) | ||
* to ensure dense arrays are returned. | ||
* **Note:** This method is used instead of | ||
* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are | ||
* returned. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 3.0.0 | ||
* @category Array | ||
@@ -145,3 +151,4 @@ * @param {Array} array The array to slice. | ||
/** | ||
* Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) | ||
* Performs a | ||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) | ||
* comparison between two values to determine if they are equivalent. | ||
@@ -151,2 +158,3 @@ * | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
@@ -187,2 +195,3 @@ * @param {*} value The value to compare. | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
@@ -214,5 +223,7 @@ * @param {*} value The value to check. | ||
* @memberOf _ | ||
* @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 correctly classified, | ||
* else `false`. | ||
* @example | ||
@@ -237,9 +248,12 @@ * | ||
* | ||
* **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). | ||
* **Note:** This function is loosely based on | ||
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`. | ||
* @returns {boolean} Returns `true` if `value` is a valid length, | ||
* else `false`. | ||
* @example | ||
@@ -270,2 +284,3 @@ * | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @category Lang | ||
@@ -294,8 +309,61 @@ * @param {*} value The value to check. | ||
/** | ||
* Checks if `value` is object-like. A value is object-like if it's not `null` | ||
* and has a `typeof` result of "object". | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
* @example | ||
* | ||
* _.isObjectLike({}); | ||
* // => true | ||
* | ||
* _.isObjectLike([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObjectLike(_.noop); | ||
* // => false | ||
* | ||
* _.isObjectLike(null); | ||
* // => false | ||
*/ | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
} | ||
/** | ||
* Checks if `value` is classified as a `Symbol` primitive or object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, | ||
* else `false`. | ||
* @example | ||
* | ||
* _.isSymbol(Symbol.iterator); | ||
* // => true | ||
* | ||
* _.isSymbol('abc'); | ||
* // => false | ||
*/ | ||
function isSymbol(value) { | ||
return typeof value == 'symbol' || | ||
(isObjectLike(value) && objectToString.call(value) == symbolTag); | ||
} | ||
/** | ||
* Converts `value` to an integer. | ||
* | ||
* **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). | ||
* **Note:** This function is loosely based on | ||
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
@@ -336,2 +404,3 @@ * @param {*} value The value to convert. | ||
* @memberOf _ | ||
* @since 4.0.0 | ||
* @category Lang | ||
@@ -355,2 +424,8 @@ * @param {*} value The value to process. | ||
function toNumber(value) { | ||
if (typeof value == 'number') { | ||
return value; | ||
} | ||
if (isSymbol(value)) { | ||
return NAN; | ||
} | ||
if (isObject(value)) { | ||
@@ -357,0 +432,0 @@ var other = isFunction(value.valueOf) ? value.valueOf() : value; |
{ | ||
"name": "lodash.slice", | ||
"version": "4.0.4", | ||
"version": "4.0.5", | ||
"description": "The lodash method `_.slice` exported as a module.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/", |
@@ -1,2 +0,2 @@ | ||
# lodash.slice v4.0.4 | ||
# lodash.slice v4.0.5 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.slice` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#slice) or [package source](https://github.com/lodash/lodash/blob/4.0.4-npm-packages/lodash.slice) for more details. | ||
See the [documentation](https://lodash.com/docs#slice) or [package source](https://github.com/lodash/lodash/blob/4.0.5-npm-packages/lodash.slice) for more details. |
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
13981
406
1