edit-json-file icon indicating copy to clipboard operation
edit-json-file copied to clipboard

Use number as key

Open ermakov-olger opened this issue 3 years ago • 3 comments

I'd like to use an ID as key. messageFile.set("messages." + message.id + ".text", message.text); But I'm getting a lot of null rows generated image The reason is that the tool thinks that I want to generate an array and fills up the empty rows with null.

ermakov-olger avatar Jun 23 '22 13:06 ermakov-olger

Try escaping the id:

messageFile.set("messages.\\" + message.id + ".text", message.text);

IonicaBizau avatar Jun 23 '22 16:06 IonicaBizau

Thank you for your response. Unfortunately I get the same result.

ermakov-olger avatar Jun 24 '22 05:06 ermakov-olger

@IonicaBizau Any updates on this issue? I also got the same result with null data.

If message.id is a number, null is printed for message.id times.

karthikreddi avatar Jul 28 '22 07:07 karthikreddi