diff --git a/web-frontend/src/lib/common.js b/web-frontend/src/lib/common.js index 8962149..3bdcd2e 100644 --- a/web-frontend/src/lib/common.js +++ b/web-frontend/src/lib/common.js @@ -1,6 +1,21 @@ import init from 'xpin-wasm'; import * as xpinWasm from 'xpin-wasm'; +export function rustEnumToArray(e) { + let ret = []; + for (let k in e) { + // Add the string coordinate types + if (!isNaN(k * 1)) { + // This is a numeric key, not a string key + // So skip it + continue; + } + + ret.push(k); + } + return ret; +} + export const WasmStatus = { NotLoaded: -1, Loaded: 0, diff --git a/web-frontend/src/routes/app/+page.svelte b/web-frontend/src/routes/app/+page.svelte index 5f7327e..d58e48f 100644 --- a/web-frontend/src/routes/app/+page.svelte +++ b/web-frontend/src/routes/app/+page.svelte @@ -1,5 +1,5 @@