@wasm-fmt/web_fmt 0.1.10 → 0.1.11
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 +34 -0
- package/package.json +2 -4
- package/wasm-fmt-web_fmt-0.1.11.tgz +0 -0
- package/web_fmt.d.ts +33 -33
- package/web_fmt.js +149 -150
- package/web_fmt_bg.wasm +0 -0
- package/web_fmt_bg.wasm.d.ts +1 -1
package/jsr.jsonc
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fmt/web-fmt",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"collaborators": [
|
|
5
|
+
"magic-akari <akari.ccino@gmail.com>"
|
|
6
|
+
],
|
|
7
|
+
"description": "a formatter for web development powered by WASM",
|
|
8
|
+
"version": "0.1.11",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/wasm-fmt/web_fmt"
|
|
13
|
+
},
|
|
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
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"exports": "./web_fmt.js",
|
|
30
|
+
"exclude": [
|
|
31
|
+
"!**",
|
|
32
|
+
"*.tgz"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wasm-fmt/web_fmt",
|
|
3
|
+
"type": "module",
|
|
3
4
|
"collaborators": [
|
|
4
5
|
"magic-akari <akari.ccino@gmail.com>"
|
|
5
6
|
],
|
|
6
7
|
"description": "a formatter for web development powered by WASM",
|
|
7
|
-
"version": "0.1.
|
|
8
|
+
"version": "0.1.11",
|
|
8
9
|
"license": "MIT",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
12
|
"url": "https://github.com/wasm-fmt/web_fmt"
|
|
12
13
|
},
|
|
13
|
-
"module": "web_fmt.js",
|
|
14
14
|
"homepage": "https://github.com/wasm-fmt/web_fmt",
|
|
15
15
|
"types": "web_fmt.d.ts",
|
|
16
16
|
"sideEffects": [
|
|
@@ -23,8 +23,6 @@
|
|
|
23
23
|
"css",
|
|
24
24
|
"javascript"
|
|
25
25
|
],
|
|
26
|
-
"main": "web_fmt.js",
|
|
27
|
-
"type": "module",
|
|
28
26
|
"publishConfig": {
|
|
29
27
|
"access": "public"
|
|
30
28
|
},
|
|
Binary file
|
package/web_fmt.d.ts
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {string} src
|
|
5
|
-
* @param {
|
|
6
|
-
* @
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
*/
|
|
9
15
|
export function format_style(src: string, filename: string, config?: StyleConfig): string;
|
|
10
16
|
/**
|
|
11
|
-
* @param {string} src
|
|
12
|
-
* @param {string} filename
|
|
13
|
-
* @param {Config | undefined} [config]
|
|
14
|
-
* @returns {string}
|
|
15
|
-
*/
|
|
17
|
+
* @param {string} src
|
|
18
|
+
* @param {string} filename
|
|
19
|
+
* @param {Config | undefined} [config]
|
|
20
|
+
* @returns {string}
|
|
21
|
+
*/
|
|
16
22
|
export function format(src: string, filename: string, config?: Config): string;
|
|
17
23
|
/**
|
|
18
|
-
* @param {string} src
|
|
19
|
-
* @param {
|
|
20
|
-
* @
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param {string} src
|
|
25
|
-
* @param {string} filename
|
|
26
|
-
* @param {MarkupConfig | undefined} [config]
|
|
27
|
-
* @returns {string}
|
|
28
|
-
*/
|
|
24
|
+
* @param {string} src
|
|
25
|
+
* @param {string} filename
|
|
26
|
+
* @param {MarkupConfig | undefined} [config]
|
|
27
|
+
* @returns {string}
|
|
28
|
+
*/
|
|
29
29
|
export function format_markup(src: string, filename: string, config?: MarkupConfig): string;
|
|
30
30
|
/**
|
|
31
|
-
* @param {string} src
|
|
32
|
-
* @param {string} filename
|
|
33
|
-
* @param {ScriptConfig | undefined} [config]
|
|
34
|
-
* @returns {string}
|
|
35
|
-
*/
|
|
31
|
+
* @param {string} src
|
|
32
|
+
* @param {string} filename
|
|
33
|
+
* @param {ScriptConfig | undefined} [config]
|
|
34
|
+
* @returns {string}
|
|
35
|
+
*/
|
|
36
36
|
export function format_script(src: string, filename: string, config?: ScriptConfig): string;
|
|
37
|
+
export type JsonConfig = LayoutConfig;
|
|
38
|
+
|
|
37
39
|
|
|
38
40
|
export interface StyleConfig extends LayoutConfig {
|
|
39
41
|
/**
|
|
@@ -50,8 +52,6 @@ export interface Config extends LayoutConfig {
|
|
|
50
52
|
json?: JsonConfig;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
export type JsonConfig = LayoutConfig;
|
|
54
|
-
|
|
55
55
|
|
|
56
56
|
export interface MarkupConfig extends LayoutConfig {
|
|
57
57
|
/**
|
|
@@ -85,9 +85,9 @@ 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;
|
|
88
89
|
readonly format_style: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
89
90
|
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;
|
|
91
91
|
readonly format_markup: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
92
92
|
readonly format_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
93
93
|
readonly __wbindgen_export_0: (a: number, b: number) => number;
|
|
@@ -102,18 +102,18 @@ export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
|
102
102
|
* Instantiates the given `module`, which can either be bytes or
|
|
103
103
|
* a precompiled `WebAssembly.Module`.
|
|
104
104
|
*
|
|
105
|
-
* @param {SyncInitInput} module
|
|
105
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
106
106
|
*
|
|
107
107
|
* @returns {InitOutput}
|
|
108
108
|
*/
|
|
109
|
-
export function initSync(module: SyncInitInput): InitOutput;
|
|
109
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
113
113
|
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
114
114
|
*
|
|
115
|
-
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
115
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
116
116
|
*
|
|
117
117
|
* @returns {Promise<InitOutput>}
|
|
118
118
|
*/
|
|
119
|
-
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
119
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/web_fmt.js
CHANGED
|
@@ -4,18 +4,18 @@ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder(
|
|
|
4
4
|
|
|
5
5
|
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
6
6
|
|
|
7
|
-
let
|
|
7
|
+
let cachedUint8ArrayMemory0 = null;
|
|
8
8
|
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
11
|
-
|
|
9
|
+
function getUint8ArrayMemory0() {
|
|
10
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
11
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
12
|
}
|
|
13
|
-
return
|
|
13
|
+
return cachedUint8ArrayMemory0;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
function getStringFromWasm0(ptr, len) {
|
|
17
17
|
ptr = ptr >>> 0;
|
|
18
|
-
return cachedTextDecoder.decode(
|
|
18
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const heap = new Array(128).fill(undefined);
|
|
@@ -51,22 +51,13 @@ function isLikeNone(x) {
|
|
|
51
51
|
return x === undefined || x === null;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
let
|
|
54
|
+
let cachedDataViewMemory0 = null;
|
|
55
55
|
|
|
56
|
-
function
|
|
57
|
-
if (
|
|
58
|
-
|
|
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);
|
|
59
59
|
}
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let cachedInt32Memory0 = null;
|
|
64
|
-
|
|
65
|
-
function getInt32Memory0() {
|
|
66
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
67
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
68
|
-
}
|
|
69
|
-
return cachedInt32Memory0;
|
|
60
|
+
return cachedDataViewMemory0;
|
|
70
61
|
}
|
|
71
62
|
|
|
72
63
|
let WASM_VECTOR_LEN = 0;
|
|
@@ -91,7 +82,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
91
82
|
if (realloc === undefined) {
|
|
92
83
|
const buf = cachedTextEncoder.encode(arg);
|
|
93
84
|
const ptr = malloc(buf.length, 1) >>> 0;
|
|
94
|
-
|
|
85
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
95
86
|
WASM_VECTOR_LEN = buf.length;
|
|
96
87
|
return ptr;
|
|
97
88
|
}
|
|
@@ -99,7 +90,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
99
90
|
let len = arg.length;
|
|
100
91
|
let ptr = malloc(len, 1) >>> 0;
|
|
101
92
|
|
|
102
|
-
const mem =
|
|
93
|
+
const mem = getUint8ArrayMemory0();
|
|
103
94
|
|
|
104
95
|
let offset = 0;
|
|
105
96
|
|
|
@@ -114,7 +105,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
114
105
|
arg = arg.slice(offset);
|
|
115
106
|
}
|
|
116
107
|
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
117
|
-
const view =
|
|
108
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
118
109
|
const ret = encodeString(arg, view);
|
|
119
110
|
|
|
120
111
|
offset += ret.written;
|
|
@@ -125,15 +116,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
125
116
|
return ptr;
|
|
126
117
|
}
|
|
127
118
|
|
|
128
|
-
let cachedBigInt64Memory0 = null;
|
|
129
|
-
|
|
130
|
-
function getBigInt64Memory0() {
|
|
131
|
-
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
|
|
132
|
-
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
|
|
133
|
-
}
|
|
134
|
-
return cachedBigInt64Memory0;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
119
|
function debugString(val) {
|
|
138
120
|
// primitive types
|
|
139
121
|
const type = typeof val;
|
|
@@ -199,11 +181,43 @@ function debugString(val) {
|
|
|
199
181
|
return className;
|
|
200
182
|
}
|
|
201
183
|
/**
|
|
202
|
-
* @param {string} src
|
|
203
|
-
* @param {
|
|
204
|
-
* @
|
|
205
|
-
|
|
206
|
-
|
|
184
|
+
* @param {string} src
|
|
185
|
+
* @param {JsonConfig | undefined} [config]
|
|
186
|
+
* @returns {string}
|
|
187
|
+
*/
|
|
188
|
+
export function format_json(src, config) {
|
|
189
|
+
let deferred3_0;
|
|
190
|
+
let deferred3_1;
|
|
191
|
+
try {
|
|
192
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
193
|
+
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
194
|
+
const len0 = WASM_VECTOR_LEN;
|
|
195
|
+
wasm.format_json(retptr, ptr0, len0, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
196
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
197
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
198
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
199
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
200
|
+
var ptr2 = r0;
|
|
201
|
+
var len2 = r1;
|
|
202
|
+
if (r3) {
|
|
203
|
+
ptr2 = 0; len2 = 0;
|
|
204
|
+
throw takeObject(r2);
|
|
205
|
+
}
|
|
206
|
+
deferred3_0 = ptr2;
|
|
207
|
+
deferred3_1 = len2;
|
|
208
|
+
return getStringFromWasm0(ptr2, len2);
|
|
209
|
+
} finally {
|
|
210
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
211
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* @param {string} src
|
|
217
|
+
* @param {string} filename
|
|
218
|
+
* @param {StyleConfig | undefined} [config]
|
|
219
|
+
* @returns {string}
|
|
220
|
+
*/
|
|
207
221
|
export function format_style(src, filename, config) {
|
|
208
222
|
let deferred4_0;
|
|
209
223
|
let deferred4_1;
|
|
@@ -214,10 +228,10 @@ export function format_style(src, filename, config) {
|
|
|
214
228
|
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
215
229
|
const len1 = WASM_VECTOR_LEN;
|
|
216
230
|
wasm.format_style(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
217
|
-
var r0 =
|
|
218
|
-
var r1 =
|
|
219
|
-
var r2 =
|
|
220
|
-
var r3 =
|
|
231
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
232
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
233
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
234
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
221
235
|
var ptr3 = r0;
|
|
222
236
|
var len3 = r1;
|
|
223
237
|
if (r3) {
|
|
@@ -234,11 +248,11 @@ export function format_style(src, filename, config) {
|
|
|
234
248
|
}
|
|
235
249
|
|
|
236
250
|
/**
|
|
237
|
-
* @param {string} src
|
|
238
|
-
* @param {string} filename
|
|
239
|
-
* @param {Config | undefined} [config]
|
|
240
|
-
* @returns {string}
|
|
241
|
-
*/
|
|
251
|
+
* @param {string} src
|
|
252
|
+
* @param {string} filename
|
|
253
|
+
* @param {Config | undefined} [config]
|
|
254
|
+
* @returns {string}
|
|
255
|
+
*/
|
|
242
256
|
export function format(src, filename, config) {
|
|
243
257
|
let deferred4_0;
|
|
244
258
|
let deferred4_1;
|
|
@@ -249,10 +263,10 @@ export function format(src, filename, config) {
|
|
|
249
263
|
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
250
264
|
const len1 = WASM_VECTOR_LEN;
|
|
251
265
|
wasm.format(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
252
|
-
var r0 =
|
|
253
|
-
var r1 =
|
|
254
|
-
var r2 =
|
|
255
|
-
var r3 =
|
|
266
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
267
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
268
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
269
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
256
270
|
var ptr3 = r0;
|
|
257
271
|
var len3 = r1;
|
|
258
272
|
if (r3) {
|
|
@@ -269,43 +283,11 @@ export function format(src, filename, config) {
|
|
|
269
283
|
}
|
|
270
284
|
|
|
271
285
|
/**
|
|
272
|
-
* @param {string} src
|
|
273
|
-
* @param {
|
|
274
|
-
* @
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
let deferred3_0;
|
|
278
|
-
let deferred3_1;
|
|
279
|
-
try {
|
|
280
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
281
|
-
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
282
|
-
const len0 = WASM_VECTOR_LEN;
|
|
283
|
-
wasm.format_json(retptr, ptr0, len0, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
284
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
285
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
286
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
287
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
288
|
-
var ptr2 = r0;
|
|
289
|
-
var len2 = r1;
|
|
290
|
-
if (r3) {
|
|
291
|
-
ptr2 = 0; len2 = 0;
|
|
292
|
-
throw takeObject(r2);
|
|
293
|
-
}
|
|
294
|
-
deferred3_0 = ptr2;
|
|
295
|
-
deferred3_1 = len2;
|
|
296
|
-
return getStringFromWasm0(ptr2, len2);
|
|
297
|
-
} finally {
|
|
298
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
299
|
-
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* @param {string} src
|
|
305
|
-
* @param {string} filename
|
|
306
|
-
* @param {MarkupConfig | undefined} [config]
|
|
307
|
-
* @returns {string}
|
|
308
|
-
*/
|
|
286
|
+
* @param {string} src
|
|
287
|
+
* @param {string} filename
|
|
288
|
+
* @param {MarkupConfig | undefined} [config]
|
|
289
|
+
* @returns {string}
|
|
290
|
+
*/
|
|
309
291
|
export function format_markup(src, filename, config) {
|
|
310
292
|
let deferred4_0;
|
|
311
293
|
let deferred4_1;
|
|
@@ -316,10 +298,10 @@ export function format_markup(src, filename, config) {
|
|
|
316
298
|
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
317
299
|
const len1 = WASM_VECTOR_LEN;
|
|
318
300
|
wasm.format_markup(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
319
|
-
var r0 =
|
|
320
|
-
var r1 =
|
|
321
|
-
var r2 =
|
|
322
|
-
var r3 =
|
|
301
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
302
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
303
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
304
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
323
305
|
var ptr3 = r0;
|
|
324
306
|
var len3 = r1;
|
|
325
307
|
if (r3) {
|
|
@@ -336,11 +318,11 @@ export function format_markup(src, filename, config) {
|
|
|
336
318
|
}
|
|
337
319
|
|
|
338
320
|
/**
|
|
339
|
-
* @param {string} src
|
|
340
|
-
* @param {string} filename
|
|
341
|
-
* @param {ScriptConfig | undefined} [config]
|
|
342
|
-
* @returns {string}
|
|
343
|
-
*/
|
|
321
|
+
* @param {string} src
|
|
322
|
+
* @param {string} filename
|
|
323
|
+
* @param {ScriptConfig | undefined} [config]
|
|
324
|
+
* @returns {string}
|
|
325
|
+
*/
|
|
344
326
|
export function format_script(src, filename, config) {
|
|
345
327
|
let deferred4_0;
|
|
346
328
|
let deferred4_1;
|
|
@@ -351,10 +333,10 @@ export function format_script(src, filename, config) {
|
|
|
351
333
|
const ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
352
334
|
const len1 = WASM_VECTOR_LEN;
|
|
353
335
|
wasm.format_script(retptr, ptr0, len0, ptr1, len1, isLikeNone(config) ? 0 : addHeapObject(config));
|
|
354
|
-
var r0 =
|
|
355
|
-
var r1 =
|
|
356
|
-
var r2 =
|
|
357
|
-
var r3 =
|
|
336
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
337
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
338
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
339
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
358
340
|
var ptr3 = r0;
|
|
359
341
|
var len3 = r1;
|
|
360
342
|
if (r3) {
|
|
@@ -386,7 +368,7 @@ async function __wbg_load(module, imports) {
|
|
|
386
368
|
|
|
387
369
|
} catch (e) {
|
|
388
370
|
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
389
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve
|
|
371
|
+
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);
|
|
390
372
|
|
|
391
373
|
} else {
|
|
392
374
|
throw e;
|
|
@@ -416,17 +398,9 @@ function __wbg_get_imports() {
|
|
|
416
398
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
417
399
|
return addHeapObject(ret);
|
|
418
400
|
};
|
|
419
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
420
|
-
const ret = getObject(arg0);
|
|
421
|
-
return addHeapObject(ret);
|
|
422
|
-
};
|
|
423
401
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
424
402
|
takeObject(arg0);
|
|
425
403
|
};
|
|
426
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
427
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
428
|
-
return addHeapObject(ret);
|
|
429
|
-
};
|
|
430
404
|
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
431
405
|
const ret = getObject(arg0) === undefined;
|
|
432
406
|
return ret;
|
|
@@ -447,8 +421,8 @@ function __wbg_get_imports() {
|
|
|
447
421
|
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
448
422
|
const obj = getObject(arg1);
|
|
449
423
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
450
|
-
|
|
451
|
-
|
|
424
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
425
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
452
426
|
};
|
|
453
427
|
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
454
428
|
const ret = arg0;
|
|
@@ -463,8 +437,8 @@ function __wbg_get_imports() {
|
|
|
463
437
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
464
438
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
465
439
|
var len1 = WASM_VECTOR_LEN;
|
|
466
|
-
|
|
467
|
-
|
|
440
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
441
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
468
442
|
};
|
|
469
443
|
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
470
444
|
const val = getObject(arg0);
|
|
@@ -479,6 +453,14 @@ function __wbg_get_imports() {
|
|
|
479
453
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
480
454
|
return ret;
|
|
481
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
|
+
};
|
|
482
464
|
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
483
465
|
const ret = getObject(arg0) == getObject(arg1);
|
|
484
466
|
return ret;
|
|
@@ -491,18 +473,18 @@ function __wbg_get_imports() {
|
|
|
491
473
|
const ret = String(getObject(arg1));
|
|
492
474
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
493
475
|
const len1 = WASM_VECTOR_LEN;
|
|
494
|
-
|
|
495
|
-
|
|
476
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
477
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
496
478
|
};
|
|
497
479
|
imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
|
|
498
480
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
499
481
|
return addHeapObject(ret);
|
|
500
482
|
};
|
|
501
|
-
imports.wbg.
|
|
483
|
+
imports.wbg.__wbg_get_5419cf6b954aa11d = function(arg0, arg1) {
|
|
502
484
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
503
485
|
return addHeapObject(ret);
|
|
504
486
|
};
|
|
505
|
-
imports.wbg.
|
|
487
|
+
imports.wbg.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
|
|
506
488
|
const ret = getObject(arg0).length;
|
|
507
489
|
return ret;
|
|
508
490
|
};
|
|
@@ -510,39 +492,39 @@ function __wbg_get_imports() {
|
|
|
510
492
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
511
493
|
return ret;
|
|
512
494
|
};
|
|
513
|
-
imports.wbg.
|
|
495
|
+
imports.wbg.__wbg_next_13b477da1eaa3897 = function(arg0) {
|
|
514
496
|
const ret = getObject(arg0).next;
|
|
515
497
|
return addHeapObject(ret);
|
|
516
498
|
};
|
|
517
|
-
imports.wbg.
|
|
499
|
+
imports.wbg.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
|
|
518
500
|
const ret = getObject(arg0).next();
|
|
519
501
|
return addHeapObject(ret);
|
|
520
502
|
}, arguments) };
|
|
521
|
-
imports.wbg.
|
|
503
|
+
imports.wbg.__wbg_done_983b5ffcaec8c583 = function(arg0) {
|
|
522
504
|
const ret = getObject(arg0).done;
|
|
523
505
|
return ret;
|
|
524
506
|
};
|
|
525
|
-
imports.wbg.
|
|
507
|
+
imports.wbg.__wbg_value_2ab8a198c834c26a = function(arg0) {
|
|
526
508
|
const ret = getObject(arg0).value;
|
|
527
509
|
return addHeapObject(ret);
|
|
528
510
|
};
|
|
529
|
-
imports.wbg.
|
|
511
|
+
imports.wbg.__wbg_iterator_695d699a44d6234c = function() {
|
|
530
512
|
const ret = Symbol.iterator;
|
|
531
513
|
return addHeapObject(ret);
|
|
532
514
|
};
|
|
533
|
-
imports.wbg.
|
|
515
|
+
imports.wbg.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
|
|
534
516
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
535
517
|
return addHeapObject(ret);
|
|
536
518
|
}, arguments) };
|
|
537
|
-
imports.wbg.
|
|
519
|
+
imports.wbg.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
|
|
538
520
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
539
521
|
return addHeapObject(ret);
|
|
540
522
|
}, arguments) };
|
|
541
|
-
imports.wbg.
|
|
523
|
+
imports.wbg.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
|
|
542
524
|
const ret = Array.isArray(getObject(arg0));
|
|
543
525
|
return ret;
|
|
544
526
|
};
|
|
545
|
-
imports.wbg.
|
|
527
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) {
|
|
546
528
|
let result;
|
|
547
529
|
try {
|
|
548
530
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -552,7 +534,7 @@ function __wbg_get_imports() {
|
|
|
552
534
|
const ret = result;
|
|
553
535
|
return ret;
|
|
554
536
|
};
|
|
555
|
-
imports.wbg.
|
|
537
|
+
imports.wbg.__wbg_instanceof_Map_f96986929e7e89ed = function(arg0) {
|
|
556
538
|
let result;
|
|
557
539
|
try {
|
|
558
540
|
result = getObject(arg0) instanceof Map;
|
|
@@ -562,30 +544,30 @@ function __wbg_get_imports() {
|
|
|
562
544
|
const ret = result;
|
|
563
545
|
return ret;
|
|
564
546
|
};
|
|
565
|
-
imports.wbg.
|
|
547
|
+
imports.wbg.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
|
|
566
548
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
567
549
|
return ret;
|
|
568
550
|
};
|
|
569
|
-
imports.wbg.
|
|
551
|
+
imports.wbg.__wbg_entries_c02034de337d3ee2 = function(arg0) {
|
|
570
552
|
const ret = Object.entries(getObject(arg0));
|
|
571
553
|
return addHeapObject(ret);
|
|
572
554
|
};
|
|
573
|
-
imports.wbg.
|
|
555
|
+
imports.wbg.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
|
|
574
556
|
const ret = getObject(arg0).buffer;
|
|
575
557
|
return addHeapObject(ret);
|
|
576
558
|
};
|
|
577
|
-
imports.wbg.
|
|
559
|
+
imports.wbg.__wbg_new_fec2611eb9180f95 = function(arg0) {
|
|
578
560
|
const ret = new Uint8Array(getObject(arg0));
|
|
579
561
|
return addHeapObject(ret);
|
|
580
562
|
};
|
|
581
|
-
imports.wbg.
|
|
563
|
+
imports.wbg.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
|
|
582
564
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
583
565
|
};
|
|
584
|
-
imports.wbg.
|
|
566
|
+
imports.wbg.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
|
|
585
567
|
const ret = getObject(arg0).length;
|
|
586
568
|
return ret;
|
|
587
569
|
};
|
|
588
|
-
imports.wbg.
|
|
570
|
+
imports.wbg.__wbg_instanceof_Uint8Array_df0761410414ef36 = function(arg0) {
|
|
589
571
|
let result;
|
|
590
572
|
try {
|
|
591
573
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -598,15 +580,15 @@ function __wbg_get_imports() {
|
|
|
598
580
|
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
599
581
|
const v = getObject(arg1);
|
|
600
582
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
601
|
-
|
|
602
|
-
|
|
583
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
584
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
603
585
|
};
|
|
604
586
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
605
587
|
const ret = debugString(getObject(arg1));
|
|
606
588
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
607
589
|
const len1 = WASM_VECTOR_LEN;
|
|
608
|
-
|
|
609
|
-
|
|
590
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
591
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
610
592
|
};
|
|
611
593
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
612
594
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
@@ -619,17 +601,16 @@ function __wbg_get_imports() {
|
|
|
619
601
|
return imports;
|
|
620
602
|
}
|
|
621
603
|
|
|
622
|
-
function __wbg_init_memory(imports,
|
|
604
|
+
function __wbg_init_memory(imports, memory) {
|
|
623
605
|
|
|
624
606
|
}
|
|
625
607
|
|
|
626
608
|
function __wbg_finalize_init(instance, module) {
|
|
627
609
|
wasm = instance.exports;
|
|
628
610
|
__wbg_init.__wbindgen_wasm_module = module;
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
cachedUint8Memory0 = null;
|
|
611
|
+
cachedDataViewMemory0 = null;
|
|
612
|
+
cachedUint8ArrayMemory0 = null;
|
|
613
|
+
|
|
633
614
|
|
|
634
615
|
|
|
635
616
|
return wasm;
|
|
@@ -638,6 +619,15 @@ function __wbg_finalize_init(instance, module) {
|
|
|
638
619
|
function initSync(module) {
|
|
639
620
|
if (wasm !== undefined) return wasm;
|
|
640
621
|
|
|
622
|
+
|
|
623
|
+
if (typeof module !== 'undefined') {
|
|
624
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
625
|
+
({module} = module)
|
|
626
|
+
} else {
|
|
627
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
641
631
|
const imports = __wbg_get_imports();
|
|
642
632
|
|
|
643
633
|
__wbg_init_memory(imports);
|
|
@@ -651,24 +641,33 @@ function initSync(module) {
|
|
|
651
641
|
return __wbg_finalize_init(instance, module);
|
|
652
642
|
}
|
|
653
643
|
|
|
654
|
-
async function __wbg_init(
|
|
644
|
+
async function __wbg_init(module_or_path) {
|
|
655
645
|
if (wasm !== undefined) return wasm;
|
|
656
646
|
|
|
657
|
-
|
|
658
|
-
|
|
647
|
+
|
|
648
|
+
if (typeof module_or_path !== 'undefined') {
|
|
649
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
650
|
+
({module_or_path} = module_or_path)
|
|
651
|
+
} else {
|
|
652
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (typeof module_or_path === 'undefined') {
|
|
657
|
+
module_or_path = new URL('web_fmt_bg.wasm', import.meta.url);
|
|
659
658
|
}
|
|
660
659
|
const imports = __wbg_get_imports();
|
|
661
660
|
|
|
662
|
-
if (typeof
|
|
663
|
-
|
|
661
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
662
|
+
module_or_path = fetch(module_or_path);
|
|
664
663
|
}
|
|
665
664
|
|
|
666
665
|
__wbg_init_memory(imports);
|
|
667
666
|
|
|
668
|
-
const { instance, module } = await __wbg_load(await
|
|
667
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
669
668
|
|
|
670
669
|
return __wbg_finalize_init(instance, module);
|
|
671
670
|
}
|
|
672
671
|
|
|
673
|
-
export { initSync }
|
|
672
|
+
export { initSync };
|
|
674
673
|
export default __wbg_init;
|
package/web_fmt_bg.wasm
CHANGED
|
Binary file
|
package/web_fmt_bg.wasm.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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;
|
|
4
5
|
export function format_style(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
5
6
|
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;
|
|
7
7
|
export function format_markup(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
8
8
|
export function format_script(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
9
9
|
export function __wbindgen_export_0(a: number, b: number): number;
|