mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-04 04:57:51 +00:00 
			
		
		
		
	Co-authored-by: Nithin David Thomas <webofnithin@gmail.com> Co-authored-by: Sojan Jose <sojan@pepalo.com>
		
			
				
	
	
		
			11 lines
		
	
	
		
			300 B
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			11 lines
		
	
	
		
			300 B
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
/* eslint-disable import/prefer-default-export */
 | 
						|
export const isEmptyObject = obj =>
 | 
						|
  Object.keys(obj).length === 0 && obj.constructor === Object;
 | 
						|
 | 
						|
export const arrayToHashById = array =>
 | 
						|
  array.reduce((map, obj) => {
 | 
						|
    const newMap = map;
 | 
						|
    newMap[obj.id] = obj;
 | 
						|
    return newMap;
 | 
						|
  }, {});
 |