import noop from '@tinkoff/utils/function/noop' ; import pick from '@tinkoff/utils/object/pick' ; import startsWith from '@tinkoff/utils/string/startsWith' ; import isElement from '@tinkoff/utils/is/element' ; const elementReplacer = pick ( [ 'tagName' , 'id' , 'className' ] ) ; let devTools = { init : noop , send : noop , subscribe : noop , error : noop , } ; if ( typeof window !== 'undefined' && ( window as any ) . __REDUX_DEVTOOLS_EXTENSION__ ) { devTools = ( window as any ) . __REDUX_DEVTOOLS_EXTENSION__ . connect ( { name : 'Tinkoff-client' , latency : 700 , serialize : { replacer : ( key , value ) => { switch ( true ) { case isElement ( value ) : return elementReplacer ( value ) ; case startsWith ( '_reactInternal' , `${ key }` ) : return '_reactInternal' ; } return value ; } , } , } ) ; } export { devTools } ;