@thi.ng/wasm-api 2.4.11 → 2.4.13
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/README.md +1 -1
- package/bridge.js +4 -4
- package/object-index.js +2 -2
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 212 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/bridge.js
CHANGED
|
@@ -42,7 +42,7 @@ let WasmBridge = class {
|
|
|
42
42
|
printU64Hex: (x) => this.logger.debug(() => `0x${U64BIG(x)}`),
|
|
43
43
|
printHexdump: (addr, len) => {
|
|
44
44
|
this.ensureMemory();
|
|
45
|
-
for (
|
|
45
|
+
for (const line of hexdumpLines(this.u8, addr, len)) {
|
|
46
46
|
this.logger.debug(line);
|
|
47
47
|
}
|
|
48
48
|
},
|
|
@@ -109,7 +109,7 @@ let WasmBridge = class {
|
|
|
109
109
|
const mod = queue.shift();
|
|
110
110
|
unique.add(mod);
|
|
111
111
|
if (!mod.deps) continue;
|
|
112
|
-
for (
|
|
112
|
+
for (const d of mod.deps) {
|
|
113
113
|
if (!unique.has(d)) queue.push(d);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -161,7 +161,7 @@ let WasmBridge = class {
|
|
|
161
161
|
async init(exports) {
|
|
162
162
|
this.exports = exports;
|
|
163
163
|
this.ensureMemory(false);
|
|
164
|
-
for (
|
|
164
|
+
for (const id of this.order) {
|
|
165
165
|
this.logger.debug(`initializing API module: ${id}`);
|
|
166
166
|
const status = await this.modules[id].init(this);
|
|
167
167
|
if (!status) return false;
|
|
@@ -235,7 +235,7 @@ let WasmBridge = class {
|
|
|
235
235
|
getImports() {
|
|
236
236
|
if (!this.imports) {
|
|
237
237
|
this.imports = { [this.id]: this.api };
|
|
238
|
-
for (
|
|
238
|
+
for (const id in this.modules) {
|
|
239
239
|
this.imports[id] = this.modules[id].getImports();
|
|
240
240
|
}
|
|
241
241
|
}
|
package/object-index.js
CHANGED
|
@@ -15,7 +15,7 @@ class ObjectIndex {
|
|
|
15
15
|
return this.idgen[Symbol.iterator]();
|
|
16
16
|
}
|
|
17
17
|
*values() {
|
|
18
|
-
for (
|
|
18
|
+
for (const id of this.idgen) {
|
|
19
19
|
yield this.items[id];
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -86,7 +86,7 @@ class ObjectIndex {
|
|
|
86
86
|
* @param ensure
|
|
87
87
|
*/
|
|
88
88
|
find(pred, ensure = true) {
|
|
89
|
-
for (
|
|
89
|
+
for (const id of this.idgen) {
|
|
90
90
|
if (pred(this.items[id])) return id;
|
|
91
91
|
}
|
|
92
92
|
assert(!ensure, `given predicate matched no ${this.name}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/wasm-api",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.13",
|
|
4
4
|
"description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@thi.ng/api": "^8.12.
|
|
46
|
-
"@thi.ng/arrays": "^2.14.
|
|
47
|
-
"@thi.ng/checks": "^3.
|
|
48
|
-
"@thi.ng/errors": "^2.
|
|
49
|
-
"@thi.ng/hex": "^2.4.
|
|
50
|
-
"@thi.ng/idgen": "^2.2.
|
|
51
|
-
"@thi.ng/logger": "^3.2.
|
|
45
|
+
"@thi.ng/api": "^8.12.11",
|
|
46
|
+
"@thi.ng/arrays": "^2.14.4",
|
|
47
|
+
"@thi.ng/checks": "^3.8.1",
|
|
48
|
+
"@thi.ng/errors": "^2.6.0",
|
|
49
|
+
"@thi.ng/hex": "^2.4.4",
|
|
50
|
+
"@thi.ng/idgen": "^2.2.85",
|
|
51
|
+
"@thi.ng/logger": "^3.2.10"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"esbuild": "^0.27.0",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"tag": "wasm",
|
|
127
127
|
"year": 2022
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "e7a21b9d2a188fa04d4c893d8531c40fbc0f4c06\n"
|
|
130
130
|
}
|