saito-js 0.1.24 → 0.1.25
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/lib/wasm_wrapper.d.ts +1 -1
- package/lib/wasm_wrapper.d.ts.map +1 -1
- package/lib/wasm_wrapper.js +15 -4
- package/lib/wasm_wrapper.js.map +1 -1
- package/package.json +2 -2
- package/tsconfig.json +5 -0
package/lib/wasm_wrapper.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasm_wrapper.d.ts","sourceRoot":"","sources":["../../lib/wasm_wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wasm_wrapper.d.ts","sourceRoot":"","sources":["../../lib/wasm_wrapper.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAO,WAAW,CAAC,CAAC;IACzB,QAAQ,EAAE,CAAC,CAAC;IAInB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAOpB;gBAES,QAAQ,EAAE,CAAC;CAUxB"}
|
package/lib/wasm_wrapper.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// let registry = new FinalizationRegistry((heldValue: any) => {
|
|
3
|
+
// heldValue.free();
|
|
4
|
+
// });
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
class WasmWrapper {
|
|
4
7
|
constructor(instance) {
|
|
5
8
|
this.instance = instance;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
this.instance.free();
|
|
9
|
+
WasmWrapper.registry.register(this, instance);
|
|
10
|
+
// WasmWrapper.createdCounter++;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
exports.default = WasmWrapper;
|
|
14
|
+
// private static createdCounter = 0;
|
|
15
|
+
// private static deletedCounter = 0;
|
|
16
|
+
WasmWrapper.registry = new FinalizationRegistry((value) => {
|
|
17
|
+
// WasmWrapper.deletedCounter++;
|
|
18
|
+
// console.log(`deleted : ${WasmWrapper.deletedCounter} created : ${WasmWrapper.createdCounter} ptr : ${value.__wbg_ptr}`);
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
if (value && !!value.__wbg_ptr) {
|
|
21
|
+
value.free();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
13
24
|
//# sourceMappingURL=wasm_wrapper.js.map
|
package/lib/wasm_wrapper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasm_wrapper.js","sourceRoot":"","sources":["../../lib/wasm_wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wasm_wrapper.js","sourceRoot":"","sources":["../../lib/wasm_wrapper.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sBAAsB;AACtB,MAAM;;AAEN,MAAqB,WAAW;IAc9B,YAAY,QAAW;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9C,gCAAgC;IAClC,CAAC;;AAlBH,8BAwBC;AArBC,qCAAqC;AACrC,qCAAqC;AACtB,oBAAQ,GAAG,IAAI,oBAAoB,CAAC,CAAC,KAAU,EAAE,EAAE;IAChE,gCAAgC;IAChC,2HAA2H;IAC3H,aAAa;IACb,IAAI,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE;QAC9B,KAAK,CAAC,IAAI,EAAE,CAAC;KACd;AACH,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saito-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "js wrappings around saito-core using wasm",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "env TS_NODE_PROJECT=\"tsconfig.testing.json\" mocha --require ts-node/register 'tests/**/*.ts'",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"morgan": "~1.10.0",
|
|
37
37
|
"node-fetch": "^2.6.1",
|
|
38
38
|
"process": "^0.11.10",
|
|
39
|
-
"saito-wasm": "^0.1.
|
|
39
|
+
"saito-wasm": "^0.1.25",
|
|
40
40
|
"url": "^0.11.0",
|
|
41
41
|
"util": "^0.12.5",
|
|
42
42
|
"ws": "^8.13.0"
|