commit 3d0448a92912418ca788f565bf29907c1d8639f0 parent 30e33a01c17649c524496de1179301d37b18e557 Author: William Casarin <jb55@jb55.com> Date: Mon, 3 Jul 2023 17:10:57 -0700 smaller nostrscript Diffstat:
M | nostrscript/bool_setting.ts | | | 27 | ++++++++++++++------------- |
M | nostrscript/bool_setting.wasm | | | 0 |
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/nostrscript/bool_setting.ts b/nostrscript/bool_setting.ts @@ -1,18 +1,19 @@ import * as nostr from './nostr' -export function go(): i32 { - var setting = "mny`or" - var new_setting = "" - for (let i = 0; i < setting.length; i++) { - new_setting += String.fromCharCode(setting.charCodeAt(i) + 1); - } - // this should fail - if (nostr.set_bool_setting("shmorg", true)) { - // you shouldn't be able to set settings that dont exist - return 0; - } - return nostr.set_bool_setting(new_setting, false) +var setting = "mny`or" +var new_setting = "" + +for (let i = 0; i < setting.length; i++) { + new_setting += String.fromCharCode(setting.charCodeAt(i) + 1); +} + +// this should fail +if (nostr.set_bool_setting("shmorg", true)) { + // you shouldn't be able to set settings that dont exist + return 0; } -go() +if (!nostr.set_bool_setting(new_setting, false)) { + return 0; +} diff --git a/nostrscript/bool_setting.wasm b/nostrscript/bool_setting.wasm Binary files differ.