From a0f66b935a9216446f07c3ae4c8904778558d537 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 8 Sep 2021 21:31:38 -0400 Subject: [PATCH] Sort card data by keys for consistent diffs --- strange_eons_to_arkhamdb.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/strange_eons_to_arkhamdb.js b/strange_eons_to_arkhamdb.js index 616cc23..6aec70f 100644 --- a/strange_eons_to_arkhamdb.js +++ b/strange_eons_to_arkhamdb.js @@ -177,7 +177,16 @@ function build_card(component) { // TODO: parse out some keywords into their own fields - return card_data; + // order by keys + const ordered_card_data = Object.keys(card_data).sort().reduce( + function(obj, key) { + obj[key] = card_data[key]; + return obj; + }, + {} + ); + + return ordered_card_data; } var cards = [];