jackbsteinberg / get-originals-rewriter

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Refactor type retrieval #81

Closed jackbsteinberg closed 5 years ago

jackbsteinberg commented 5 years ago

Currently getModuleNameForType is explicitly checking for literal values, but while I was digging though the documentation I found the .getApparentType() method, which turns literal types into their apparent counterpart (e.g. 4 into Number)

https://ts-morph.com/details/types

domenic commented 5 years ago

Based on the code you deleted, it sounds like it does more than turn literal types into their counterparts; it also turns primitive types into their corresponding classes.

jackbsteinberg commented 5 years ago

Based on the code you deleted, it sounds like it does more than turn literal types into their counterparts; it also turns primitive types into their corresponding classes.

Yep it does seem to do that as well