mirror of
				https://github.com/Yidadaa/ChatGPT-Next-Web.git
				synced 2025-11-04 16:57:27 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			419 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			419 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
export function merge(target: any, source: any) {
 | 
						|
  Object.keys(source).forEach(function (key) {
 | 
						|
    if (
 | 
						|
      source.hasOwnProperty(key) && // Check if the property is not inherited
 | 
						|
      source[key] &&
 | 
						|
      typeof source[key] === "object" || key === "__proto__" || key === "constructor"
 | 
						|
    ) {
 | 
						|
      merge((target[key] = target[key] || {}), source[key]);
 | 
						|
      return;
 | 
						|
    }
 | 
						|
    target[key] = source[key];
 | 
						|
  });
 | 
						|
} 
 |