@sabaaa1/common 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../constants/vite.constants.cjs"),r=require("./worker.registry.cjs");class o{constructor(){}static resolveWorkerURL=async e=>{if(s.isWebpack&&typeof window<"u"){const a={[r.WorkerVariant.UTXO]:"utxoWorkerLogic-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../constants/vite.constants.cjs"),r=require("./worker.registry.cjs");class o{constructor(){}static resolveWorkerURL=async e=>{if(s.isWebpack&&typeof window<"u"){const a={[r.WorkerVariant.UTXO]:"utxoWorkerLogic-DEqWaadT.js",[r.WorkerVariant.ZKProof]:"zkProofWorkerLogic-DB9cbXu-.js",[r.WorkerVariant.SnarkJS]:"snarkjsWorkerLogic-B9NbAQYW.js"};return new URL(`/static/media/${a[e]}`,window.location.origin)}const{getWorkerViteURL:i}=await Promise.resolve().then(()=>require("./viteWorkerURL.constant.cjs"));return(await i())[e]};static createWorker=async e=>{if(s.isNode||s.isSandbox){let t;return e===r.WorkerVariant.SnarkJS?t=await Promise.resolve().then(()=>require("./snarkjsWorker/snarkjsWorkerLogic.cjs")):e===r.WorkerVariant.ZKProof?t=await Promise.resolve().then(()=>require("./zkProofWorker/zkProofWorkerLogic.cjs")):e===r.WorkerVariant.UTXO&&(t=await Promise.resolve().then(()=>require("./utxoWorker/utxoWorkerLogic.cjs"))),t.default}const i=await o.resolveWorkerURL(e);return new Worker(i,{type:"module"})};static getWebWorker(e){switch(e){case r.WorkerVariant.ZKProof:return o.createWorker(e);case r.WorkerVariant.SnarkJS:return o.createWorker(e);case r.WorkerVariant.UTXO:return o.createWorker(e);default:throw Error(`Unknown worker type: ${e}`)}}}exports.WorkerFactory=o;
|
|
@@ -6,9 +6,12 @@ class t {
|
|
|
6
6
|
static resolveWorkerURL = async (e) => {
|
|
7
7
|
if (c && typeof window < "u") {
|
|
8
8
|
const s = {
|
|
9
|
-
[r.UTXO]: "utxoWorkerLogic-
|
|
10
|
-
|
|
11
|
-
[r.
|
|
9
|
+
[r.UTXO]: "utxoWorkerLogic-DEqWaadT.js",
|
|
10
|
+
// ← NEW
|
|
11
|
+
[r.ZKProof]: "zkProofWorkerLogic-DB9cbXu-.js",
|
|
12
|
+
// ← NEW
|
|
13
|
+
[r.SnarkJS]: "snarkjsWorkerLogic-B9NbAQYW.js"
|
|
14
|
+
// ← NEW
|
|
12
15
|
};
|
|
13
16
|
return new URL(`/static/media/${s[e]}`, window.location.origin);
|
|
14
17
|
}
|