json-pretty-html
json-pretty-html copied to clipboard
Create silent option to avoid exception for unknown types
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.