@wasm-fmt/web_fmt 0.1.8 → 0.1.10
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/package.json +1 -1
- package/web_fmt.d.ts +31 -31
- package/web_fmt.js +126 -112
- package/web_fmt_bg.wasm +0 -0
- package/web_fmt_bg.wasm.d.ts +6 -6
- package/jsr.jsonc +0 -36
package/package.json
CHANGED
package/web_fmt.d.ts
CHANGED
|
@@ -2,52 +2,38 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
4
|
* @param {string} src
|
|
5
|
-
* @param {
|
|
5
|
+
* @param {string} filename
|
|
6
|
+
* @param {StyleConfig | undefined} [config]
|
|
6
7
|
* @returns {string}
|
|
7
8
|
*/
|
|
8
|
-
export function
|
|
9
|
+
export function format_style(src: string, filename: string, config?: StyleConfig): string;
|
|
9
10
|
/**
|
|
10
11
|
* @param {string} src
|
|
11
12
|
* @param {string} filename
|
|
12
|
-
* @param {
|
|
13
|
+
* @param {Config | undefined} [config]
|
|
13
14
|
* @returns {string}
|
|
14
15
|
*/
|
|
15
|
-
export function
|
|
16
|
+
export function format(src: string, filename: string, config?: Config): string;
|
|
16
17
|
/**
|
|
17
18
|
* @param {string} src
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {StyleConfig | undefined} [config]
|
|
19
|
+
* @param {JsonConfig | undefined} [config]
|
|
20
20
|
* @returns {string}
|
|
21
21
|
*/
|
|
22
|
-
export function
|
|
22
|
+
export function format_json(src: string, config?: JsonConfig): string;
|
|
23
23
|
/**
|
|
24
24
|
* @param {string} src
|
|
25
25
|
* @param {string} filename
|
|
26
|
-
* @param {
|
|
26
|
+
* @param {MarkupConfig | undefined} [config]
|
|
27
27
|
* @returns {string}
|
|
28
28
|
*/
|
|
29
|
-
export function
|
|
29
|
+
export function format_markup(src: string, filename: string, config?: MarkupConfig): string;
|
|
30
30
|
/**
|
|
31
31
|
* @param {string} src
|
|
32
32
|
* @param {string} filename
|
|
33
|
-
* @param {
|
|
33
|
+
* @param {ScriptConfig | undefined} [config]
|
|
34
34
|
* @returns {string}
|
|
35
35
|
*/
|
|
36
|
-
export function
|
|
37
|
-
export type JsonConfig = LayoutConfig;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export interface ScriptConfig extends LayoutConfig {
|
|
41
|
-
quote_style?: "double" | "single";
|
|
42
|
-
jsx_quote_style?: "double" | "single";
|
|
43
|
-
quote_properties?: "preserve" | "as-needed";
|
|
44
|
-
trailing_comma?: "es5" | "all" | "none";
|
|
45
|
-
semicolons?: "always" | "as-needed";
|
|
46
|
-
arrow_parentheses?: "always" | "as-needed";
|
|
47
|
-
bracket_spacing?: boolean;
|
|
48
|
-
bracket_same_line?: boolean;
|
|
49
|
-
}
|
|
50
|
-
|
|
36
|
+
export function format_script(src: string, filename: string, config?: ScriptConfig): string;
|
|
51
37
|
|
|
52
38
|
export interface StyleConfig extends LayoutConfig {
|
|
53
39
|
/**
|
|
@@ -64,6 +50,8 @@ export interface Config extends LayoutConfig {
|
|
|
64
50
|
json?: JsonConfig;
|
|
65
51
|
}
|
|
66
52
|
|
|
53
|
+
export type JsonConfig = LayoutConfig;
|
|
54
|
+
|
|
67
55
|
|
|
68
56
|
export interface MarkupConfig extends LayoutConfig {
|
|
69
57
|
/**
|
|
@@ -73,6 +61,18 @@ export interface MarkupConfig extends LayoutConfig {
|
|
|
73
61
|
}
|
|
74
62
|
|
|
75
63
|
|
|
64
|
+
export interface ScriptConfig extends LayoutConfig {
|
|
65
|
+
quote_style?: "double" | "single";
|
|
66
|
+
jsx_quote_style?: "double" | "single";
|
|
67
|
+
quote_properties?: "preserve" | "as-needed";
|
|
68
|
+
trailing_comma?: "es5" | "all" | "none";
|
|
69
|
+
semicolons?: "always" | "as-needed";
|
|
70
|
+
arrow_parentheses?: "always" | "as-needed";
|
|
71
|
+
bracket_spacing?: boolean;
|
|
72
|
+
bracket_same_line?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
76
|
interface LayoutConfig {
|
|
77
77
|
indent_style?: "tab" | "space";
|
|
78
78
|
indent_width?: number;
|
|
@@ -85,16 +85,16 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
85
85
|
|
|
86
86
|
export interface InitOutput {
|
|
87
87
|
readonly memory: WebAssembly.Memory;
|
|
88
|
-
readonly format_json: (a: number, b: number, c: number, d: number) => void;
|
|
89
|
-
readonly format_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
90
88
|
readonly format_style: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
91
89
|
readonly format: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
90
|
+
readonly format_json: (a: number, b: number, c: number, d: number) => void;
|
|
92
91
|
readonly format_markup: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
93
|
-
readonly
|
|
94
|
-
readonly
|
|
92
|
+
readonly format_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
93
|
+
readonly __wbindgen_export_0: (a: number, b: number) => number;
|
|
94
|
+
readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
95
95
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
96
|
-
readonly
|
|
97
|
-
readonly
|
|
96
|
+
readonly __wbindgen_export_2: (a: number, b: number, c: number) => void;
|
|
97
|
+
readonly __wbindgen_export_3: (a: number) => void;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
package/web_fmt.js
CHANGED
|
@@ -1,13 +1,40 @@
|
|
|
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 cachedUint8Memory0 = null;
|
|
8
|
+
|
|
9
|
+
function getUint8Memory0() {
|
|
10
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
11
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
|
+
}
|
|
13
|
+
return cachedUint8Memory0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getStringFromWasm0(ptr, len) {
|
|
17
|
+
ptr = ptr >>> 0;
|
|
18
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
19
|
+
}
|
|
20
|
+
|
|
3
21
|
const heap = new Array(128).fill(undefined);
|
|
4
22
|
|
|
5
23
|
heap.push(undefined, null, true, false);
|
|
6
24
|
|
|
7
|
-
function getObject(idx) { return heap[idx]; }
|
|
8
|
-
|
|
9
25
|
let heap_next = heap.length;
|
|
10
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
|
+
function getObject(idx) { return heap[idx]; }
|
|
37
|
+
|
|
11
38
|
function dropObject(idx) {
|
|
12
39
|
if (idx < 132) return;
|
|
13
40
|
heap[idx] = heap_next;
|
|
@@ -42,26 +69,8 @@ function getInt32Memory0() {
|
|
|
42
69
|
return cachedInt32Memory0;
|
|
43
70
|
}
|
|
44
71
|
|
|
45
|
-
function addHeapObject(obj) {
|
|
46
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
47
|
-
const idx = heap_next;
|
|
48
|
-
heap_next = heap[idx];
|
|
49
|
-
|
|
50
|
-
heap[idx] = obj;
|
|
51
|
-
return idx;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
72
|
let WASM_VECTOR_LEN = 0;
|
|
55
73
|
|
|
56
|
-
let cachedUint8Memory0 = null;
|
|
57
|
-
|
|
58
|
-
function getUint8Memory0() {
|
|
59
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
60
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
61
|
-
}
|
|
62
|
-
return cachedUint8Memory0;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
74
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
66
75
|
|
|
67
76
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -116,15 +125,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
116
125
|
return ptr;
|
|
117
126
|
}
|
|
118
127
|
|
|
119
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
120
|
-
|
|
121
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
122
|
-
|
|
123
|
-
function getStringFromWasm0(ptr, len) {
|
|
124
|
-
ptr = ptr >>> 0;
|
|
125
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
126
|
-
}
|
|
127
|
-
|
|
128
128
|
let cachedBigInt64Memory0 = null;
|
|
129
129
|
|
|
130
130
|
function getBigInt64Memory0() {
|
|
@@ -200,52 +200,55 @@ function debugString(val) {
|
|
|
200
200
|
}
|
|
201
201
|
/**
|
|
202
202
|
* @param {string} src
|
|
203
|
-
* @param {
|
|
203
|
+
* @param {string} filename
|
|
204
|
+
* @param {StyleConfig | undefined} [config]
|
|
204
205
|
* @returns {string}
|
|
205
206
|
*/
|
|
206
|
-
export function
|
|
207
|
-
let
|
|
208
|
-
let
|
|
207
|
+
export function format_style(src, filename, config) {
|
|
208
|
+
let deferred4_0;
|
|
209
|
+
let deferred4_1;
|
|
209
210
|
try {
|
|
210
211
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
211
|
-
const ptr0 = passStringToWasm0(src, wasm.
|
|
212
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
212
213
|
const len0 = WASM_VECTOR_LEN;
|
|
213
|
-
|
|
214
|
+
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
215
|
+
const len1 = WASM_VECTOR_LEN;
|
|
216
|
+
wasm.format_style(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
214
217
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
215
218
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
216
219
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
217
220
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
218
|
-
var
|
|
219
|
-
var
|
|
221
|
+
var ptr3 = r0;
|
|
222
|
+
var len3 = r1;
|
|
220
223
|
if (r3) {
|
|
221
|
-
|
|
224
|
+
ptr3 = 0; len3 = 0;
|
|
222
225
|
throw takeObject(r2);
|
|
223
226
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return getStringFromWasm0(
|
|
227
|
+
deferred4_0 = ptr3;
|
|
228
|
+
deferred4_1 = len3;
|
|
229
|
+
return getStringFromWasm0(ptr3, len3);
|
|
227
230
|
} finally {
|
|
228
231
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
229
|
-
wasm.
|
|
232
|
+
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
230
233
|
}
|
|
231
234
|
}
|
|
232
235
|
|
|
233
236
|
/**
|
|
234
237
|
* @param {string} src
|
|
235
238
|
* @param {string} filename
|
|
236
|
-
* @param {
|
|
239
|
+
* @param {Config | undefined} [config]
|
|
237
240
|
* @returns {string}
|
|
238
241
|
*/
|
|
239
|
-
export function
|
|
242
|
+
export function format(src, filename, config) {
|
|
240
243
|
let deferred4_0;
|
|
241
244
|
let deferred4_1;
|
|
242
245
|
try {
|
|
243
246
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
244
|
-
const ptr0 = passStringToWasm0(src, wasm.
|
|
247
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
245
248
|
const len0 = WASM_VECTOR_LEN;
|
|
246
|
-
const ptr1 = passStringToWasm0(filename, wasm.
|
|
249
|
+
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
247
250
|
const len1 = WASM_VECTOR_LEN;
|
|
248
|
-
wasm.
|
|
251
|
+
wasm.format(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
249
252
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
250
253
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
251
254
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -261,61 +264,58 @@ export function format_script(src, filename, config) {
|
|
|
261
264
|
return getStringFromWasm0(ptr3, len3);
|
|
262
265
|
} finally {
|
|
263
266
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
264
|
-
wasm.
|
|
267
|
+
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
265
268
|
}
|
|
266
269
|
}
|
|
267
270
|
|
|
268
271
|
/**
|
|
269
272
|
* @param {string} src
|
|
270
|
-
* @param {
|
|
271
|
-
* @param {StyleConfig | undefined} [config]
|
|
273
|
+
* @param {JsonConfig | undefined} [config]
|
|
272
274
|
* @returns {string}
|
|
273
275
|
*/
|
|
274
|
-
export function
|
|
275
|
-
let
|
|
276
|
-
let
|
|
276
|
+
export function format_json(src, config) {
|
|
277
|
+
let deferred3_0;
|
|
278
|
+
let deferred3_1;
|
|
277
279
|
try {
|
|
278
280
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
279
|
-
const ptr0 = passStringToWasm0(src, wasm.
|
|
281
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
280
282
|
const len0 = WASM_VECTOR_LEN;
|
|
281
|
-
|
|
282
|
-
const len1 = WASM_VECTOR_LEN;
|
|
283
|
-
wasm.format_style(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
283
|
+
wasm.format_json(retptr, ptr0, len0, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
284
284
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
285
285
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
286
286
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
287
287
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
288
|
-
var
|
|
289
|
-
var
|
|
288
|
+
var ptr2 = r0;
|
|
289
|
+
var len2 = r1;
|
|
290
290
|
if (r3) {
|
|
291
|
-
|
|
291
|
+
ptr2 = 0; len2 = 0;
|
|
292
292
|
throw takeObject(r2);
|
|
293
293
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
return getStringFromWasm0(
|
|
294
|
+
deferred3_0 = ptr2;
|
|
295
|
+
deferred3_1 = len2;
|
|
296
|
+
return getStringFromWasm0(ptr2, len2);
|
|
297
297
|
} finally {
|
|
298
298
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
299
|
-
wasm.
|
|
299
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
304
|
* @param {string} src
|
|
305
305
|
* @param {string} filename
|
|
306
|
-
* @param {
|
|
306
|
+
* @param {MarkupConfig | undefined} [config]
|
|
307
307
|
* @returns {string}
|
|
308
308
|
*/
|
|
309
|
-
export function
|
|
309
|
+
export function format_markup(src, filename, config) {
|
|
310
310
|
let deferred4_0;
|
|
311
311
|
let deferred4_1;
|
|
312
312
|
try {
|
|
313
313
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
314
|
-
const ptr0 = passStringToWasm0(src, wasm.
|
|
314
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
315
315
|
const len0 = WASM_VECTOR_LEN;
|
|
316
|
-
const ptr1 = passStringToWasm0(filename, wasm.
|
|
316
|
+
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
317
317
|
const len1 = WASM_VECTOR_LEN;
|
|
318
|
-
wasm.
|
|
318
|
+
wasm.format_markup(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
319
319
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
320
320
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
321
321
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -331,26 +331,26 @@ export function format(src, filename, config) {
|
|
|
331
331
|
return getStringFromWasm0(ptr3, len3);
|
|
332
332
|
} finally {
|
|
333
333
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
334
|
-
wasm.
|
|
334
|
+
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
/**
|
|
339
339
|
* @param {string} src
|
|
340
340
|
* @param {string} filename
|
|
341
|
-
* @param {
|
|
341
|
+
* @param {ScriptConfig | undefined} [config]
|
|
342
342
|
* @returns {string}
|
|
343
343
|
*/
|
|
344
|
-
export function
|
|
344
|
+
export function format_script(src, filename, config) {
|
|
345
345
|
let deferred4_0;
|
|
346
346
|
let deferred4_1;
|
|
347
347
|
try {
|
|
348
348
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
349
|
-
const ptr0 = passStringToWasm0(src, wasm.
|
|
349
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
350
350
|
const len0 = WASM_VECTOR_LEN;
|
|
351
|
-
const ptr1 = passStringToWasm0(filename, wasm.
|
|
351
|
+
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
352
352
|
const len1 = WASM_VECTOR_LEN;
|
|
353
|
-
wasm.
|
|
353
|
+
wasm.format_script(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
354
354
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
355
355
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
356
356
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -366,7 +366,7 @@ export function format_markup(src, filename, config) {
|
|
|
366
366
|
return getStringFromWasm0(ptr3, len3);
|
|
367
367
|
} finally {
|
|
368
368
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
369
|
-
wasm.
|
|
369
|
+
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
|
|
@@ -374,7 +374,7 @@ function handleError(f, args) {
|
|
|
374
374
|
try {
|
|
375
375
|
return f.apply(this, args);
|
|
376
376
|
} catch (e) {
|
|
377
|
-
wasm.
|
|
377
|
+
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
|
|
@@ -412,9 +412,21 @@ async function __wbg_load(module, imports) {
|
|
|
412
412
|
function __wbg_get_imports() {
|
|
413
413
|
const imports = {};
|
|
414
414
|
imports.wbg = {};
|
|
415
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
416
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
417
|
+
return addHeapObject(ret);
|
|
418
|
+
};
|
|
419
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
420
|
+
const ret = getObject(arg0);
|
|
421
|
+
return addHeapObject(ret);
|
|
422
|
+
};
|
|
415
423
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
416
424
|
takeObject(arg0);
|
|
417
425
|
};
|
|
426
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
427
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
428
|
+
return addHeapObject(ret);
|
|
429
|
+
};
|
|
418
430
|
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
419
431
|
const ret = getObject(arg0) === undefined;
|
|
420
432
|
return ret;
|
|
@@ -449,7 +461,7 @@ function __wbg_get_imports() {
|
|
|
449
461
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
450
462
|
const obj = getObject(arg1);
|
|
451
463
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
452
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.
|
|
464
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
453
465
|
var len1 = WASM_VECTOR_LEN;
|
|
454
466
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
455
467
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
@@ -467,38 +479,30 @@ function __wbg_get_imports() {
|
|
|
467
479
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
468
480
|
return ret;
|
|
469
481
|
};
|
|
470
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
471
|
-
const ret = getObject(arg0);
|
|
472
|
-
return addHeapObject(ret);
|
|
473
|
-
};
|
|
474
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
475
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
476
|
-
return addHeapObject(ret);
|
|
477
|
-
};
|
|
478
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
479
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
480
|
-
return addHeapObject(ret);
|
|
481
|
-
};
|
|
482
482
|
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
483
483
|
const ret = getObject(arg0) == getObject(arg1);
|
|
484
484
|
return ret;
|
|
485
485
|
};
|
|
486
|
-
imports.wbg.
|
|
486
|
+
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
487
|
+
const ret = +getObject(arg0);
|
|
488
|
+
return ret;
|
|
489
|
+
};
|
|
490
|
+
imports.wbg.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
|
|
487
491
|
const ret = String(getObject(arg1));
|
|
488
|
-
const ptr1 = passStringToWasm0(ret, wasm.
|
|
492
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
489
493
|
const len1 = WASM_VECTOR_LEN;
|
|
490
494
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
491
495
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
492
496
|
};
|
|
493
|
-
imports.wbg.
|
|
497
|
+
imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
|
|
494
498
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
495
499
|
return addHeapObject(ret);
|
|
496
500
|
};
|
|
497
|
-
imports.wbg.
|
|
501
|
+
imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
|
|
498
502
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
499
503
|
return addHeapObject(ret);
|
|
500
504
|
};
|
|
501
|
-
imports.wbg.
|
|
505
|
+
imports.wbg.__wbg_length_cd7af8117672b8b8 = function(arg0) {
|
|
502
506
|
const ret = getObject(arg0).length;
|
|
503
507
|
return ret;
|
|
504
508
|
};
|
|
@@ -506,39 +510,39 @@ function __wbg_get_imports() {
|
|
|
506
510
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
507
511
|
return ret;
|
|
508
512
|
};
|
|
509
|
-
imports.wbg.
|
|
513
|
+
imports.wbg.__wbg_next_40fc327bfc8770e6 = function(arg0) {
|
|
510
514
|
const ret = getObject(arg0).next;
|
|
511
515
|
return addHeapObject(ret);
|
|
512
516
|
};
|
|
513
|
-
imports.wbg.
|
|
517
|
+
imports.wbg.__wbg_next_196c84450b364254 = function() { return handleError(function (arg0) {
|
|
514
518
|
const ret = getObject(arg0).next();
|
|
515
519
|
return addHeapObject(ret);
|
|
516
520
|
}, arguments) };
|
|
517
|
-
imports.wbg.
|
|
521
|
+
imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) {
|
|
518
522
|
const ret = getObject(arg0).done;
|
|
519
523
|
return ret;
|
|
520
524
|
};
|
|
521
|
-
imports.wbg.
|
|
525
|
+
imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) {
|
|
522
526
|
const ret = getObject(arg0).value;
|
|
523
527
|
return addHeapObject(ret);
|
|
524
528
|
};
|
|
525
|
-
imports.wbg.
|
|
529
|
+
imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function() {
|
|
526
530
|
const ret = Symbol.iterator;
|
|
527
531
|
return addHeapObject(ret);
|
|
528
532
|
};
|
|
529
|
-
imports.wbg.
|
|
533
|
+
imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
|
|
530
534
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
531
535
|
return addHeapObject(ret);
|
|
532
536
|
}, arguments) };
|
|
533
|
-
imports.wbg.
|
|
537
|
+
imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
|
534
538
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
535
539
|
return addHeapObject(ret);
|
|
536
540
|
}, arguments) };
|
|
537
|
-
imports.wbg.
|
|
541
|
+
imports.wbg.__wbg_isArray_2ab64d95e09ea0ae = function(arg0) {
|
|
538
542
|
const ret = Array.isArray(getObject(arg0));
|
|
539
543
|
return ret;
|
|
540
544
|
};
|
|
541
|
-
imports.wbg.
|
|
545
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function(arg0) {
|
|
542
546
|
let result;
|
|
543
547
|
try {
|
|
544
548
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -548,30 +552,40 @@ function __wbg_get_imports() {
|
|
|
548
552
|
const ret = result;
|
|
549
553
|
return ret;
|
|
550
554
|
};
|
|
551
|
-
imports.wbg.
|
|
555
|
+
imports.wbg.__wbg_instanceof_Map_87917e0a7aaf4012 = function(arg0) {
|
|
556
|
+
let result;
|
|
557
|
+
try {
|
|
558
|
+
result = getObject(arg0) instanceof Map;
|
|
559
|
+
} catch (_) {
|
|
560
|
+
result = false;
|
|
561
|
+
}
|
|
562
|
+
const ret = result;
|
|
563
|
+
return ret;
|
|
564
|
+
};
|
|
565
|
+
imports.wbg.__wbg_isSafeInteger_f7b04ef02296c4d2 = function(arg0) {
|
|
552
566
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
553
567
|
return ret;
|
|
554
568
|
};
|
|
555
|
-
imports.wbg.
|
|
569
|
+
imports.wbg.__wbg_entries_95cc2c823b285a09 = function(arg0) {
|
|
556
570
|
const ret = Object.entries(getObject(arg0));
|
|
557
571
|
return addHeapObject(ret);
|
|
558
572
|
};
|
|
559
|
-
imports.wbg.
|
|
573
|
+
imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
|
560
574
|
const ret = getObject(arg0).buffer;
|
|
561
575
|
return addHeapObject(ret);
|
|
562
576
|
};
|
|
563
|
-
imports.wbg.
|
|
577
|
+
imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
564
578
|
const ret = new Uint8Array(getObject(arg0));
|
|
565
579
|
return addHeapObject(ret);
|
|
566
580
|
};
|
|
567
|
-
imports.wbg.
|
|
581
|
+
imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
568
582
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
569
583
|
};
|
|
570
|
-
imports.wbg.
|
|
584
|
+
imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
|
|
571
585
|
const ret = getObject(arg0).length;
|
|
572
586
|
return ret;
|
|
573
587
|
};
|
|
574
|
-
imports.wbg.
|
|
588
|
+
imports.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function(arg0) {
|
|
575
589
|
let result;
|
|
576
590
|
try {
|
|
577
591
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -589,7 +603,7 @@ function __wbg_get_imports() {
|
|
|
589
603
|
};
|
|
590
604
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
591
605
|
const ret = debugString(getObject(arg1));
|
|
592
|
-
const ptr1 = passStringToWasm0(ret, wasm.
|
|
606
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
593
607
|
const len1 = WASM_VECTOR_LEN;
|
|
594
608
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
595
609
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
package/web_fmt_bg.wasm
CHANGED
|
Binary file
|
package/web_fmt_bg.wasm.d.ts
CHANGED
|
@@ -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_script(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
6
4
|
export function format_style(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
7
5
|
export function format(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
6
|
+
export function format_json(a: number, b: number, c: number, d: number): void;
|
|
8
7
|
export function format_markup(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
9
|
-
export function
|
|
10
|
-
export function
|
|
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
11
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
12
|
-
export function
|
|
13
|
-
export function
|
|
12
|
+
export function __wbindgen_export_2(a: number, b: number, c: number): void;
|
|
13
|
+
export function __wbindgen_export_3(a: number): void;
|
package/jsr.jsonc
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@fmt/web-fmt",
|
|
3
|
-
"collaborators": [
|
|
4
|
-
"magic-akari <akari.ccino@gmail.com>"
|
|
5
|
-
],
|
|
6
|
-
"description": "a formatter for web development powered by WASM",
|
|
7
|
-
"version": "0.1.8",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "https://github.com/wasm-fmt/web_fmt"
|
|
12
|
-
},
|
|
13
|
-
"module": "web_fmt.js",
|
|
14
|
-
"homepage": "https://github.com/wasm-fmt/web_fmt",
|
|
15
|
-
"types": "web_fmt.d.ts",
|
|
16
|
-
"sideEffects": [
|
|
17
|
-
"./snippets/*"
|
|
18
|
-
],
|
|
19
|
-
"keywords": [
|
|
20
|
-
"wasm",
|
|
21
|
-
"formatter",
|
|
22
|
-
"html",
|
|
23
|
-
"css",
|
|
24
|
-
"javascript"
|
|
25
|
-
],
|
|
26
|
-
"main": "web_fmt.js",
|
|
27
|
-
"type": "module",
|
|
28
|
-
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
30
|
-
},
|
|
31
|
-
"exports": "./web_fmt.js",
|
|
32
|
-
"exclude": [
|
|
33
|
-
"!**",
|
|
34
|
-
"*.tgz"
|
|
35
|
-
]
|
|
36
|
-
}
|