mirror of
				https://github.com/taixingyiji/openit.git
				synced 2025-11-04 14:32:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			660 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			660 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/**
 | 
						|
 * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
 | 
						|
 *
 | 
						|
 * @private
 | 
						|
 * @param {Array} props The property identifiers.
 | 
						|
 * @param {Array} values The property values.
 | 
						|
 * @param {Function} assignFunc The function to assign values.
 | 
						|
 * @returns {Object} Returns the new object.
 | 
						|
 */
 | 
						|
function baseZipObject(props, values, assignFunc) {
 | 
						|
  var index = -1,
 | 
						|
      length = props.length,
 | 
						|
      valsLength = values.length,
 | 
						|
      result = {};
 | 
						|
 | 
						|
  while (++index < length) {
 | 
						|
    var value = index < valsLength ? values[index] : undefined;
 | 
						|
    assignFunc(result, props[index], value);
 | 
						|
  }
 | 
						|
  return result;
 | 
						|
}
 | 
						|
 | 
						|
module.exports = baseZipObject;
 |