import { workerFactory } from '../worker-interface'; function isHtmlScriptElement(scriptElement: HTMLOrSVGScriptElement): scriptElement is HTMLScriptElement { return 'src' in scriptElement; } const THIS_SCRIPT_URL: string | undefined = (document && document.currentScript && isHtmlScriptElement(document.currentScript) && document.currentScript.src) ? document.currentScript.src : undefined; workerFactory.createWorker = () => { // Notes: // 1. The expectation is that the current script is loaded through a