license /**
 * Determine whether the current browser supports passive event listeners, and
 * if so, use them.
 */ export function applyPassive ( globalObj = window ) { return supportsPassiveOption ( globalObj ) ? { passive : true } as AddEventListenerOptions : false ; } function supportsPassiveOption ( globalObj = window ) { let passiveSupported = false ; try { const options = { get passive ( ) { passiveSupported = true ; return false ; } } ; const handler = ( ) => { } ; globalObj . document . addEventListener ( 'test' , handler , options ) ; globalObj . document . removeEventListener ( 'test' , handler , options as EventListenerOptions ) ; } catch ( err ) { passiveSupported = false ; } return passiveSupported ; }