@imam-inter/wasm-client-sdk 3.8.3-10 → 3.8.4-patch.5
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/assets/openIM.wasm +0 -0
- package/assets/wasm_exec.js +15 -1
- package/lib/index.es.js +3 -3
- package/lib/index.js +3 -3
- package/lib/index.umd.js +3 -3
- package/lib/worker-legacy.js +1 -1
- package/lib/worker.js +1 -1
- package/package.json +1 -1
package/assets/openIM.wasm
CHANGED
|
Binary file
|
package/assets/wasm_exec.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
if (!globalThis.fs) {
|
|
15
15
|
let outputBuf = "";
|
|
16
16
|
globalThis.fs = {
|
|
17
|
-
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused
|
|
17
|
+
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1, O_DIRECTORY: -1 }, // unused
|
|
18
18
|
writeSync(fd, buf) {
|
|
19
19
|
outputBuf += decoder.decode(buf);
|
|
20
20
|
const nl = outputBuf.lastIndexOf("\n");
|
|
@@ -73,6 +73,14 @@
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
if (!globalThis.path) {
|
|
77
|
+
globalThis.path = {
|
|
78
|
+
resolve(...pathSegments) {
|
|
79
|
+
return pathSegments.join("/");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
76
84
|
if (!globalThis.crypto) {
|
|
77
85
|
throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");
|
|
78
86
|
}
|
|
@@ -208,10 +216,16 @@
|
|
|
208
216
|
return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));
|
|
209
217
|
}
|
|
210
218
|
|
|
219
|
+
const testCallExport = (a, b) => {
|
|
220
|
+
this._inst.exports.testExport0();
|
|
221
|
+
return this._inst.exports.testExport(a, b);
|
|
222
|
+
}
|
|
223
|
+
|
|
211
224
|
const timeOrigin = Date.now() - performance.now();
|
|
212
225
|
this.importObject = {
|
|
213
226
|
_gotest: {
|
|
214
227
|
add: (a, b) => a + b,
|
|
228
|
+
callExport: testCallExport,
|
|
215
229
|
},
|
|
216
230
|
gojs: {
|
|
217
231
|
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
|
package/lib/index.es.js
CHANGED
|
@@ -490,13 +490,13 @@ function initWorker() {
|
|
|
490
490
|
? new URL('worker.js', import.meta.url)
|
|
491
491
|
: new URL('worker-legacy.js', import.meta.url);
|
|
492
492
|
if (isViteEnvironment) {
|
|
493
|
-
workerUrl = workerUrl.href.replace('.vite/deps', '@inter
|
|
493
|
+
workerUrl = workerUrl.href.replace('.vite/deps', '@imam-inter/wasm-client-sdk/lib');
|
|
494
494
|
}
|
|
495
495
|
if (isNuxtEnvironment) {
|
|
496
|
-
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@inter
|
|
496
|
+
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@imam-inter/wasm-client-sdk/lib');
|
|
497
497
|
}
|
|
498
498
|
if (isQuasarEnvironment) {
|
|
499
|
-
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@inter
|
|
499
|
+
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@imam-inter/wasm-client-sdk/lib');
|
|
500
500
|
}
|
|
501
501
|
worker = new Worker(workerUrl, {
|
|
502
502
|
type: isSupportModuleWorker ? 'module' : 'classic',
|
package/lib/index.js
CHANGED
|
@@ -494,13 +494,13 @@ function initWorker() {
|
|
|
494
494
|
? new URL('worker.js', (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href)))
|
|
495
495
|
: new URL('worker-legacy.js', (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href)));
|
|
496
496
|
if (isViteEnvironment) {
|
|
497
|
-
workerUrl = workerUrl.href.replace('.vite/deps', '@inter
|
|
497
|
+
workerUrl = workerUrl.href.replace('.vite/deps', '@imam-inter/wasm-client-sdk/lib');
|
|
498
498
|
}
|
|
499
499
|
if (isNuxtEnvironment) {
|
|
500
|
-
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@inter
|
|
500
|
+
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@imam-inter/wasm-client-sdk/lib');
|
|
501
501
|
}
|
|
502
502
|
if (isQuasarEnvironment) {
|
|
503
|
-
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@inter
|
|
503
|
+
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@imam-inter/wasm-client-sdk/lib');
|
|
504
504
|
}
|
|
505
505
|
worker = new Worker(workerUrl, {
|
|
506
506
|
type: isSupportModuleWorker ? 'module' : 'classic',
|
package/lib/index.umd.js
CHANGED
|
@@ -496,13 +496,13 @@
|
|
|
496
496
|
? new URL('worker.js', (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('index.umd.js', document.baseURI).href)))
|
|
497
497
|
: new URL('worker-legacy.js', (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('index.umd.js', document.baseURI).href)));
|
|
498
498
|
if (isViteEnvironment) {
|
|
499
|
-
workerUrl = workerUrl.href.replace('.vite/deps', '@inter
|
|
499
|
+
workerUrl = workerUrl.href.replace('.vite/deps', '@imam-inter/wasm-client-sdk/lib');
|
|
500
500
|
}
|
|
501
501
|
if (isNuxtEnvironment) {
|
|
502
|
-
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@inter
|
|
502
|
+
workerUrl = workerUrl.href.replace('.cache/vite/client/deps', '@imam-inter/wasm-client-sdk/lib');
|
|
503
503
|
}
|
|
504
504
|
if (isQuasarEnvironment) {
|
|
505
|
-
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@inter
|
|
505
|
+
workerUrl = workerUrl.href.replace(/\.q-cache\/dev-spa\/[^/]+\/deps/, '@imam-inter/wasm-client-sdk/lib');
|
|
506
506
|
}
|
|
507
507
|
worker = new Worker(workerUrl, {
|
|
508
508
|
type: isSupportModuleWorker ? 'module' : 'classic',
|