()
| 552 | |
| 553 | let passiveSupported: boolean | null = null |
| 554 | export function passiveEventSupported() { |
| 555 | if (typeof passiveSupported === 'boolean') return passiveSupported |
| 556 | |
| 557 | let supported = false |
| 558 | try { |
| 559 | const options = { |
| 560 | get passive() { |
| 561 | supported = true |
| 562 | return false |
| 563 | }, |
| 564 | } |
| 565 | |
| 566 | const noop = () => {} |
| 567 | |
| 568 | window.addEventListener('test', noop, options) |
| 569 | window.removeEventListener('test', noop) |
| 570 | } catch (err) { |
| 571 | supported = false |
| 572 | } |
| 573 | passiveSupported = supported |
| 574 | return passiveSupported |
| 575 | } |
| 576 | |
| 577 | function isTouchStartEvent(e: unknown): e is TouchEvent { |
| 578 | return (e as TouchEvent).type === 'touchstart' |
no outgoing calls
no test coverage detected
searching dependent graphs…