sync worker doesn't use require and ESM doesn't allows it

This commit is contained in:
Sebastian 2022-10-31 00:23:38 -03:00
parent 2f17d81802
commit 93ef4dace0
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1

View File

@ -27,9 +27,6 @@ import { SynchronousCryptoWorker } from "./synchronousWorkerNode.js";
*/ */
export class SynchronousCryptoWorkerFactory implements CryptoWorkerFactory { export class SynchronousCryptoWorkerFactory implements CryptoWorkerFactory {
startWorker(): CryptoWorker { startWorker(): CryptoWorker {
if (typeof require === "undefined") {
throw Error("cannot make worker, require(...) not defined");
}
return new SynchronousCryptoWorker(); return new SynchronousCryptoWorker();
} }