@thi.ng/wasm-api 1.5.3 → 1.5.4
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/CHANGELOG.md +1 -1
- package/bridge.js +3 -6
- package/object-index.js +1 -2
- package/package.json +13 -13
- package/string.js +2 -4
- package/zig/zig-cache/tmp/3411e025a5f335c7/build +0 -0
package/CHANGELOG.md
CHANGED
package/bridge.js
CHANGED
|
@@ -5,8 +5,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
5
5
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
6
|
if (decorator = decorators[i])
|
|
7
7
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result)
|
|
9
|
-
__defProp(target, key, result);
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
9
|
return result;
|
|
11
10
|
};
|
|
12
11
|
import { INotifyMixin } from "@thi.ng/api/mixins/inotify";
|
|
@@ -138,8 +137,7 @@ let WasmBridge = class {
|
|
|
138
137
|
assert(!!this.modules[id], `missing API module: ${id}`);
|
|
139
138
|
this.logger.debug(`initializing API module: ${id}`);
|
|
140
139
|
const status = await this.modules[id].init(this);
|
|
141
|
-
if (!status)
|
|
142
|
-
return false;
|
|
140
|
+
if (!status) return false;
|
|
143
141
|
}
|
|
144
142
|
this.notify({ id: EVENT_MEMORY_CHANGED, value: this.exports.memory });
|
|
145
143
|
return true;
|
|
@@ -155,8 +153,7 @@ let WasmBridge = class {
|
|
|
155
153
|
*/
|
|
156
154
|
ensureMemory(notify = true) {
|
|
157
155
|
const buf = this.exports.memory.buffer;
|
|
158
|
-
if (this.u8 && this.u8.buffer === buf)
|
|
159
|
-
return;
|
|
156
|
+
if (this.u8 && this.u8.buffer === buf) return;
|
|
160
157
|
this.i8 = new Int8Array(buf);
|
|
161
158
|
this.u8 = new Uint8Array(buf);
|
|
162
159
|
this.i16 = new Int16Array(buf);
|
package/object-index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/wasm-api",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@thi.ng/api": "^8.11.
|
|
41
|
-
"@thi.ng/arrays": "^2.9.
|
|
42
|
-
"@thi.ng/checks": "^3.6.
|
|
43
|
-
"@thi.ng/errors": "^2.5.
|
|
44
|
-
"@thi.ng/hex": "^2.3.
|
|
45
|
-
"@thi.ng/idgen": "^2.2.
|
|
46
|
-
"@thi.ng/logger": "^3.0.
|
|
40
|
+
"@thi.ng/api": "^8.11.2",
|
|
41
|
+
"@thi.ng/arrays": "^2.9.6",
|
|
42
|
+
"@thi.ng/checks": "^3.6.4",
|
|
43
|
+
"@thi.ng/errors": "^2.5.7",
|
|
44
|
+
"@thi.ng/hex": "^2.3.46",
|
|
45
|
+
"@thi.ng/idgen": "^2.2.41",
|
|
46
|
+
"@thi.ng/logger": "^3.0.12"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@microsoft/api-extractor": "^7.43.
|
|
50
|
-
"esbuild": "^0.
|
|
51
|
-
"typedoc": "^0.25.
|
|
52
|
-
"typescript": "^5.4.
|
|
49
|
+
"@microsoft/api-extractor": "^7.43.2",
|
|
50
|
+
"esbuild": "^0.21.1",
|
|
51
|
+
"typedoc": "^0.25.13",
|
|
52
|
+
"typescript": "^5.4.5"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"allocator",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"status": "alpha",
|
|
116
116
|
"year": 2022
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
|
|
119
119
|
}
|
package/string.js
CHANGED
|
@@ -50,8 +50,7 @@ class WasmStringSlice {
|
|
|
50
50
|
set(str) {
|
|
51
51
|
this.mem.ensureMemory();
|
|
52
52
|
if (typeof str === "string") {
|
|
53
|
-
if (this.isConst)
|
|
54
|
-
unsupported("can't mutate const string");
|
|
53
|
+
if (this.isConst) unsupported("can't mutate const string");
|
|
55
54
|
this.mem.u32[this.base + 4 >>> 2] = this.mem.setString(
|
|
56
55
|
str,
|
|
57
56
|
this.addr,
|
|
@@ -158,8 +157,7 @@ class WasmStringPtr {
|
|
|
158
157
|
set(str) {
|
|
159
158
|
const addr = this.addr;
|
|
160
159
|
if (typeof str === "string") {
|
|
161
|
-
if (this.isConst)
|
|
162
|
-
unsupported("can't mutate const string");
|
|
160
|
+
if (this.isConst) unsupported("can't mutate const string");
|
|
163
161
|
this.mem.ensureMemory();
|
|
164
162
|
this.mem.setString(str, addr, this.mem.u8.byteLength - addr, true);
|
|
165
163
|
} else {
|
|
File without changes
|