1
0
mirror of git://jb55.com/damus synced 2024-09-18 19:23:49 +00:00
damus/nostrscript/bool_setting.ts

20 lines
392 B
TypeScript
Raw Normal View History

2023-07-03 23:59:50 +00:00
import * as nostr from './nostr'
2023-07-04 00:10:57 +00:00
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;
2023-07-03 23:59:50 +00:00
}
2023-07-04 00:10:57 +00:00
if (!nostr.set_bool_setting(new_setting, false)) {
return 0;
}