summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-01-09 14:25:50 +0100
committerTor Andersson <tor@ccxvii.net>2022-01-09 14:46:27 +0100
commite40d9af1a6e90d295191a9b1c6e320f789c58ecf (patch)
treee093e1388e0d8e515b71e288e7b0f332f9d075fb /server.js
parenta059a95c67ba2ec65a5989f7870ee56958745bdc (diff)
downloadserver-e40d9af1a6e90d295191a9b1c6e320f789c58ecf.tar.gz
Treat 1 in options object same as true.
Diffstat (limited to 'server.js')
-rw-r--r--server.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/server.js b/server.js
index 5523541..266c49c 100644
--- a/server.js
+++ b/server.js
@@ -973,14 +973,14 @@ function is_solo(players) {
function format_options(options) {
function to_english(k) {
- if (k === true) return 'yes';
+ if (k === true || k === 1) return 'yes';
if (k === false) return 'no';
return k.replace(/_/g, " ").replace(/^\w/, c => c.toUpperCase());
}
if (!options || options === '{}')
return "None";
options = JSON.parse(options);
- return Object.entries(options||{}).map(([k,v]) => v === true ? to_english(k) : `${to_english(k)}=${to_english(v)}`).join(", ");
+ return Object.entries(options||{}).map(([k,v]) => (v === true || v === 1) ? to_english(k) : `${to_english(k)}=${to_english(v)}`).join(", ");
}
function annotate_game(game, user_id) {