Fix the player settings page generating yaml files with string keys containing integers

This commit is contained in:
Chris Wilson
2020-10-18 00:51:50 -04:00
parent e0f1f4ecfa
commit c714131b37
3 changed files with 8 additions and 8 deletions

View File

@@ -147,7 +147,7 @@ const getSettingValue = (settings, keyString) => {
const exportSettings = () => {
const presetNumber = document.getElementById('preset-number').value;
const settings = JSON.parse(localStorage.getItem(`playerSettings${presetNumber}`));
const yamlText = jsyaml.safeDump(settings);
const yamlText = jsyaml.safeDump(settings, { noCompatMode: true }).replaceAll(/'(\d+)':/g, (x, y) => `${y}:`);
download(`${settings.description}.yaml`, yamlText);
};