@spglib/moyo-wasm 0.4.8 → 0.6.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/moyo_wasm.d.ts CHANGED
@@ -48,9 +48,9 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
48
48
  export interface InitOutput {
49
49
  readonly memory: WebAssembly.Memory;
50
50
  readonly analyze_cell: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
51
- readonly __wbindgen_export_0: WebAssembly.Table;
52
51
  readonly __wbindgen_malloc: (a: number, b: number) => number;
53
52
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
53
+ readonly __wbindgen_export_2: WebAssembly.Table;
54
54
  readonly __externref_table_dealloc: (a: number) => void;
55
55
  readonly __wbindgen_start: () => void;
56
56
  }
package/moyo_wasm.js CHANGED
@@ -1,8 +1,6 @@
1
1
  let wasm;
2
2
 
3
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
4
-
5
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
3
+ let WASM_VECTOR_LEN = 0;
6
4
 
7
5
  let cachedUint8ArrayMemory0 = null;
8
6
 
@@ -13,13 +11,6 @@ function getUint8ArrayMemory0() {
13
11
  return cachedUint8ArrayMemory0;
14
12
  }
15
13
 
16
- function getStringFromWasm0(ptr, len) {
17
- ptr = ptr >>> 0;
18
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
19
- }
20
-
21
- let WASM_VECTOR_LEN = 0;
22
-
23
14
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
24
15
 
25
16
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -74,8 +65,26 @@ function passStringToWasm0(arg, malloc, realloc) {
74
65
  return ptr;
75
66
  }
76
67
 
68
+ let cachedDataViewMemory0 = null;
69
+
70
+ function getDataViewMemory0() {
71
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
72
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
73
+ }
74
+ return cachedDataViewMemory0;
75
+ }
76
+
77
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
78
+
79
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
80
+
81
+ function getStringFromWasm0(ptr, len) {
82
+ ptr = ptr >>> 0;
83
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
84
+ }
85
+
77
86
  function takeFromExternrefTable0(idx) {
78
- const value = wasm.__wbindgen_export_0.get(idx);
87
+ const value = wasm.__wbindgen_export_2.get(idx);
79
88
  wasm.__externref_table_dealloc(idx);
80
89
  return value;
81
90
  }
@@ -132,6 +141,13 @@ async function __wbg_load(module, imports) {
132
141
  function __wbg_get_imports() {
133
142
  const imports = {};
134
143
  imports.wbg = {};
144
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
145
+ const ret = String(arg1);
146
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
147
+ const len1 = WASM_VECTOR_LEN;
148
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
149
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
150
+ };
135
151
  imports.wbg.__wbg_new_405e22f390576ce2 = function() {
136
152
  const ret = new Object();
137
153
  return ret;
@@ -143,7 +159,7 @@ function __wbg_get_imports() {
143
159
  imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
144
160
  arg0[arg1 >>> 0] = arg2;
145
161
  };
146
- imports.wbg.__wbg_set_3807d5f0bfc24aa7 = function(arg0, arg1, arg2) {
162
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
147
163
  arg0[arg1] = arg2;
148
164
  };
149
165
  imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
@@ -155,7 +171,7 @@ function __wbg_get_imports() {
155
171
  return ret;
156
172
  };
157
173
  imports.wbg.__wbindgen_init_externref_table = function() {
158
- const table = wasm.__wbindgen_export_0;
174
+ const table = wasm.__wbindgen_export_2;
159
175
  const offset = table.grow(4);
160
176
  table.set(0, undefined);
161
177
  table.set(offset + 0, undefined);
@@ -186,6 +202,7 @@ function __wbg_init_memory(imports, memory) {
186
202
  function __wbg_finalize_init(instance, module) {
187
203
  wasm = instance.exports;
188
204
  __wbg_init.__wbindgen_wasm_module = module;
205
+ cachedDataViewMemory0 = null;
189
206
  cachedUint8ArrayMemory0 = null;
190
207
 
191
208
 
package/moyo_wasm_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@spglib/moyo-wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for moyo crystal symmetry analysis",
5
- "version": "0.4.8",
5
+ "version": "0.6.0",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",