web-csv-toolbox 0.11.1-next-fb706b1cb14c761e4e12ba9f1c7dc3377ac86b92 → 0.11.1-next-f985fe6e4cca0fb4a8764a2313edac280438e948

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.
@@ -3,33 +3,18 @@ let wasm;
3
3
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
4
4
 
5
5
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }
6
- let cachedUint8Memory0 = null;
6
+ let cachedUint8ArrayMemory0 = null;
7
7
 
8
- function getUint8Memory0() {
9
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
10
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
8
+ function getUint8ArrayMemory0() {
9
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
10
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
11
11
  }
12
- return cachedUint8Memory0;
12
+ return cachedUint8ArrayMemory0;
13
13
  }
14
14
 
15
15
  function getStringFromWasm0(ptr, len) {
16
16
  ptr = ptr >>> 0;
17
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
18
- }
19
-
20
- const heap = new Array(128).fill(undefined);
21
-
22
- heap.push(undefined, null, true, false);
23
-
24
- let heap_next = heap.length;
25
-
26
- function addHeapObject(obj) {
27
- if (heap_next === heap.length) heap.push(heap.length + 1);
28
- const idx = heap_next;
29
- heap_next = heap[idx];
30
-
31
- heap[idx] = obj;
32
- return idx;
17
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
33
18
  }
34
19
 
35
20
  let WASM_VECTOR_LEN = 0;
@@ -54,7 +39,7 @@ function passStringToWasm0(arg, malloc, realloc) {
54
39
  if (realloc === undefined) {
55
40
  const buf = cachedTextEncoder.encode(arg);
56
41
  const ptr = malloc(buf.length, 1) >>> 0;
57
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
42
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
58
43
  WASM_VECTOR_LEN = buf.length;
59
44
  return ptr;
60
45
  }
@@ -62,7 +47,7 @@ function passStringToWasm0(arg, malloc, realloc) {
62
47
  let len = arg.length;
63
48
  let ptr = malloc(len, 1) >>> 0;
64
49
 
65
- const mem = getUint8Memory0();
50
+ const mem = getUint8ArrayMemory0();
66
51
 
67
52
  let offset = 0;
68
53
 
@@ -77,7 +62,7 @@ function passStringToWasm0(arg, malloc, realloc) {
77
62
  arg = arg.slice(offset);
78
63
  }
79
64
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
80
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
65
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
81
66
  const ret = encodeString(arg, view);
82
67
 
83
68
  offset += ret.written;
@@ -87,30 +72,16 @@ function passStringToWasm0(arg, malloc, realloc) {
87
72
  WASM_VECTOR_LEN = offset;
88
73
  return ptr;
89
74
  }
90
-
91
- function getObject(idx) { return heap[idx]; }
92
-
93
- function dropObject(idx) {
94
- if (idx < 132) return;
95
- heap[idx] = heap_next;
96
- heap_next = idx;
97
- }
98
-
99
- function takeObject(idx) {
100
- const ret = getObject(idx);
101
- dropObject(idx);
102
- return ret;
103
- }
104
75
  /**
105
- * @param {string} input
106
- * @param {number} demiliter
107
- * @returns {any}
108
- */
76
+ * @param {string} input
77
+ * @param {number} demiliter
78
+ * @returns {any}
79
+ */
109
80
  function parseStringToArraySync(input, demiliter) {
110
81
  const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
111
82
  const len0 = WASM_VECTOR_LEN;
112
83
  const ret = wasm.parseStringToArraySync(ptr0, len0, demiliter);
113
- return takeObject(ret);
84
+ return ret;
114
85
  }
115
86
 
116
87
  async function __wbg_load(module, imports) {
@@ -121,7 +92,7 @@ async function __wbg_load(module, imports) {
121
92
 
122
93
  } catch (e) {
123
94
  if (module.headers.get('Content-Type') != 'application/wasm') {
124
- console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
95
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
125
96
 
126
97
  } else {
127
98
  throw e;
@@ -147,9 +118,18 @@ async function __wbg_load(module, imports) {
147
118
  function __wbg_get_imports() {
148
119
  const imports = {};
149
120
  imports.wbg = {};
121
+ imports.wbg.__wbindgen_init_externref_table = function() {
122
+ const table = wasm.__wbindgen_export_0;
123
+ const offset = table.grow(4);
124
+ table.set(0, undefined);
125
+ table.set(offset + 0, undefined);
126
+ table.set(offset + 1, null);
127
+ table.set(offset + 2, true);
128
+ table.set(offset + 3, false);
129
+ };
150
130
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
151
131
  const ret = getStringFromWasm0(arg0, arg1);
152
- return addHeapObject(ret);
132
+ return ret;
153
133
  };
154
134
 
155
135
  return imports;
@@ -158,25 +138,35 @@ function __wbg_get_imports() {
158
138
  function __wbg_finalize_init(instance, module) {
159
139
  wasm = instance.exports;
160
140
  __wbg_init.__wbindgen_wasm_module = module;
161
- cachedUint8Memory0 = null;
141
+ cachedUint8ArrayMemory0 = null;
162
142
 
163
143
 
144
+ wasm.__wbindgen_start();
164
145
  return wasm;
165
146
  }
166
147
 
167
- async function __wbg_init(input) {
148
+ async function __wbg_init(module_or_path) {
168
149
  if (wasm !== undefined) return wasm;
169
150
 
170
- if (typeof input === 'undefined') {
171
- input = "/web_csv_toolbox_wasm_bg.wasm";
151
+
152
+ if (typeof module_or_path !== 'undefined') {
153
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
154
+ ({module_or_path} = module_or_path);
155
+ } else {
156
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead');
157
+ }
158
+ }
159
+
160
+ if (typeof module_or_path === 'undefined') {
161
+ module_or_path = new URL("web_csv_toolbox_wasm_bg.wasm", import.meta.url);
172
162
  }
173
163
  const imports = __wbg_get_imports();
174
164
 
175
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
176
- input = fetch(input);
165
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
166
+ module_or_path = fetch(module_or_path);
177
167
  }
178
168
 
179
- const { instance, module } = await __wbg_load(await input, imports);
169
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
180
170
 
181
171
  return __wbg_finalize_init(instance, module);
182
172
  }
@@ -1 +1 @@
1
- {"version":3,"file":"_web-csv-toolbox-wasm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"_web-csv-toolbox-wasm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}