@thi.ng/wasm-api 2.4.20 → 2.4.22
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/bridge.js +18 -12
- package/package.json +8 -8
package/bridge.js
CHANGED
|
@@ -113,19 +113,25 @@ let WasmBridge = class {
|
|
|
113
113
|
if (!unique.has(d)) queue.push(d);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
const graph = [...unique].reduce(
|
|
117
|
-
|
|
118
|
-
(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
const graph = [...unique].reduce(
|
|
117
|
+
(acc, mod) => {
|
|
118
|
+
assert(
|
|
119
|
+
(acc[mod.id] === void 0 || acc[mod.id] === mod) && mod.id !== this.id,
|
|
120
|
+
`duplicate API module ID: ${mod.id}`
|
|
121
|
+
);
|
|
122
|
+
acc[mod.id] = mod;
|
|
123
|
+
return acc;
|
|
124
|
+
},
|
|
125
|
+
{}
|
|
126
|
+
);
|
|
124
127
|
this.order = topoSort(graph, (mod) => mod.deps?.map((x) => x.id));
|
|
125
|
-
this.modules = this.order.reduce(
|
|
126
|
-
acc
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
this.modules = this.order.reduce(
|
|
129
|
+
(acc, id) => {
|
|
130
|
+
acc[id] = graph[id].factory(this);
|
|
131
|
+
return acc;
|
|
132
|
+
},
|
|
133
|
+
{}
|
|
134
|
+
);
|
|
129
135
|
}
|
|
130
136
|
/**
|
|
131
137
|
* Instantiates WASM module from given `src` (and optional provided extra
|
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.22",
|
|
4
4
|
"description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@thi.ng/api": "^8.12.
|
|
47
|
-
"@thi.ng/arrays": "^2.14.
|
|
48
|
-
"@thi.ng/checks": "^3.8.
|
|
49
|
-
"@thi.ng/errors": "^2.6.
|
|
46
|
+
"@thi.ng/api": "^8.12.17",
|
|
47
|
+
"@thi.ng/arrays": "^2.14.13",
|
|
48
|
+
"@thi.ng/checks": "^3.8.7",
|
|
49
|
+
"@thi.ng/errors": "^2.6.6",
|
|
50
50
|
"@thi.ng/hex": "^2.4.9",
|
|
51
|
-
"@thi.ng/idgen": "^2.2.
|
|
52
|
-
"@thi.ng/logger": "^3.
|
|
51
|
+
"@thi.ng/idgen": "^2.2.91",
|
|
52
|
+
"@thi.ng/logger": "^3.3.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"esbuild": "^0.27.2",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"tag": "wasm",
|
|
128
128
|
"year": 2022
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "1107498d31504dc63d1a457b5def387d7a134f69\n"
|
|
131
131
|
}
|