@wasm-fmt/web_fmt 0.1.11 → 0.1.13

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/jsr.jsonc CHANGED
@@ -5,7 +5,7 @@
5
5
  "magic-akari <akari.ccino@gmail.com>"
6
6
  ],
7
7
  "description": "a formatter for web development powered by WASM",
8
- "version": "0.1.11",
8
+ "version": "0.1.13",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "magic-akari <akari.ccino@gmail.com>"
6
6
  ],
7
7
  "description": "a formatter for web development powered by WASM",
8
- "version": "0.1.11",
8
+ "version": "0.1.13",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
Binary file
package/web_fmt.d.ts CHANGED
@@ -1,41 +1,10 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * @param {string} src
5
- * @param {JsonConfig | undefined} [config]
6
- * @returns {string}
7
- */
8
- export function format_json(src: string, config?: JsonConfig): string;
9
- /**
10
- * @param {string} src
11
- * @param {string} filename
12
- * @param {StyleConfig | undefined} [config]
13
- * @returns {string}
14
- */
15
3
  export function format_style(src: string, filename: string, config?: StyleConfig): string;
16
- /**
17
- * @param {string} src
18
- * @param {string} filename
19
- * @param {Config | undefined} [config]
20
- * @returns {string}
21
- */
22
4
  export function format(src: string, filename: string, config?: Config): string;
23
- /**
24
- * @param {string} src
25
- * @param {string} filename
26
- * @param {MarkupConfig | undefined} [config]
27
- * @returns {string}
28
- */
5
+ export function format_json(src: string, config?: JsonConfig): string;
29
6
  export function format_markup(src: string, filename: string, config?: MarkupConfig): string;
30
- /**
31
- * @param {string} src
32
- * @param {string} filename
33
- * @param {ScriptConfig | undefined} [config]
34
- * @returns {string}
35
- */
36
7
  export function format_script(src: string, filename: string, config?: ScriptConfig): string;
37
- export type JsonConfig = LayoutConfig;
38
-
39
8
 
40
9
  export interface StyleConfig extends LayoutConfig {
41
10
  /**
@@ -52,6 +21,8 @@ export interface Config extends LayoutConfig {
52
21
  json?: JsonConfig;
53
22
  }
54
23
 
24
+ export type JsonConfig = LayoutConfig;
25
+
55
26
 
56
27
  export interface MarkupConfig extends LayoutConfig {
57
28
  /**
@@ -85,16 +56,16 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
85
56
 
86
57
  export interface InitOutput {
87
58
  readonly memory: WebAssembly.Memory;
88
- readonly format_json: (a: number, b: number, c: number, d: number) => void;
89
59
  readonly format_style: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
90
60
  readonly format: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
61
+ readonly format_json: (a: number, b: number, c: number, d: number) => void;
91
62
  readonly format_markup: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
92
63
  readonly format_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
93
64
  readonly __wbindgen_export_0: (a: number, b: number) => number;
94
65
  readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
66
+ readonly __wbindgen_export_2: (a: number) => void;
95
67
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
96
- readonly __wbindgen_export_2: (a: number, b: number, c: number) => void;
97
- readonly __wbindgen_export_3: (a: number) => void;
68
+ readonly __wbindgen_export_3: (a: number, b: number, c: number) => void;
98
69
  }
99
70
 
100
71
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/web_fmt.js CHANGED
@@ -1,67 +1,22 @@
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(); };
6
-
7
- let cachedUint8ArrayMemory0 = null;
8
-
9
- function getUint8ArrayMemory0() {
10
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
11
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
12
- }
13
- return cachedUint8ArrayMemory0;
14
- }
15
-
16
- function getStringFromWasm0(ptr, len) {
17
- ptr = ptr >>> 0;
18
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
19
- }
20
-
21
3
  const heap = new Array(128).fill(undefined);
22
4
 
23
5
  heap.push(undefined, null, true, false);
24
6
 
25
- let heap_next = heap.length;
26
-
27
- function addHeapObject(obj) {
28
- if (heap_next === heap.length) heap.push(heap.length + 1);
29
- const idx = heap_next;
30
- heap_next = heap[idx];
31
-
32
- heap[idx] = obj;
33
- return idx;
34
- }
35
-
36
7
  function getObject(idx) { return heap[idx]; }
37
8
 
38
- function dropObject(idx) {
39
- if (idx < 132) return;
40
- heap[idx] = heap_next;
41
- heap_next = idx;
42
- }
43
-
44
- function takeObject(idx) {
45
- const ret = getObject(idx);
46
- dropObject(idx);
47
- return ret;
48
- }
49
-
50
- function isLikeNone(x) {
51
- return x === undefined || x === null;
52
- }
9
+ let WASM_VECTOR_LEN = 0;
53
10
 
54
- let cachedDataViewMemory0 = null;
11
+ let cachedUint8ArrayMemory0 = null;
55
12
 
56
- function getDataViewMemory0() {
57
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
58
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
13
+ function getUint8ArrayMemory0() {
14
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
15
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
59
16
  }
60
- return cachedDataViewMemory0;
17
+ return cachedUint8ArrayMemory0;
61
18
  }
62
19
 
63
- let WASM_VECTOR_LEN = 0;
64
-
65
20
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
66
21
 
67
22
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -116,6 +71,38 @@ function passStringToWasm0(arg, malloc, realloc) {
116
71
  return ptr;
117
72
  }
118
73
 
74
+ let cachedDataViewMemory0 = null;
75
+
76
+ function getDataViewMemory0() {
77
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
78
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
79
+ }
80
+ return cachedDataViewMemory0;
81
+ }
82
+
83
+ let heap_next = heap.length;
84
+
85
+ function addHeapObject(obj) {
86
+ if (heap_next === heap.length) heap.push(heap.length + 1);
87
+ const idx = heap_next;
88
+ heap_next = heap[idx];
89
+
90
+ heap[idx] = obj;
91
+ return idx;
92
+ }
93
+
94
+ function handleError(f, args) {
95
+ try {
96
+ return f.apply(this, args);
97
+ } catch (e) {
98
+ wasm.__wbindgen_export_2(addHeapObject(e));
99
+ }
100
+ }
101
+
102
+ function isLikeNone(x) {
103
+ return x === undefined || x === null;
104
+ }
105
+
119
106
  function debugString(val) {
120
107
  // primitive types
121
108
  const type = typeof val;
@@ -157,7 +144,7 @@ function debugString(val) {
157
144
  // Test for built-in
158
145
  const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
159
146
  let className;
160
- if (builtInMatches.length > 1) {
147
+ if (builtInMatches && builtInMatches.length > 1) {
161
148
  className = builtInMatches[1];
162
149
  } else {
163
150
  // Failed to match the standard '[object ClassName]'
@@ -180,45 +167,69 @@ function debugString(val) {
180
167
  // TODO we could test for more things here, like `Set`s and `Map`s.
181
168
  return className;
182
169
  }
170
+
171
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
172
+
173
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
174
+
175
+ function getStringFromWasm0(ptr, len) {
176
+ ptr = ptr >>> 0;
177
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
178
+ }
179
+
180
+ function dropObject(idx) {
181
+ if (idx < 132) return;
182
+ heap[idx] = heap_next;
183
+ heap_next = idx;
184
+ }
185
+
186
+ function takeObject(idx) {
187
+ const ret = getObject(idx);
188
+ dropObject(idx);
189
+ return ret;
190
+ }
183
191
  /**
184
192
  * @param {string} src
185
- * @param {JsonConfig | undefined} [config]
193
+ * @param {string} filename
194
+ * @param {StyleConfig | undefined} [config]
186
195
  * @returns {string}
187
196
  */
188
- export function format_json(src, config) {
189
- let deferred3_0;
190
- let deferred3_1;
197
+ export function format_style(src, filename, config) {
198
+ let deferred4_0;
199
+ let deferred4_1;
191
200
  try {
192
201
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
193
202
  const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
194
203
  const len0 = WASM_VECTOR_LEN;
195
- wasm.format_json(retptr, ptr0, len0, isLikeNone(config) ? 0 : addHeapObject(config));
204
+ const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
205
+ const len1 = WASM_VECTOR_LEN;
206
+ wasm.format_style(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
196
207
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
197
208
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
198
209
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
199
210
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
200
- var ptr2 = r0;
201
- var len2 = r1;
211
+ var ptr3 = r0;
212
+ var len3 = r1;
202
213
  if (r3) {
203
- ptr2 = 0; len2 = 0;
214
+ ptr3 = 0; len3 = 0;
204
215
  throw takeObject(r2);
205
216
  }
206
- deferred3_0 = ptr2;
207
- deferred3_1 = len2;
208
- return getStringFromWasm0(ptr2, len2);
217
+ deferred4_0 = ptr3;
218
+ deferred4_1 = len3;
219
+ return getStringFromWasm0(ptr3, len3);
209
220
  } finally {
210
221
  wasm.__wbindgen_add_to_stack_pointer(16);
211
- wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
222
+ wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
212
223
  }
213
224
  }
214
225
 
215
226
  /**
216
227
  * @param {string} src
217
228
  * @param {string} filename
218
- * @param {StyleConfig | undefined} [config]
229
+ * @param {Config | undefined} [config]
219
230
  * @returns {string}
220
231
  */
221
- export function format_style(src, filename, config) {
232
+ export function format(src, filename, config) {
222
233
  let deferred4_0;
223
234
  let deferred4_1;
224
235
  try {
@@ -227,7 +238,7 @@ export function format_style(src, filename, config) {
227
238
  const len0 = WASM_VECTOR_LEN;
228
239
  const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
229
240
  const len1 = WASM_VECTOR_LEN;
230
- wasm.format_style(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
241
+ wasm.format(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
231
242
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
232
243
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
233
244
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -243,42 +254,39 @@ export function format_style(src, filename, config) {
243
254
  return getStringFromWasm0(ptr3, len3);
244
255
  } finally {
245
256
  wasm.__wbindgen_add_to_stack_pointer(16);
246
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
257
+ wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
247
258
  }
248
259
  }
249
260
 
250
261
  /**
251
262
  * @param {string} src
252
- * @param {string} filename
253
- * @param {Config | undefined} [config]
263
+ * @param {JsonConfig | undefined} [config]
254
264
  * @returns {string}
255
265
  */
256
- export function format(src, filename, config) {
257
- let deferred4_0;
258
- let deferred4_1;
266
+ export function format_json(src, config) {
267
+ let deferred3_0;
268
+ let deferred3_1;
259
269
  try {
260
270
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
261
271
  const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
262
272
  const len0 = WASM_VECTOR_LEN;
263
- const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
264
- const len1 = WASM_VECTOR_LEN;
265
- wasm.format(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
273
+ wasm.format_json(retptr, ptr0, len0, isLikeNone(config) ? 0 : addHeapObject(config));
266
274
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
267
275
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
268
276
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
269
277
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
270
- var ptr3 = r0;
271
- var len3 = r1;
278
+ var ptr2 = r0;
279
+ var len2 = r1;
272
280
  if (r3) {
273
- ptr3 = 0; len3 = 0;
281
+ ptr2 = 0; len2 = 0;
274
282
  throw takeObject(r2);
275
283
  }
276
- deferred4_0 = ptr3;
277
- deferred4_1 = len3;
278
- return getStringFromWasm0(ptr3, len3);
284
+ deferred3_0 = ptr2;
285
+ deferred3_1 = len2;
286
+ return getStringFromWasm0(ptr2, len2);
279
287
  } finally {
280
288
  wasm.__wbindgen_add_to_stack_pointer(16);
281
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
289
+ wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1);
282
290
  }
283
291
  }
284
292
 
@@ -313,7 +321,7 @@ export function format_markup(src, filename, config) {
313
321
  return getStringFromWasm0(ptr3, len3);
314
322
  } finally {
315
323
  wasm.__wbindgen_add_to_stack_pointer(16);
316
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
324
+ wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
317
325
  }
318
326
  }
319
327
 
@@ -348,15 +356,7 @@ export function format_script(src, filename, config) {
348
356
  return getStringFromWasm0(ptr3, len3);
349
357
  } finally {
350
358
  wasm.__wbindgen_add_to_stack_pointer(16);
351
- wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
352
- }
353
- }
354
-
355
- function handleError(f, args) {
356
- try {
357
- return f.apply(this, args);
358
- } catch (e) {
359
- wasm.__wbindgen_export_3(addHeapObject(e));
359
+ wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
360
360
  }
361
361
  }
362
362
 
@@ -394,137 +394,42 @@ async function __wbg_load(module, imports) {
394
394
  function __wbg_get_imports() {
395
395
  const imports = {};
396
396
  imports.wbg = {};
397
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
398
- const ret = new Error(getStringFromWasm0(arg0, arg1));
399
- return addHeapObject(ret);
400
- };
401
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
402
- takeObject(arg0);
403
- };
404
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
405
- const ret = getObject(arg0) === undefined;
406
- return ret;
407
- };
408
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
409
- const ret = getObject(arg0) in getObject(arg1);
410
- return ret;
411
- };
412
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
413
- const v = getObject(arg0);
414
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
415
- return ret;
416
- };
417
- imports.wbg.__wbindgen_is_bigint = function(arg0) {
418
- const ret = typeof(getObject(arg0)) === 'bigint';
419
- return ret;
420
- };
421
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
422
- const obj = getObject(arg1);
423
- const ret = typeof(obj) === 'number' ? obj : undefined;
424
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
425
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
426
- };
427
- imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
428
- const ret = arg0;
429
- return addHeapObject(ret);
430
- };
431
- imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
432
- const ret = getObject(arg0) === getObject(arg1);
433
- return ret;
434
- };
435
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
436
- const obj = getObject(arg1);
437
- const ret = typeof(obj) === 'string' ? obj : undefined;
438
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
439
- var len1 = WASM_VECTOR_LEN;
440
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
441
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
442
- };
443
- imports.wbg.__wbindgen_is_object = function(arg0) {
444
- const val = getObject(arg0);
445
- const ret = typeof(val) === 'object' && val !== null;
446
- return ret;
447
- };
448
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
449
- const ret = BigInt.asUintN(64, arg0);
450
- return addHeapObject(ret);
451
- };
452
- imports.wbg.__wbindgen_is_string = function(arg0) {
453
- const ret = typeof(getObject(arg0)) === 'string';
454
- return ret;
455
- };
456
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
457
- const ret = getObject(arg0);
458
- return addHeapObject(ret);
459
- };
460
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
461
- const ret = getStringFromWasm0(arg0, arg1);
462
- return addHeapObject(ret);
463
- };
464
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
465
- const ret = getObject(arg0) == getObject(arg1);
466
- return ret;
467
- };
468
- imports.wbg.__wbindgen_as_number = function(arg0) {
469
- const ret = +getObject(arg0);
470
- return ret;
471
- };
472
- imports.wbg.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
397
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
473
398
  const ret = String(getObject(arg1));
474
399
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
475
400
  const len1 = WASM_VECTOR_LEN;
476
401
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
477
402
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
478
403
  };
479
- imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
480
- const ret = getObject(arg0)[getObject(arg1)];
481
- return addHeapObject(ret);
482
- };
483
- imports.wbg.__wbg_get_5419cf6b954aa11d = function(arg0, arg1) {
484
- const ret = getObject(arg0)[arg1 >>> 0];
485
- return addHeapObject(ret);
486
- };
487
- imports.wbg.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
488
- const ret = getObject(arg0).length;
489
- return ret;
490
- };
491
- imports.wbg.__wbindgen_is_function = function(arg0) {
492
- const ret = typeof(getObject(arg0)) === 'function';
493
- return ret;
494
- };
495
- imports.wbg.__wbg_next_13b477da1eaa3897 = function(arg0) {
496
- const ret = getObject(arg0).next;
404
+ imports.wbg.__wbg_buffer_61b7ce01341d7f88 = function(arg0) {
405
+ const ret = getObject(arg0).buffer;
497
406
  return addHeapObject(ret);
498
407
  };
499
- imports.wbg.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
500
- const ret = getObject(arg0).next();
408
+ imports.wbg.__wbg_call_b0d8e36992d9900d = function() { return handleError(function (arg0, arg1) {
409
+ const ret = getObject(arg0).call(getObject(arg1));
501
410
  return addHeapObject(ret);
502
411
  }, arguments) };
503
- imports.wbg.__wbg_done_983b5ffcaec8c583 = function(arg0) {
412
+ imports.wbg.__wbg_done_f22c1561fa919baa = function(arg0) {
504
413
  const ret = getObject(arg0).done;
505
414
  return ret;
506
415
  };
507
- imports.wbg.__wbg_value_2ab8a198c834c26a = function(arg0) {
508
- const ret = getObject(arg0).value;
416
+ imports.wbg.__wbg_entries_4f2bb9b0d701c0f6 = function(arg0) {
417
+ const ret = Object.entries(getObject(arg0));
509
418
  return addHeapObject(ret);
510
419
  };
511
- imports.wbg.__wbg_iterator_695d699a44d6234c = function() {
512
- const ret = Symbol.iterator;
420
+ imports.wbg.__wbg_get_9aa3dff3f0266054 = function(arg0, arg1) {
421
+ const ret = getObject(arg0)[arg1 >>> 0];
513
422
  return addHeapObject(ret);
514
423
  };
515
- imports.wbg.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
424
+ imports.wbg.__wbg_get_bbccf8970793c087 = function() { return handleError(function (arg0, arg1) {
516
425
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
517
426
  return addHeapObject(ret);
518
427
  }, arguments) };
519
- imports.wbg.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
520
- const ret = getObject(arg0).call(getObject(arg1));
428
+ imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
429
+ const ret = getObject(arg0)[getObject(arg1)];
521
430
  return addHeapObject(ret);
522
- }, arguments) };
523
- imports.wbg.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
524
- const ret = Array.isArray(getObject(arg0));
525
- return ret;
526
431
  };
527
- imports.wbg.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) {
432
+ imports.wbg.__wbg_instanceof_ArrayBuffer_670ddde44cdb2602 = function(arg0) {
528
433
  let result;
529
434
  try {
530
435
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -534,7 +439,7 @@ function __wbg_get_imports() {
534
439
  const ret = result;
535
440
  return ret;
536
441
  };
537
- imports.wbg.__wbg_instanceof_Map_f96986929e7e89ed = function(arg0) {
442
+ imports.wbg.__wbg_instanceof_Map_98ecb30afec5acdb = function(arg0) {
538
443
  let result;
539
444
  try {
540
445
  result = getObject(arg0) instanceof Map;
@@ -544,45 +449,78 @@ function __wbg_get_imports() {
544
449
  const ret = result;
545
450
  return ret;
546
451
  };
547
- imports.wbg.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
452
+ imports.wbg.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function(arg0) {
453
+ let result;
454
+ try {
455
+ result = getObject(arg0) instanceof Uint8Array;
456
+ } catch (_) {
457
+ result = false;
458
+ }
459
+ const ret = result;
460
+ return ret;
461
+ };
462
+ imports.wbg.__wbg_isArray_1ba11a930108ec51 = function(arg0) {
463
+ const ret = Array.isArray(getObject(arg0));
464
+ return ret;
465
+ };
466
+ imports.wbg.__wbg_isSafeInteger_12f5549b2fca23f4 = function(arg0) {
548
467
  const ret = Number.isSafeInteger(getObject(arg0));
549
468
  return ret;
550
469
  };
551
- imports.wbg.__wbg_entries_c02034de337d3ee2 = function(arg0) {
552
- const ret = Object.entries(getObject(arg0));
470
+ imports.wbg.__wbg_iterator_23604bb983791576 = function() {
471
+ const ret = Symbol.iterator;
553
472
  return addHeapObject(ret);
554
473
  };
555
- imports.wbg.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
556
- const ret = getObject(arg0).buffer;
557
- return addHeapObject(ret);
474
+ imports.wbg.__wbg_length_65d1cd11729ced11 = function(arg0) {
475
+ const ret = getObject(arg0).length;
476
+ return ret;
477
+ };
478
+ imports.wbg.__wbg_length_d65cf0786bfc5739 = function(arg0) {
479
+ const ret = getObject(arg0).length;
480
+ return ret;
558
481
  };
559
- imports.wbg.__wbg_new_fec2611eb9180f95 = function(arg0) {
482
+ imports.wbg.__wbg_new_3ff5b33b1ce712df = function(arg0) {
560
483
  const ret = new Uint8Array(getObject(arg0));
561
484
  return addHeapObject(ret);
562
485
  };
563
- imports.wbg.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
486
+ imports.wbg.__wbg_next_01dd9234a5bf6d05 = function() { return handleError(function (arg0) {
487
+ const ret = getObject(arg0).next();
488
+ return addHeapObject(ret);
489
+ }, arguments) };
490
+ imports.wbg.__wbg_next_137428deb98342b0 = function(arg0) {
491
+ const ret = getObject(arg0).next;
492
+ return addHeapObject(ret);
493
+ };
494
+ imports.wbg.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) {
564
495
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
565
496
  };
566
- imports.wbg.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
567
- const ret = getObject(arg0).length;
568
- return ret;
497
+ imports.wbg.__wbg_value_4c32fd138a88eee2 = function(arg0) {
498
+ const ret = getObject(arg0).value;
499
+ return addHeapObject(ret);
569
500
  };
570
- imports.wbg.__wbg_instanceof_Uint8Array_df0761410414ef36 = function(arg0) {
571
- let result;
572
- try {
573
- result = getObject(arg0) instanceof Uint8Array;
574
- } catch (_) {
575
- result = false;
576
- }
577
- const ret = result;
501
+ imports.wbg.__wbindgen_as_number = function(arg0) {
502
+ const ret = +getObject(arg0);
578
503
  return ret;
579
504
  };
505
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
506
+ const ret = arg0;
507
+ return addHeapObject(ret);
508
+ };
509
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
510
+ const ret = BigInt.asUintN(64, arg0);
511
+ return addHeapObject(ret);
512
+ };
580
513
  imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
581
514
  const v = getObject(arg1);
582
515
  const ret = typeof(v) === 'bigint' ? v : undefined;
583
516
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
584
517
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
585
518
  };
519
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
520
+ const v = getObject(arg0);
521
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
522
+ return ret;
523
+ };
586
524
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
587
525
  const ret = debugString(getObject(arg1));
588
526
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -590,13 +528,75 @@ function __wbg_get_imports() {
590
528
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
591
529
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
592
530
  };
593
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
594
- throw new Error(getStringFromWasm0(arg0, arg1));
531
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
532
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
533
+ return addHeapObject(ret);
534
+ };
535
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
536
+ const ret = getObject(arg0) in getObject(arg1);
537
+ return ret;
538
+ };
539
+ imports.wbg.__wbindgen_is_bigint = function(arg0) {
540
+ const ret = typeof(getObject(arg0)) === 'bigint';
541
+ return ret;
542
+ };
543
+ imports.wbg.__wbindgen_is_function = function(arg0) {
544
+ const ret = typeof(getObject(arg0)) === 'function';
545
+ return ret;
546
+ };
547
+ imports.wbg.__wbindgen_is_object = function(arg0) {
548
+ const val = getObject(arg0);
549
+ const ret = typeof(val) === 'object' && val !== null;
550
+ return ret;
551
+ };
552
+ imports.wbg.__wbindgen_is_string = function(arg0) {
553
+ const ret = typeof(getObject(arg0)) === 'string';
554
+ return ret;
555
+ };
556
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
557
+ const ret = getObject(arg0) === undefined;
558
+ return ret;
559
+ };
560
+ imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
561
+ const ret = getObject(arg0) === getObject(arg1);
562
+ return ret;
563
+ };
564
+ imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
565
+ const ret = getObject(arg0) == getObject(arg1);
566
+ return ret;
595
567
  };
596
568
  imports.wbg.__wbindgen_memory = function() {
597
569
  const ret = wasm.memory;
598
570
  return addHeapObject(ret);
599
571
  };
572
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
573
+ const obj = getObject(arg1);
574
+ const ret = typeof(obj) === 'number' ? obj : undefined;
575
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
576
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
577
+ };
578
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
579
+ const ret = getObject(arg0);
580
+ return addHeapObject(ret);
581
+ };
582
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
583
+ takeObject(arg0);
584
+ };
585
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
586
+ const obj = getObject(arg1);
587
+ const ret = typeof(obj) === 'string' ? obj : undefined;
588
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
589
+ var len1 = WASM_VECTOR_LEN;
590
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
591
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
592
+ };
593
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
594
+ const ret = getStringFromWasm0(arg0, arg1);
595
+ return addHeapObject(ret);
596
+ };
597
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
598
+ throw new Error(getStringFromWasm0(arg0, arg1));
599
+ };
600
600
 
601
601
  return imports;
602
602
  }
package/web_fmt_bg.wasm CHANGED
Binary file
@@ -1,13 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function format_json(a: number, b: number, c: number, d: number): void;
5
- export function format_style(a: number, b: number, c: number, d: number, e: number, f: number): void;
6
- export function format(a: number, b: number, c: number, d: number, e: number, f: number): void;
7
- export function format_markup(a: number, b: number, c: number, d: number, e: number, f: number): void;
8
- export function format_script(a: number, b: number, c: number, d: number, e: number, f: number): void;
9
- export function __wbindgen_export_0(a: number, b: number): number;
10
- export function __wbindgen_export_1(a: number, b: number, c: number, d: number): number;
11
- export function __wbindgen_add_to_stack_pointer(a: number): number;
12
- export function __wbindgen_export_2(a: number, b: number, c: number): void;
13
- export function __wbindgen_export_3(a: number): void;
4
+ export const format_style: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
5
+ export const format: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
6
+ export const format_json: (a: number, b: number, c: number, d: number) => void;
7
+ export const format_markup: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
8
+ export const format_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
9
+ export const __wbindgen_export_0: (a: number, b: number) => number;
10
+ export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
11
+ export const __wbindgen_export_2: (a: number) => void;
12
+ export const __wbindgen_add_to_stack_pointer: (a: number) => number;
13
+ export const __wbindgen_export_3: (a: number, b: number, c: number) => void;
package/web_fmt_node.js CHANGED
@@ -3,7 +3,7 @@ import initAsync from "./web_fmt.js";
3
3
 
4
4
  const wasm = new URL("./web_fmt_bg.wasm", import.meta.url);
5
5
 
6
- export default function __wbg_init(init = fs.readFile(wasm)) {
6
+ export default function __wbg_init(init = { module_or_path: fs.readFile(wasm) }) {
7
7
  return initAsync(init);
8
8
  }
9
9
 
package/web_fmt_vite.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import initAsync from "./web_fmt.js";
2
2
  import wasm from "./web_fmt_bg.wasm?url";
3
3
 
4
- export default function __wbg_init(input = wasm) {
4
+ export default function __wbg_init(input = { module_or_path: wasm }) {
5
5
  return initAsync(input);
6
6
  }
7
7
 
Binary file