Currently when this package is used somewhere in between a Shared worker, simply the import/require will fail because it does not have the Worker API set on the globals.
Uncaught ReferenceError: Worker is not defined
This PR adds a check for undefined and only exports the Worker API when it really exists.
Currently when this package is used somewhere in between a Shared worker, simply the import/require will fail because it does not have the Worker API set on the globals.
Uncaught ReferenceError: Worker is not defined
This PR adds a check for
undefined
and only exports the Worker API when it really exists.