alexprey / sveltedoc-parser

Generate a JSON documentation for a Svelte (https://github.com/sveltejs/svelte) component
https://www.npmjs.com/package/sveltedoc-parser
MIT License
90 stars 7 forks source link

Enhanced primitive type inference #71

Closed ekhaled closed 3 years ago

ekhaled commented 3 years ago

@alexprey

I'm not sure how open you are to this enhancement.

It would be ideal if we could infer some more types before falling back to any.

This PR allows us to infer object, array and function types.

Please have a look and let me know if any changes required.

alexprey commented 3 years ago

Hi, that an awesome changes! Thanks! However, I'm worry for just array notation. It'll be cool if you can try to identify specific type of array and return Array<number> or something else. If you don't plan to work on that - OK, I merge the current version and create task for the future.

Thanks! ❤️

ekhaled commented 3 years ago

I agree it is a nice feature to have. But let's keep the scope of this PR limited, and possibly look at that feature separately

alexprey commented 3 years ago

Ok, I'll create a new task for that improvement