-
|
Hi everyone, I was testing a NestJS codebase which uses a lot of different decorators to implement some logic. In particular, I wanted to build a query to get all classes with a My attempt was to do something like this: But this is matching all classes with a Any help would be really appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Your code works for me for simple examples. Can you provide a code example that exhibits the problem? One thing to watch out for: |
Beta Was this translation helpful? Give feedback.
Your code works for me for simple examples. Can you provide a code example that exhibits the problem?
One thing to watch out for:
toStringis abbreviated for AST nodes that would naturally consume more than 20 characters, so e.g.@RequireRole("Looooong")might turn into"@Requir ... ooong)". If that's the problem, you may need to usegetADecorator().getExpression().(InvokeExpr).getCalleeName()or similar (depending on the exact nature of the decorator) to extract the decorator's full function name.