[Question] How to extract argument from generic type?
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
It's either a brain fart or an actual issue.
```ts
export type MutableStep1Dto = MutableDto;
```
I want to extract the second argument of `MutableDto` to count the union members. I tried walking the nodes but it just doesn't yield the expected types as seen in the AST viewer, see https://ts-ast-viewer.com/#code/FAUwHgDg9gTgLgAjgTwiBBZArnAhgIwBsQBlOECANgBE4oEBeTHA42qAHjIproBoEAIiwBnEDAAqqEIIQAfIRBhQ08ZFLQjBAPgDcQA.
Contributor guide
Research direction
Begin with the generic type example in the issue and compare ts-morph's node-walking behavior with the linked AST viewer. Confirm how to reach MutableDto's second argument and count its union members, then document the result with a focused reproduction or response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100