jsontrek 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.d.ts +2 -2
- package/bundle_bg.js +24 -5
- package/bundle_bg.wasm +0 -0
- package/package.json +1 -1
package/bundle.d.ts
CHANGED
package/bundle_bg.js
CHANGED
@@ -188,16 +188,35 @@ function debugString(val) {
|
|
188
188
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
189
189
|
return className;
|
190
190
|
}
|
191
|
+
|
192
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
193
|
+
ptr = ptr >>> 0;
|
194
|
+
const mem = getDataViewMemory0();
|
195
|
+
const result = [];
|
196
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
197
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
198
|
+
}
|
199
|
+
return result;
|
200
|
+
}
|
191
201
|
/**
|
192
202
|
* @param {any} obj
|
193
203
|
* @param {string} path
|
194
|
-
* @returns {any}
|
204
|
+
* @returns {any[]}
|
195
205
|
*/
|
196
206
|
export function parse(obj, path) {
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
207
|
+
try {
|
208
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
209
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
210
|
+
const len0 = WASM_VECTOR_LEN;
|
211
|
+
wasm.parse(retptr, addHeapObject(obj), ptr0, len0);
|
212
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
213
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
214
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
215
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
216
|
+
return v2;
|
217
|
+
} finally {
|
218
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
219
|
+
}
|
201
220
|
}
|
202
221
|
|
203
222
|
function handleError(f, args) {
|
package/bundle_bg.wasm
CHANGED
Binary file
|