ts-morph
ts-morph copied to clipboard
exposing Node#_getNodeFromCompilerNode
Is there a reason not to make it public? createWrappedNode alternative creates contextless nodes (typechecker, lang service, ...).
Thanks!
There is a very high chance of mis-use (ex. providing an out of date node). I should make all these methods actually private.
David, thanks for your reply.
in that case maybe it is possible for createWrappedNode to accept additional argument (maybe project?: Project) and return a first-class instance of Node?
Thinking about it more, I think we could expose this method, but the public one would do some additional checks on the provided compiler node to make sure it's still valid. The internal one doesn't for performance reasons.