@gjsify/webassembly 0.3.21 → 0.4.0
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,__name=(t,n)=>e(t,`name`,{value:n,configurable:!0});export{__name};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=globalThis.WebAssembly;if(e===void 0)throw Error(`@gjsify/webassembly: globalThis.WebAssembly is not defined; nothing to polyfill.`);const t=e.Module,n=e.Instance;function compile(e){try{return Promise.resolve(new t(e))}catch(e){return Promise.reject(e)}}function validate(e){try{return new t(e),!0}catch{return!1}}function instantiate(e,r){try{if(e instanceof t)return Promise.resolve(new n(e,r));let i=new t(e),a=new n(i,r);return Promise.resolve({module:i,instance:a})}catch(e){return Promise.reject(e)}}async function bufferFromSource(e){return(await e).arrayBuffer()}async function compileStreaming(e){return compile(await bufferFromSource(e))}async function instantiateStreaming(e,t){return instantiate(await bufferFromSource(e),t)}var r={compile,compileStreaming,instantiate,instantiateStreaming,validate};export{compile,compileStreaming,r as default,instantiate,instantiateStreaming,validate};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=globalThis.WebAssembly;if(e===void 0)throw Error(`@gjsify/webassembly: globalThis.WebAssembly is not defined; nothing to polyfill.`);const t=e.Module,n=e.Instance;function compile(e){try{return Promise.resolve(new t(e))}catch(e){return Promise.reject(e)}}function validate(e){try{return new t(e),!0}catch{return!1}}function instantiate(e,r){try{if(e instanceof t)return Promise.resolve(new n(e,r));let i=new t(e),a=new n(i,r);return Promise.resolve({module:i,instance:a})}catch(e){return Promise.reject(e)}}async function bufferFromSource(e){return(await e).arrayBuffer()}async function compileStreaming(e){return compile(await bufferFromSource(e))}async function instantiateStreaming(e,t){return instantiate(await bufferFromSource(e),t)}var r={compile,compileStreaming,instantiate,instantiateStreaming,validate};export{compile,compileStreaming,r as default,instantiate,instantiateStreaming,validate};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/webassembly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "WebAssembly Promise-API polyfill for GJS — wraps the synchronous Module/Instance constructors that work in SpiderMonkey 128+.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"polyfill"
|
|
46
46
|
],
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@gjsify/cli": "^0.
|
|
49
|
-
"@gjsify/unit": "^0.
|
|
48
|
+
"@gjsify/cli": "^0.4.0",
|
|
49
|
+
"@gjsify/unit": "^0.4.0",
|
|
50
50
|
"@types/node": "^25.6.2",
|
|
51
51
|
"typescript": "^6.0.3"
|
|
52
52
|
}
|