@next/swc-wasm-web 12.1.3 → 12.1.4

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/wasm.js +22 -22
  3. package/wasm_bg.wasm +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-web",
3
- "version": "12.1.3",
3
+ "version": "12.1.4",
4
4
  "files": [
5
5
  "wasm_bg.wasm",
6
6
  "wasm.js",
package/wasm.js CHANGED
@@ -21,7 +21,9 @@ function takeObject(idx) {
21
21
  return ret;
22
22
  }
23
23
 
24
- let WASM_VECTOR_LEN = 0;
24
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
25
+
26
+ cachedTextDecoder.decode();
25
27
 
26
28
  let cachegetUint8Memory0 = null;
27
29
  function getUint8Memory0() {
@@ -31,6 +33,21 @@ function getUint8Memory0() {
31
33
  return cachegetUint8Memory0;
32
34
  }
33
35
 
36
+ function getStringFromWasm0(ptr, len) {
37
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
38
+ }
39
+
40
+ function addHeapObject(obj) {
41
+ if (heap_next === heap.length) heap.push(heap.length + 1);
42
+ const idx = heap_next;
43
+ heap_next = heap[idx];
44
+
45
+ heap[idx] = obj;
46
+ return idx;
47
+ }
48
+
49
+ let WASM_VECTOR_LEN = 0;
50
+
34
51
  let cachedTextEncoder = new TextEncoder('utf-8');
35
52
 
36
53
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -91,23 +108,6 @@ function getInt32Memory0() {
91
108
  }
92
109
  return cachegetInt32Memory0;
93
110
  }
94
-
95
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
96
-
97
- cachedTextDecoder.decode();
98
-
99
- function getStringFromWasm0(ptr, len) {
100
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
101
- }
102
-
103
- function addHeapObject(obj) {
104
- if (heap_next === heap.length) heap.push(heap.length + 1);
105
- const idx = heap_next;
106
- heap_next = heap[idx];
107
-
108
- heap[idx] = obj;
109
- return idx;
110
- }
111
111
  /**
112
112
  * @param {string} s
113
113
  * @param {any} opts
@@ -202,6 +202,10 @@ async function init(input) {
202
202
  wasm.__wbindgen_free(arg0, arg1);
203
203
  }
204
204
  };
205
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
206
+ var ret = getStringFromWasm0(arg0, arg1);
207
+ return addHeapObject(ret);
208
+ };
205
209
  imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
206
210
  const obj = getObject(arg1);
207
211
  var ret = JSON.stringify(obj === undefined ? null : obj);
@@ -210,10 +214,6 @@ async function init(input) {
210
214
  getInt32Memory0()[arg0 / 4 + 1] = len0;
211
215
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
212
216
  };
213
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
214
- var ret = getStringFromWasm0(arg0, arg1);
215
- return addHeapObject(ret);
216
- };
217
217
  imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
218
218
  var ret = JSON.parse(getStringFromWasm0(arg0, arg1));
219
219
  return addHeapObject(ret);
package/wasm_bg.wasm CHANGED
Binary file