@wasm-fmt/json_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/json_fmt.js +114 -114
- package/json_fmt_bg.wasm +0 -0
- package/json_fmt_bg.wasm.d.ts +5 -5
- package/json_fmt_node.js +1 -1
- package/json_fmt_vite.js +1 -1
- package/jsr.jsonc +1 -1
- package/package.json +1 -1
- package/wasm-fmt-json_fmt-0.1.13.tgz +0 -0
- package/wasm-fmt-json_fmt-0.1.11.tgz +0 -0
package/json_fmt.js
CHANGED
|
@@ -6,20 +6,6 @@ heap.push(undefined, null, true, false);
|
|
|
6
6
|
|
|
7
7
|
function getObject(idx) { return heap[idx]; }
|
|
8
8
|
|
|
9
|
-
let heap_next = heap.length;
|
|
10
|
-
|
|
11
|
-
function dropObject(idx) {
|
|
12
|
-
if (idx < 132) return;
|
|
13
|
-
heap[idx] = heap_next;
|
|
14
|
-
heap_next = idx;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function takeObject(idx) {
|
|
18
|
-
const ret = getObject(idx);
|
|
19
|
-
dropObject(idx);
|
|
20
|
-
return ret;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
9
|
let WASM_VECTOR_LEN = 0;
|
|
24
10
|
|
|
25
11
|
let cachedUint8ArrayMemory0 = null;
|
|
@@ -85,10 +71,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
85
71
|
return ptr;
|
|
86
72
|
}
|
|
87
73
|
|
|
88
|
-
function isLikeNone(x) {
|
|
89
|
-
return x === undefined || x === null;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
74
|
let cachedDataViewMemory0 = null;
|
|
93
75
|
|
|
94
76
|
function getDataViewMemory0() {
|
|
@@ -98,6 +80,8 @@ function getDataViewMemory0() {
|
|
|
98
80
|
return cachedDataViewMemory0;
|
|
99
81
|
}
|
|
100
82
|
|
|
83
|
+
let heap_next = heap.length;
|
|
84
|
+
|
|
101
85
|
function addHeapObject(obj) {
|
|
102
86
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
103
87
|
const idx = heap_next;
|
|
@@ -107,15 +91,6 @@ function addHeapObject(obj) {
|
|
|
107
91
|
return idx;
|
|
108
92
|
}
|
|
109
93
|
|
|
110
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
111
|
-
|
|
112
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
113
|
-
|
|
114
|
-
function getStringFromWasm0(ptr, len) {
|
|
115
|
-
ptr = ptr >>> 0;
|
|
116
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
94
|
function debugString(val) {
|
|
120
95
|
// primitive types
|
|
121
96
|
const type = typeof val;
|
|
@@ -157,7 +132,7 @@ function debugString(val) {
|
|
|
157
132
|
// Test for built-in
|
|
158
133
|
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
159
134
|
let className;
|
|
160
|
-
if (builtInMatches.length > 1) {
|
|
135
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
161
136
|
className = builtInMatches[1];
|
|
162
137
|
} else {
|
|
163
138
|
// Failed to match the standard '[object ClassName]'
|
|
@@ -180,6 +155,31 @@ function debugString(val) {
|
|
|
180
155
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
181
156
|
return className;
|
|
182
157
|
}
|
|
158
|
+
|
|
159
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
160
|
+
|
|
161
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
162
|
+
|
|
163
|
+
function getStringFromWasm0(ptr, len) {
|
|
164
|
+
ptr = ptr >>> 0;
|
|
165
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function isLikeNone(x) {
|
|
169
|
+
return x === undefined || x === null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function dropObject(idx) {
|
|
173
|
+
if (idx < 132) return;
|
|
174
|
+
heap[idx] = heap_next;
|
|
175
|
+
heap_next = idx;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function takeObject(idx) {
|
|
179
|
+
const ret = getObject(idx);
|
|
180
|
+
dropObject(idx);
|
|
181
|
+
return ret;
|
|
182
|
+
}
|
|
183
183
|
/**
|
|
184
184
|
* @param {string} src
|
|
185
185
|
* @param {Config | undefined} [config]
|
|
@@ -246,85 +246,30 @@ async function __wbg_load(module, imports) {
|
|
|
246
246
|
function __wbg_get_imports() {
|
|
247
247
|
const imports = {};
|
|
248
248
|
imports.wbg = {};
|
|
249
|
-
imports.wbg.
|
|
250
|
-
takeObject(arg0);
|
|
251
|
-
};
|
|
252
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
253
|
-
const ret = getObject(arg0) === undefined;
|
|
254
|
-
return ret;
|
|
255
|
-
};
|
|
256
|
-
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
257
|
-
const ret = getObject(arg0) in getObject(arg1);
|
|
258
|
-
return ret;
|
|
259
|
-
};
|
|
260
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
261
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
262
|
-
return ret;
|
|
263
|
-
};
|
|
264
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
265
|
-
const obj = getObject(arg1);
|
|
266
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
267
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
268
|
-
var len1 = WASM_VECTOR_LEN;
|
|
269
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
270
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
271
|
-
};
|
|
272
|
-
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
273
|
-
const val = getObject(arg0);
|
|
274
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
275
|
-
return ret;
|
|
276
|
-
};
|
|
277
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
278
|
-
const ret = getObject(arg0);
|
|
279
|
-
return addHeapObject(ret);
|
|
280
|
-
};
|
|
281
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
282
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
283
|
-
return addHeapObject(ret);
|
|
284
|
-
};
|
|
285
|
-
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
286
|
-
const ret = getObject(arg0) == getObject(arg1);
|
|
287
|
-
return ret;
|
|
288
|
-
};
|
|
289
|
-
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
290
|
-
const v = getObject(arg0);
|
|
291
|
-
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
292
|
-
return ret;
|
|
293
|
-
};
|
|
294
|
-
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
295
|
-
const obj = getObject(arg1);
|
|
296
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
297
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
298
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
299
|
-
};
|
|
300
|
-
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
301
|
-
const ret = +getObject(arg0);
|
|
302
|
-
return ret;
|
|
303
|
-
};
|
|
304
|
-
imports.wbg.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
|
|
249
|
+
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
305
250
|
const ret = String(getObject(arg1));
|
|
306
251
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
307
252
|
const len1 = WASM_VECTOR_LEN;
|
|
308
253
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
309
254
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
310
255
|
};
|
|
311
|
-
imports.wbg.
|
|
312
|
-
const ret =
|
|
256
|
+
imports.wbg.__wbg_buffer_61b7ce01341d7f88 = function(arg0) {
|
|
257
|
+
const ret = getObject(arg0).buffer;
|
|
313
258
|
return addHeapObject(ret);
|
|
314
259
|
};
|
|
315
|
-
imports.wbg.
|
|
316
|
-
const ret = getObject(arg0)
|
|
260
|
+
imports.wbg.__wbg_entries_4f2bb9b0d701c0f6 = function(arg0) {
|
|
261
|
+
const ret = Object.entries(getObject(arg0));
|
|
317
262
|
return addHeapObject(ret);
|
|
318
263
|
};
|
|
319
|
-
imports.wbg.
|
|
264
|
+
imports.wbg.__wbg_get_9aa3dff3f0266054 = function(arg0, arg1) {
|
|
320
265
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
321
266
|
return addHeapObject(ret);
|
|
322
267
|
};
|
|
323
|
-
imports.wbg.
|
|
324
|
-
const ret = getObject(arg0)
|
|
325
|
-
return ret;
|
|
268
|
+
imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
|
269
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
270
|
+
return addHeapObject(ret);
|
|
326
271
|
};
|
|
327
|
-
imports.wbg.
|
|
272
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_670ddde44cdb2602 = function(arg0) {
|
|
328
273
|
let result;
|
|
329
274
|
try {
|
|
330
275
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -334,37 +279,42 @@ function __wbg_get_imports() {
|
|
|
334
279
|
const ret = result;
|
|
335
280
|
return ret;
|
|
336
281
|
};
|
|
337
|
-
imports.wbg.
|
|
282
|
+
imports.wbg.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function(arg0) {
|
|
283
|
+
let result;
|
|
284
|
+
try {
|
|
285
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
286
|
+
} catch (_) {
|
|
287
|
+
result = false;
|
|
288
|
+
}
|
|
289
|
+
const ret = result;
|
|
290
|
+
return ret;
|
|
291
|
+
};
|
|
292
|
+
imports.wbg.__wbg_isSafeInteger_12f5549b2fca23f4 = function(arg0) {
|
|
338
293
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
339
294
|
return ret;
|
|
340
295
|
};
|
|
341
|
-
imports.wbg.
|
|
342
|
-
const ret =
|
|
343
|
-
return
|
|
296
|
+
imports.wbg.__wbg_length_65d1cd11729ced11 = function(arg0) {
|
|
297
|
+
const ret = getObject(arg0).length;
|
|
298
|
+
return ret;
|
|
344
299
|
};
|
|
345
|
-
imports.wbg.
|
|
346
|
-
const ret = getObject(arg0).
|
|
347
|
-
return
|
|
300
|
+
imports.wbg.__wbg_length_d65cf0786bfc5739 = function(arg0) {
|
|
301
|
+
const ret = getObject(arg0).length;
|
|
302
|
+
return ret;
|
|
348
303
|
};
|
|
349
|
-
imports.wbg.
|
|
304
|
+
imports.wbg.__wbg_new_3ff5b33b1ce712df = function(arg0) {
|
|
350
305
|
const ret = new Uint8Array(getObject(arg0));
|
|
351
306
|
return addHeapObject(ret);
|
|
352
307
|
};
|
|
353
|
-
imports.wbg.
|
|
308
|
+
imports.wbg.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) {
|
|
354
309
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
355
310
|
};
|
|
356
|
-
imports.wbg.
|
|
357
|
-
const ret = getObject(arg0)
|
|
311
|
+
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
312
|
+
const ret = +getObject(arg0);
|
|
358
313
|
return ret;
|
|
359
314
|
};
|
|
360
|
-
imports.wbg.
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
364
|
-
} catch (_) {
|
|
365
|
-
result = false;
|
|
366
|
-
}
|
|
367
|
-
const ret = result;
|
|
315
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
316
|
+
const v = getObject(arg0);
|
|
317
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
368
318
|
return ret;
|
|
369
319
|
};
|
|
370
320
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
@@ -374,13 +324,63 @@ function __wbg_get_imports() {
|
|
|
374
324
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
375
325
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
376
326
|
};
|
|
377
|
-
imports.wbg.
|
|
378
|
-
|
|
327
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
328
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
329
|
+
return addHeapObject(ret);
|
|
330
|
+
};
|
|
331
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
332
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
333
|
+
return ret;
|
|
334
|
+
};
|
|
335
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
336
|
+
const val = getObject(arg0);
|
|
337
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
338
|
+
return ret;
|
|
339
|
+
};
|
|
340
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
341
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
342
|
+
return ret;
|
|
343
|
+
};
|
|
344
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
345
|
+
const ret = getObject(arg0) === undefined;
|
|
346
|
+
return ret;
|
|
347
|
+
};
|
|
348
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
349
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
350
|
+
return ret;
|
|
379
351
|
};
|
|
380
352
|
imports.wbg.__wbindgen_memory = function() {
|
|
381
353
|
const ret = wasm.memory;
|
|
382
354
|
return addHeapObject(ret);
|
|
383
355
|
};
|
|
356
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
357
|
+
const obj = getObject(arg1);
|
|
358
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
359
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
360
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
361
|
+
};
|
|
362
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
363
|
+
const ret = getObject(arg0);
|
|
364
|
+
return addHeapObject(ret);
|
|
365
|
+
};
|
|
366
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
367
|
+
takeObject(arg0);
|
|
368
|
+
};
|
|
369
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
370
|
+
const obj = getObject(arg1);
|
|
371
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
372
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
373
|
+
var len1 = WASM_VECTOR_LEN;
|
|
374
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
375
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
376
|
+
};
|
|
377
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
378
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
379
|
+
return addHeapObject(ret);
|
|
380
|
+
};
|
|
381
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
382
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
383
|
+
};
|
|
384
384
|
|
|
385
385
|
return imports;
|
|
386
386
|
}
|
package/json_fmt_bg.wasm
CHANGED
|
Binary file
|
package/json_fmt_bg.wasm.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
4
|
+
export const format: (a: number, b: number, c: number, d: number) => void;
|
|
5
|
+
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
6
|
+
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
7
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
8
|
+
export const __wbindgen_export_2: (a: number, b: number, c: number) => void;
|
package/json_fmt_node.js
CHANGED
|
@@ -3,7 +3,7 @@ import initAsync from "./json_fmt.js";
|
|
|
3
3
|
|
|
4
4
|
const wasm = new URL("./json_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/json_fmt_vite.js
CHANGED
package/jsr.jsonc
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|