From c309967a2b51ba93c261adac8c5e22bc212886fa Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Thu, 28 Mar 2019 16:31:10 +0100 Subject: [PATCH] Sort keys for table --- server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index a94546a..aaacae8 100644 --- a/server.js +++ b/server.js @@ -83,7 +83,10 @@ function parse(data) { let content = JSON.parse(data); let parsed = {ais: [], battles: {}}; - for (let key in content) { + let keys = Object.keys(content); + keys.sort(); + + for (let key of keys) { let battlers = key.split('/'); let ai1 = battlers[0]; let ai2 = battlers[1];