0

I am looking for a way to get the decorators applied to each method arguments using Reflect.getMetadataKeys.This works perfect to get decorators applied to method itself but I don't know how to get to the arguments decorators. In my case I want to check that certain decorators are applied to the arguments.

In case I have the next class:

import {Reflect} from 'reflect-metadata'

MyClass{
@decorator1()
@decorator2()
myMethod(@argumentDecorator() a){...}
}

const result = Reflect.getMetadataKeys(MyClass.myMethod)

This way I can get the list of decorator1 and decorator2 keys. Buth how to check that argumentDecorator is applied to first myMethod?

0 Answers0