add hw2
This commit is contained in:
		
							
								
								
									
										40
									
								
								node_modules/lodash-es/_copyObject.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								node_modules/lodash-es/_copyObject.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | ||||
| import assignValue from './_assignValue.js'; | ||||
| import baseAssignValue from './_baseAssignValue.js'; | ||||
|  | ||||
| /** | ||||
|  * Copies properties of `source` to `object`. | ||||
|  * | ||||
|  * @private | ||||
|  * @param {Object} source The object to copy properties from. | ||||
|  * @param {Array} props The property identifiers to copy. | ||||
|  * @param {Object} [object={}] The object to copy properties to. | ||||
|  * @param {Function} [customizer] The function to customize copied values. | ||||
|  * @returns {Object} Returns `object`. | ||||
|  */ | ||||
| function copyObject(source, props, object, customizer) { | ||||
|   var isNew = !object; | ||||
|   object || (object = {}); | ||||
|  | ||||
|   var index = -1, | ||||
|       length = props.length; | ||||
|  | ||||
|   while (++index < length) { | ||||
|     var key = props[index]; | ||||
|  | ||||
|     var newValue = customizer | ||||
|       ? customizer(object[key], source[key], key, object, source) | ||||
|       : undefined; | ||||
|  | ||||
|     if (newValue === undefined) { | ||||
|       newValue = source[key]; | ||||
|     } | ||||
|     if (isNew) { | ||||
|       baseAssignValue(object, key, newValue); | ||||
|     } else { | ||||
|       assignValue(object, key, newValue); | ||||
|     } | ||||
|   } | ||||
|   return object; | ||||
| } | ||||
|  | ||||
| export default copyObject; | ||||
		Reference in New Issue
	
	Block a user
	 nik
					nik