fix issue with parser and lower case true/false

This commit is contained in:
Tom Bloor 2020-09-01 01:11:20 +01:00
parent 1b06d9ca94
commit bcef697282
Signed by: TBSliver
GPG key ID: 4657C7EBE42CC5CC
2 changed files with 4 additions and 4 deletions

View file

@ -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 -----

View file

@ -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();
}