File tree Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ const addedDiff = (lhs, rhs) => {
1313
1414      if  ( isObject ( difference )  &&  isEmpty ( difference ) )  return  acc ; 
1515
16-       return  {  ...acc ,  [ key ] : difference  } ; 
16+       acc [ key ]  =  difference ; 
17+       return  acc ; 
1718    } 
1819
19-     return  {  ...acc ,  [ key ] : r [ key ]  } ; 
20+     acc [ key ]  =  r [ key ] ; 
21+     return  acc ; 
2022  } ,  { } ) ; 
2123} ; 
2224
Original file line number Diff line number Diff line change @@ -12,10 +12,12 @@ const deletedDiff = (lhs, rhs) => {
1212
1313      if  ( isObject ( difference )  &&  isEmpty ( difference ) )  return  acc ; 
1414
15-       return  {  ...acc ,  [ key ] : difference  } ; 
15+       acc [ key ]  =  difference ; 
16+       return  acc ; 
1617    } 
1718
18-     return  {  ...acc ,  [ key ] : undefined  } ; 
19+     acc [ key ]  =  undefined ; 
20+     return  acc ; 
1921  } ,  { } ) ; 
2022} ; 
2123
Original file line number Diff line number Diff line change @@ -9,7 +9,12 @@ const diff = (lhs, rhs) => {
99  const  r  =  rhs ; 
1010
1111  const  deletedValues  =  Object . keys ( l ) . reduce ( ( acc ,  key )  =>  { 
12-     return  hasOwnProperty ( r ,  key )  ? acc  : {  ...acc ,  [ key ] : undefined  } ; 
12+     if  ( ! hasOwnProperty ( r ,  key ) )  { 
13+       acc [ key ]  =  undefined ; 
14+       
15+     } 
16+ 
17+     return  acc ; 
1318  } ,  { } ) ; 
1419
1520  if  ( isDate ( l )  ||  isDate ( r ) )  { 
@@ -18,15 +23,19 @@ const diff = (lhs, rhs) => {
1823  } 
1924
2025  return  Object . keys ( r ) . reduce ( ( acc ,  key )  =>  { 
21-     if  ( ! hasOwnProperty ( l ,  key ) )  return  {  ...acc ,  [ key ] : r [ key ]  } ;  // return added r key 
26+     if  ( ! hasOwnProperty ( l ,  key ) ) { 
27+       acc [ key ]  =  r [ key ] ;  // return added r key 
28+       return  acc ; 
29+     }  
2230
2331    const  difference  =  diff ( l [ key ] ,  r [ key ] ) ; 
2432
2533    // If the difference is empty, and the lhs is an empty object or the rhs is not an empty object 
2634    if  ( isEmptyObject ( difference )  &&  ! isDate ( difference )  &&  ( isEmptyObject ( l [ key ] )  ||  ! isEmptyObject ( r [ key ] ) ) ) 
2735      return  acc ;  // return no diff 
2836
29-     return  {  ...acc ,  [ key ] : difference  } ;  // return updated key 
37+     acc [ key ]  =  difference  // return updated key 
38+     return  acc ;  // return updated key 
3039  } ,  deletedValues ) ; 
3140} ; 
3241
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ const updatedDiff = (lhs, rhs) => {
2121      if  ( isEmptyObject ( difference )  &&  ! isDate ( difference )  &&  ( isEmptyObject ( l [ key ] )  ||  ! isEmptyObject ( r [ key ] ) ) ) 
2222        return  acc ;  // return no diff 
2323
24-       return  {  ...acc ,  [ key ] : difference  } ; 
24+       acc [ key ]  =  difference ; 
25+       return  acc ; 
2526    } 
2627
2728    return  acc ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments