lodash.foreach
Advanced tools
Comparing version 4.1.1 to 4.2.0
58
index.js
/** | ||
* lodash 4.1.1 (Custom Build) <https://lodash.com/> | ||
* lodash 4.2.0 (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 | ||
*/ | ||
var baseEach = require('lodash._baseeach'); | ||
var baseEach = require('lodash._baseeach'), | ||
baseIteratee = require('lodash._baseiteratee'); | ||
@@ -33,13 +34,2 @@ /** | ||
/** | ||
* Casts `value` to `identity` if it's not a function. | ||
* | ||
* @private | ||
* @param {*} value The value to inspect. | ||
* @returns {Array} Returns the array-like object. | ||
*/ | ||
function baseCastFunction(value) { | ||
return typeof value == 'function' ? value : identity; | ||
} | ||
/** | ||
* Iterates over elements of `collection` invoking `iteratee` for each element. | ||
@@ -49,8 +39,9 @@ * The iteratee is invoked with three arguments: (value, index|key, collection). | ||
* | ||
* **Note:** As with other "Collections" methods, objects with a "length" property | ||
* are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` | ||
* for object iteration. | ||
* **Note:** As with other "Collections" methods, objects with a "length" | ||
* property are iterated like arrays. To avoid this behavior use `_.forIn` | ||
* or `_.forOwn` for object iteration. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @alias each | ||
@@ -66,3 +57,3 @@ * @category Collection | ||
* }); | ||
* // => logs `1` then `2` | ||
* // => Logs `1` then `2`. | ||
* | ||
@@ -72,3 +63,3 @@ * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { | ||
* }); | ||
* // => logs 'a' then 'b' (iteration order is not guaranteed) | ||
* // => Logs 'a' then 'b' (iteration order is not guaranteed). | ||
*/ | ||
@@ -78,3 +69,3 @@ function forEach(collection, iteratee) { | ||
? arrayEach(collection, iteratee) | ||
: baseEach(collection, baseCastFunction(iteratee)); | ||
: baseEach(collection, baseIteratee(iteratee)); | ||
} | ||
@@ -87,6 +78,8 @@ | ||
* @memberOf _ | ||
* @since 0.1.0 | ||
* @type {Function} | ||
* @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 | ||
@@ -108,21 +101,2 @@ * | ||
/** | ||
* This method returns the first argument given to it. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Util | ||
* @param {*} value Any value. | ||
* @returns {*} Returns `value`. | ||
* @example | ||
* | ||
* var object = { 'user': 'fred' }; | ||
* | ||
* _.identity(object) === object; | ||
* // => true | ||
*/ | ||
function identity(value) { | ||
return value; | ||
} | ||
module.exports = forEach; |
{ | ||
"name": "lodash.foreach", | ||
"version": "4.1.1", | ||
"version": "4.2.0", | ||
"description": "The lodash method `_.forEach` exported as a module.", | ||
@@ -18,4 +18,5 @@ "homepage": "https://lodash.com/", | ||
"dependencies": { | ||
"lodash._baseeach": "~4.1.0" | ||
"lodash._baseeach": "~4.1.0", | ||
"lodash._baseiteratee": "~4.6.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash.foreach v4.1.1 | ||
# lodash.foreach v4.2.0 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.forEach` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#forEach) or [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash.foreach) for more details. | ||
See the [documentation](https://lodash.com/docs#forEach) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.foreach) for more details. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5940
2
1
90
+ Addedlodash._baseiteratee@~4.6.0
+ Addedlodash._baseiteratee@4.6.1(transitive)
+ Addedlodash._stringtopath@4.7.1(transitive)