/**
 * Copyright 2018-present Facebook.
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 * @format
 */

// $FlowFixMe T47375728
export const stateSanitizer = state => {
  let sanitizedState = state;
  if (state.connections) {
    if (state.connections.devices) {
      const {devices} = state.connections;
      sanitizedState = {
        ...sanitizedState,
        connections: {
          ...state.connections,
          devices: devices.map(device => {
            return {
              ...device.toJSON(),
              logs: '<<DEVICE_LOGS>>',
            };
          }),
        },
      };
    }
    if (state.connections.selectedDevice) {
      const {selectedDevice} = state.connections;
      sanitizedState = {
        ...sanitizedState,
        connections: {
          ...sanitizedState.connections,
          selectedDevice: {
            ...selectedDevice.toJSON(),
            logs: '<<DEVICE_LOGS>>',
          },
        },
      };
    }
  }
  return sanitizedState;
};

@@ -178,32 +178,111 @@
  */%0A
-%0A// $FlowFixMe T47375728
+import type %7BState%7D from '../reducers/index';%0Aimport type %7BDeviceExport%7D from '../devices/BaseDevice';%0A
 %0Aexp
@@ -312,48 +312,27 @@
 r = 
+(
 state
+:
  
-=%3E %7B%0A  let sanitized
 State
+)
  =
- state;
+%3E %7B
 %0A  i
@@ -355,20 +355,12 @@
 ions
-) %7B%0A    if (
+ && 
 stat
@@ -380,26 +380,24 @@
 .devices) %7B%0A
-  
     const %7Bd
@@ -429,39 +429,73 @@
 ns;%0A    
-  sanitizedState =
+const %7BselectedDevice%7D = state.connections;%0A    return
  %7B%0A
-  
       ..
@@ -496,33 +496,22 @@
     ...s
-anitizedS
 tate,%0A
-  
       co
@@ -527,26 +527,24 @@
 : %7B%0A        
-  
 ...state.con
@@ -561,18 +561,16 @@
         
-  
 devices:
@@ -581,16 +581,30 @@
 ices.map
+%3CDeviceExport%3E
 (device 
@@ -618,18 +618,16 @@
         
-  
 return %7B
@@ -623,26 +623,24 @@
    return %7B%0A
-  
             
@@ -675,37 +675,18 @@
     
-  
 logs: 
-'%3C%3CDEVICE_LOGS%3E%3E',%0A  
+%5B%5D,%0A
     
@@ -702,18 +702,16 @@
         
- 
- 
 %7D),%0A    
@@ -718,264 +718,55 @@
     
-%7D,%0A      %7D;%0A    %7D%0A    if (state.connections.selectedDevice) %7B%0A      const %7BselectedDevice%7D = state.connections;%0A      sanitizedState = %7B%0A        ...sanitizedState,%0A        connections: %7B%0A          ...sanitizedState.connections,%0A          selectedDevice: %7B%0A
+selectedDevice: selectedDevice%0A          ? %7B%0A  
     
@@ -817,31 +817,18 @@
     
+  
 logs: 
-'%3C%3CDEVICE_LOGS%3E%3E'
+%5B%5D
 ,%0A  
@@ -831,26 +831,27 @@
 ,%0A          
+ 
+ 
 %7D
-,
 %0A        %7D,%0A
@@ -847,17 +847,24 @@
         
-%7D
+  : null
 ,%0A      
@@ -868,20 +868,22 @@
    %7D
-;
+,
 %0A    %7D
+;
 %0A  %7D%0A
+%0A
   re
@@ -892,17 +892,8 @@
 rn s
-anitizedS
 tate

Add types to reduxDevToolsConfig