true on success; false with err populated on lexical/syntax error.Minify JSON text by removing all optional whitespace.
This function preserves exact token representations (number formats, string escape sequences) while removing all whitespace between tokens.
output | Output parameter for the minified JSON string. |
input | JSON text to minify. |
err | Output parameter for error information on failure. |
true on success; false with err populated on lexical/syntax error.import ddn.data.json : minify, JsonError;
string result;
JsonError err;
assert(minify(result, `{ "a" : 1 , "b" : [ 2 , 3 ] }`, err));
assert(result == `{"a":1,"b":[2,3]}`);string minify(const(char)[] input) @safeConvenience overload that minifies JSON and returns the result directly.
input | JSON text to minify. |