@@ -240,27 +240,24 @@ type trackEventProps = {
240240
241241const trackEvent = ( { object, verb, attributes } : trackEventProps ) => {
242242 try {
243-
244-
245- const event = `${ object } ${ _SEP_ } ${ verb } `
246- Object . keys ( attributes ) . map ( attr => {
247- const value = attributes [ attr ] ;
248- if ( typeof value !== "number" ) {
249- attributes [ attr ] = value . toLowerCase ( ) ;
243+ const event = `${ object } ${ _SEP_ } ${ verb } `
244+ Object . keys ( attributes ) . map ( attr => {
245+ const value = attributes [ attr ] ;
246+ if ( typeof value !== "number" ) {
247+ attributes [ attr ] = value . toLowerCase ( ) ;
248+ }
249+ return attr ;
250+ } ) ;
251+
252+ // Remove http and www from links
253+ if ( Object . keys ( attributes ) . some ( ( attr ) => attr == Attributes . LINK ) ) {
254+ attributes [ Attributes . LINK ] = attributes [ Attributes . LINK ] . replace ( / ( h t t p s * : \/ \/ [ w w w . ] * ) / , '' )
250255 }
251- return attr ;
252- } ) ;
253-
254- // Remove http and www from links
255-
256- if ( Object . keys ( attributes ) . some ( ( attr ) => attr == Attributes . LINK ) ) {
257- attributes [ Attributes . LINK ] = attributes [ Attributes . LINK ] . replace ( / ( h t t p s * : \/ \/ [ w w w . ] * ) / , '' )
258- }
259256
260- if ( isDevelopment ( ) ) {
261- console . log ( "analytics" , event , attributes )
262- return ;
263- }
257+ if ( isDevelopment ( ) ) {
258+ console . log ( "analytics" , event , attributes )
259+ return ;
260+ }
264261
265262 track ( event , attributes ) ;
266263 } catch ( e ) {
0 commit comments