3 // The following check is one possible way to identify
4 // if this script is loaded as a ES Module or the classic way.
5 const isLoadedAsEsModule = this != globalThis;
7 // Here we expect the worker to be loaded a ES Module
8 if (isLoadedAsEsModule) {