Unpretty stringify?
paulyoung opened this issue · 7 comments
paulyoung commented
In JavaScript I can do this to receive a string with no spaces:
JSON.stringify(json, null, 0);
I've tried this but it didn't work as I expected:
json.stringify(indent: "")
paulyoung commented
It's also weird that I can supply any string for indent
.
+1 for a numerical param there instead.
owensd commented
JSON.stringify()
in JavaScript accepts both a string and a numeric value; I can look into supporting the numeric value as well.
What happened for intent: ""
?
paulyoung commented
Using indent: """
I get the following, vs the expected:
<{"command" : "topic","payload" : {"key" : "value"},"protocol" : "channel"}>
<{"command":"topic","payload":{"key":"value"},"protocol":"channel"}>
owensd commented
<{"command" : "topic","payload" : {"key" : "value"},"protocol" : "channel"}>
doesn't seem like the right behavior. I can follow what JSON.stringify() does though.
owensd commented
Should be fixed now.
paulyoung commented
👍