dsherret / ts-morph

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
https://ts-morph.com
MIT License
5.03k stars 196 forks source link

Is There a ts-morph API Function to Retrieve the Next Property in a Sequence? #1500

Open jon9090 opened 9 months ago

jon9090 commented 9 months ago

Apologies, it's not a bug; rather, I have an inquiry.

Is there an API function in ts-morph for retrieving the next property in the sequence foo.bar.baz? Specifically, I am positioned at bar, and I would like to obtain the subsequent property, which in this example is baz but could also be ['baz'].

Currently, I examine the AST tree by checking the parent and child relationships to determine the next property, but I'm curious if ts-morph offers a built-in solution for this.