import AudioVideoEventAttributes from './AudioVideoEventAttributes' ; import DeviceEventAttributes from './DeviceEventAttributes' ; param attributes returns const flattenEventAttributes = ( attributes ) : { [ key ] : string | number ; } => { const flattenedAttributes = { } ; for ( const [ key , value ] of Object . entries ( attributes ) ) { if ( value === null || value === undefined || value === '' ) { continue ; } else if ( typeof value === 'number' || typeof value === 'string' ) { flattenedAttributes [ key ] = value ; } else { throw new TypeError ( 'Unhandled type received while flattening attributes.' ) ; } } return flattenedAttributes ; } ; export default flattenEventAttributes ;