forked from FOSS/BangleApps
testing strings instead of vec<u8>
parent
37f5121ab2
commit
8dcc587c45
|
@ -2,9 +2,9 @@
|
|||
/* eslint-disable */
|
||||
/**
|
||||
* @param {string} input_str
|
||||
* @returns {Uint8Array}
|
||||
* @returns {string}
|
||||
*/
|
||||
export function convert_gpx_strings(input_str: string): Uint8Array;
|
||||
export function convert_gpx_strings(input_str: string): string;
|
||||
|
||||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
||||
|
||||
|
|
|
@ -74,12 +74,16 @@ function getInt32Memory0() {
|
|||
return cachedInt32Memory0;
|
||||
}
|
||||
|
||||
function getArrayU8FromWasm0(ptr, len) {
|
||||
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
||||
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
||||
|
||||
cachedTextDecoder.decode();
|
||||
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
/**
|
||||
* @param {string} input_str
|
||||
* @returns {Uint8Array}
|
||||
* @returns {string}
|
||||
*/
|
||||
export function convert_gpx_strings(input_str) {
|
||||
try {
|
||||
|
@ -89,11 +93,10 @@ export function convert_gpx_strings(input_str) {
|
|||
wasm.convert_gpx_strings(retptr, ptr0, len0);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
||||
wasm.__wbindgen_free(r0, r1 * 1);
|
||||
return v1;
|
||||
return getStringFromWasm0(r0, r1);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
wasm.__wbindgen_free(r0, r1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue