Bogdan-Lyashenko / js-code-to-svg-flowchart

js2flowchart - a visualization library to convert any JavaScript code into beautiful SVG flowchart. Learn other’s code. Design your code. Refactor code. Document code. Explain code.
MIT License
7.05k stars 477 forks source link

Is typescript supported yet? seems to work #49

Open jcyh0120 opened 4 years ago

jcyh0120 commented 4 years ago

I clone this repo and try to run on a typescript file and it works. Could you tell what's lacking with typescript support? Therefore, I could avoid using it with those unsupported cases.

Thanks for this awesome project. It's really a time saver.

Bogdan-Lyashenko commented 4 years ago

Hi, thanks :)
Yeah, TypeScript kinda works, but it's basically stripped down to JavaScript, meaning, all type definitions simply ignored and code flow (condition blocks, etc) treated the same as it was JavaScript. For majority cases it all should look fine as far as babel transpiler, used under the hood to build AST, supports that TypeScript syntax.