'use strict' ; param aPromise param errHandle returns function safeWait ( aPromise , errHandle ) { return ( < F extends ( ( ... args : never [ ] ) => Promise < void > ) > ( func ) => { return ( ... args ) : Promise < void > => { return aPromise . then ( ( ) => func ( ... args ) ) . catch ( ( err ) => errHandle ( err ) ) ; } ; } ) ; } param aPromise param errHandle returns function safeWaitCallback ( callPromise , errHandle ) { return ( < T , F extends ( ( ... args : never [ ] ) => Promise < T > ) > ( func ) => { return ( ... args ) : ReturnType < F > | Promise < undefined > => { return callPromise . then ( ( ) => < ReturnType < F > > func ( ... args ) ) . catch ( ( err ) => errHandle ( err ) ) ; } ; } ) ; } param err function errorHandler ( err ) { if ( __DEV__ ) { console . warn ( 'SnowplowTracker:' + err . message ) ; return undefined ; } return undefined ; } param x returns function isObject < Type > ( x ) { return Object . prototype . toString . call ( x ) === '[object Object]' ; } export { safeWait , safeWaitCallback , errorHandler , isObject } ;