import { Severity } from '@sentry/types' ; import { getGlobalObject } from '@sentry/utils' ; import { CordovaPlatformType } from './types' ; param data returns export const serializeObject = ( data ) : { [ key ] : string ; } => { const serialized = { } ; Object . keys ( data ) . forEach ( dataKey => { const value = data [ dataKey ] ; serialized [ dataKey ] = typeof value === 'string' ? value : JSON . stringify ( value ) ; } ) ; return serialized ; } ; param level returns export const processLevel = ( level ) : Severity => { if ( level === Severity . Critical ) { return Severity . Fatal ; } if ( level === Severity . Log ) { return Severity . Debug ; } return level ; } ; returns export const getPlatform = ( ) : CordovaPlatformType => { const _window = getGlobalObject < any > ( ) ; let platform = _window ?. cordova ?. platformId ; if ( ! platform || ! Object . values ( CordovaPlatformType ) . includes ( platform ) ) { platform = CordovaPlatformType . Browser ; } return platform ; } ;