m-bus-parser-wasm-pack 0.0.1 → 0.0.3

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.
@@ -1,7 +1,8 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * @param {string} s
4
+ * @param {string} data
5
+ * @param {string} format
5
6
  * @returns {string}
6
7
  */
7
- export function m_bus_parse(s: string): string;
8
+ export function m_bus_parse(data: string, format: string): string;
@@ -91,25 +91,28 @@ function getStringFromWasm0(ptr, len) {
91
91
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
92
92
  }
93
93
  /**
94
- * @param {string} s
94
+ * @param {string} data
95
+ * @param {string} format
95
96
  * @returns {string}
96
97
  */
97
- export function m_bus_parse(s) {
98
- let deferred2_0;
99
- let deferred2_1;
98
+ export function m_bus_parse(data, format) {
99
+ let deferred3_0;
100
+ let deferred3_1;
100
101
  try {
101
102
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
102
- const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
103
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
103
104
  const len0 = WASM_VECTOR_LEN;
104
- wasm.m_bus_parse(retptr, ptr0, len0);
105
+ const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
106
+ const len1 = WASM_VECTOR_LEN;
107
+ wasm.m_bus_parse(retptr, ptr0, len0, ptr1, len1);
105
108
  var r0 = getInt32Memory0()[retptr / 4 + 0];
106
109
  var r1 = getInt32Memory0()[retptr / 4 + 1];
107
- deferred2_0 = r0;
108
- deferred2_1 = r1;
110
+ deferred3_0 = r0;
111
+ deferred3_1 = r1;
109
112
  return getStringFromWasm0(r0, r1);
110
113
  } finally {
111
114
  wasm.__wbindgen_add_to_stack_pointer(16);
112
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
115
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
113
116
  }
114
117
  }
115
118
 
Binary file
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "m-bus-parser-wasm-pack",
3
+ "type": "module",
3
4
  "collaborators": [
4
5
  "Michael Aebli"
5
6
  ],
6
7
  "description": "A wasm-pack to use the library for parsing M-Bus frames",
7
- "version": "0.0.1",
8
+ "version": "0.0.3",
8
9
  "license": "MIT",
9
10
  "repository": {
10
11
  "type": "git",
@@ -16,7 +17,7 @@
16
17
  "m_bus_parser_wasm_pack_bg.js",
17
18
  "m_bus_parser_wasm_pack.d.ts"
18
19
  ],
19
- "module": "m_bus_parser_wasm_pack.js",
20
+ "main": "m_bus_parser_wasm_pack.js",
20
21
  "homepage": "https://maebli.github.io/",
21
22
  "types": "m_bus_parser_wasm_pack.d.ts",
22
23
  "sideEffects": [