@wasm-audio-decoders/common
Advanced tools
Comparing version 5.0.1 to 5.0.2
{ | ||
"name": "@wasm-audio-decoders/common", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Web Assembly Audio Decoders Common", | ||
@@ -5,0 +5,0 @@ "module": "index.js", |
@@ -14,3 +14,3 @@ import Worker from "web-worker"; | ||
// dependencies need to be manually resolved when stringifying this function | ||
`(${((_options, _Decoder, _WASMAudioDecoderCommon, _EmscriptenWASM) => { | ||
`(${((_Decoder, _WASMAudioDecoderCommon, _EmscriptenWASM) => { | ||
// We're in a Web Worker | ||
@@ -30,11 +30,11 @@ | ||
if (command === "module") { | ||
if (command === "init") { | ||
Object.defineProperties(_Decoder, { | ||
WASMAudioDecoderCommon: { value: _WASMAudioDecoderCommon }, | ||
EmscriptenWASM: { value: _EmscriptenWASM }, | ||
module: { value: data }, | ||
module: { value: data.module }, | ||
isWebWorker: { value: true }, | ||
}); | ||
decoder = new _Decoder(_options); | ||
decoder = new _Decoder(data.options); | ||
moduleResolve(); | ||
@@ -71,5 +71,3 @@ } else if (command === "free") { | ||
}; | ||
}).toString()})(${JSON.stringify( | ||
options | ||
)}, ${Decoder}, ${WASMAudioDecoderCommon}, ${EmscriptenWASM})`; | ||
}).toString()})(${Decoder}, ${WASMAudioDecoderCommon}, ${EmscriptenWASM})`; | ||
@@ -81,3 +79,2 @@ const type = "text/javascript"; | ||
source = URL.createObjectURL(new Blob([webworkerSourceCode], { type })); | ||
WASMAudioDecoderCommon.modules.set(Decoder, source); | ||
} catch { | ||
@@ -89,2 +86,4 @@ // nodejs | ||
} | ||
WASMAudioDecoderCommon.modules.set(Decoder, source); | ||
} | ||
@@ -103,4 +102,4 @@ | ||
new EmscriptenWASM(WASMAudioDecoderCommon).getModule().then((compiled) => { | ||
this._postToDecoder("module", compiled); | ||
new EmscriptenWASM(WASMAudioDecoderCommon).getModule().then((module) => { | ||
this._postToDecoder("init", { module, options }); | ||
}); | ||
@@ -107,0 +106,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58390
341