json-pretty-html icon indicating copy to clipboard operation
json-pretty-html copied to clipboard

Create silent option to avoid exception for unknown types

Open bertyhell opened this issue 6 years ago • 0 comments

Functions currently throw an exception, but I use this to output a readable error object. So I don't want any exceptions from pretty print.

var json = { foo: 'test', bar: () => { const test = 'test'; } };
var html = prettyPrint.default(json, json.dimensions, {silent: true});
document.write(html);

Note: I wasn't able to get the test suite to run even before my changes. So I tested my changes it using the example page.

bertyhell avatar Nov 12 '18 12:11 bertyhell