diff --git a/js/atlas.pegjs b/js/atlas.pegjs index 3cfc523..e9885ee 100644 --- a/js/atlas.pegjs +++ b/js/atlas.pegjs @@ -18,9 +18,9 @@ ws "whitespace" = [ \t\n\r]* value = false / null / true / object / array / number / stringval / class / empty empty = "" { return undefined; } -null = "None" { return null; } -false = "False" { return false; } -true = "True" { return true; } +null = "None" / "none" { return null; } +false = "False" / "false" { return false; } +true = "True" / "true" { return true; } // ----- Objects ----- diff --git a/js/atlas_reparser.js b/js/atlas_reparser.js index a194575..f0c1a09 100644 --- a/js/atlas_reparser.js +++ b/js/atlas_reparser.js @@ -87,7 +87,7 @@ function deparseArray(input) { function deparseNumber(input, key) { // Any number which has a decimal is stored to 6 decimal places // Except for IDs. Unless they actually have such a number... erm... - if (key.substr(key.length - 2, 2) === "ID") { + if (key && key.substr(key.length - 2, 2) === "ID") { if (input % 1 === 0) { return Number(input).toString(); }