Sort card data by keys for consistent diffs

This commit is contained in:
Adam Goldsmith 2021-09-08 21:31:38 -04:00
parent 2e498dab9b
commit a0f66b935a
1 changed files with 10 additions and 1 deletions

View File

@ -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 = [];