Removing elements from arrays
If you load an array it gets treated as an object:
"expansion_prices": { "0": { "coins": 501, "cash": 10 }, "1": { "coins": 2002, "cash": 15 }, "2": { "coins": 3000, "cash": 20 }, etc
instead of "expansion_prices": [ [ "coins": 501, "cash": 10 ], [ "coins": 2002, "cash": 15 ], [ "coins": 3000, "cash": 20 ], etc.
which causes tons of issues when you are working with sensitive languages such as python for example. Any ideas how to fix this?
OK guys I found a solution. I saw the comment: //TODO: Deal with array type in onde.Onde.prototype._sanitizeFieldInfo and I added a quick workaround. Not pretty at all but works. Inside the function, on the first line add
var stringified = JSON.stringify(valueData);
And where the comment is the following lines:
if ( stringified.charAt(0) == '[' ) { fieldInfo.type = 'array'; }
And as far as I can see it works fine. I'll do some more testing and I'll let you know if there are any problems.
actually found an issue - cannot use charAt() on an object. So the if condition works as if ( typeof stringified != 'undefined' && stringified.charAt(0) == '[' ) { fieldInfo.type = 'array'; }