Is there a way to turn {"query":{"match_all" : {} }} into {\n "query":{\n "match_all" : {}\n }\n}?
I have tried with
const stringify = require("json-stringify-pretty-compact");
const a = '{\n "query":{\n "match_all" : {}\n }\n}';
const b = '{"query":{"match_all" : {} }}';
console.log(a);
console.log(b);
const c = stringify(b);
console.log(c);
where I get
{
"query":{
"match_all" : {}
}
}
{"query":{"match_all" : {} }}
"{\"query\":{\"match_all\" : {} }}"
For some reason the \n's are missing.