@budhash/gomanize 1.0.0 → 1.1.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.
- package/README.md +1 -1
- package/dist/gomanize.wasm +0 -0
- package/dist/wasm_exec.js +1 -15
- package/index.cjs +4 -1
- package/index.d.ts +4 -1
- package/index.mjs +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/gomanize.wasm
CHANGED
|
Binary file
|
package/dist/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
|
|
17
|
+
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused
|
|
18
18
|
writeSync(fd, buf) {
|
|
19
19
|
outputBuf += decoder.decode(buf);
|
|
20
20
|
const nl = outputBuf.lastIndexOf("\n");
|
|
@@ -73,14 +73,6 @@
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
if (!globalThis.path) {
|
|
77
|
-
globalThis.path = {
|
|
78
|
-
resolve(...pathSegments) {
|
|
79
|
-
return pathSegments.join("/");
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
76
|
if (!globalThis.crypto) {
|
|
85
77
|
throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");
|
|
86
78
|
}
|
|
@@ -216,16 +208,10 @@
|
|
|
216
208
|
return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));
|
|
217
209
|
}
|
|
218
210
|
|
|
219
|
-
const testCallExport = (a, b) => {
|
|
220
|
-
this._inst.exports.testExport0();
|
|
221
|
-
return this._inst.exports.testExport(a, b);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
211
|
const timeOrigin = Date.now() - performance.now();
|
|
225
212
|
this.importObject = {
|
|
226
213
|
_gotest: {
|
|
227
214
|
add: (a, b) => a + b,
|
|
228
|
-
callExport: testCallExport,
|
|
229
215
|
},
|
|
230
216
|
gojs: {
|
|
231
217
|
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
|
package/index.cjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// @budhash/gomanize — CommonJS loader (Node). Same engine as index.mjs.
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
/** Package version (kept in sync with package.json on release). */
|
|
5
|
+
const version = "1.1.0";
|
|
6
|
+
|
|
4
7
|
let _instance;
|
|
5
8
|
|
|
6
9
|
async function load(opts = {}) {
|
|
@@ -27,5 +30,5 @@ async function load(opts = {}) {
|
|
|
27
30
|
return _instance;
|
|
28
31
|
}
|
|
29
32
|
|
|
30
|
-
module.exports = { load };
|
|
33
|
+
module.exports = { load, version };
|
|
31
34
|
module.exports.default = module.exports;
|
package/index.d.ts
CHANGED
|
@@ -50,5 +50,8 @@ export interface LoadOptions {
|
|
|
50
50
|
*/
|
|
51
51
|
export function load(opts?: LoadOptions): Promise<Gomanize>;
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
/** Package version, e.g. "1.1.0". */
|
|
54
|
+
export const version: string;
|
|
55
|
+
|
|
56
|
+
declare const _default: { load: typeof load; version: string };
|
|
54
57
|
export default _default;
|
package/index.mjs
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
// it, resolved relative to this module via import.meta.url). No top-level Node
|
|
4
4
|
// imports, so bundling for the browser stays clean.
|
|
5
5
|
|
|
6
|
+
/** Package version (kept in sync with package.json on release). */
|
|
7
|
+
export const version = "1.1.0";
|
|
8
|
+
|
|
6
9
|
let _instance;
|
|
7
10
|
|
|
8
11
|
const isNode = () =>
|
|
@@ -56,4 +59,4 @@ export async function load(opts = {}) {
|
|
|
56
59
|
return _instance;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
export default { load };
|
|
62
|
+
export default { load, version };
|
package/package.json
CHANGED