runem / web-component-analyzer

CLI that analyzes web components and emits documentation
https://runem.github.io/web-component-analyzer
MIT License
502 stars 63 forks source link

Not getting default values if output type is JSON #102

Closed bahrus closed 4 years ago

bahrus commented 5 years ago

This is a really impressive utility.

I've noticed that if I use the default formatter, I get a column for default values for properties.

But the default value is not provided if outputting to JSON. Would be great if JSON could also support default values.

Also, if the default value is a JS object, the keys get truncated to the first letter, e.g.:

newDataPointTestValue2 = {
    label: "test",
    index: 10,
    valueFromEachDataset: []
};

produces {"l":"test","i":10,"v":[]}

web-padawan commented 4 years ago

@runem this is something I really need for the api-viewer component. Do you have any guidance on how this should be implemented?

runem commented 4 years ago

The default value is now included in the json output, and the issue with parsing default object literal has been fixed as well :tada: