import { createEvent } from "./createEvent" ; function createFocusEvent ( element , type , eventInit = { } ) { if ( typeof FocusEvent === "function" ) { return new FocusEvent ( type , eventInit ) ; } return createEvent ( element , type , eventInit ) ; } example export function fireBlurEvent ( element , eventInit ? ) { const event = createFocusEvent ( element , "blur" , eventInit ) ; const defaultAllowed = element . dispatchEvent ( event ) ; const bubbleInit = { ... eventInit , bubbles : true } ; element . dispatchEvent ( createFocusEvent ( element , "focusout" , bubbleInit ) ) ; return defaultAllowed ; }