add hw2
This commit is contained in:
		
							
								
								
									
										32
									
								
								node_modules/lodash-es/_createBaseEach.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								node_modules/lodash-es/_createBaseEach.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| import isArrayLike from './isArrayLike.js'; | ||||
|  | ||||
| /** | ||||
|  * Creates a `baseEach` or `baseEachRight` function. | ||||
|  * | ||||
|  * @private | ||||
|  * @param {Function} eachFunc The function to iterate over a collection. | ||||
|  * @param {boolean} [fromRight] Specify iterating from right to left. | ||||
|  * @returns {Function} Returns the new base function. | ||||
|  */ | ||||
| function createBaseEach(eachFunc, fromRight) { | ||||
|   return function(collection, iteratee) { | ||||
|     if (collection == null) { | ||||
|       return collection; | ||||
|     } | ||||
|     if (!isArrayLike(collection)) { | ||||
|       return eachFunc(collection, iteratee); | ||||
|     } | ||||
|     var length = collection.length, | ||||
|         index = fromRight ? length : -1, | ||||
|         iterable = Object(collection); | ||||
|  | ||||
|     while ((fromRight ? index-- : ++index < length)) { | ||||
|       if (iteratee(iterable[index], index, iterable) === false) { | ||||
|         break; | ||||
|       } | ||||
|     } | ||||
|     return collection; | ||||
|   }; | ||||
| } | ||||
|  | ||||
| export default createBaseEach; | ||||
		Reference in New Issue
	
	Block a user
	 nik
					nik