tst-reflect
tst-reflect copied to clipboard
Unable to access parameter decorators
function a(obj: Object, key: string, prop: number) {}
class Foo {
boo?: boolean | null
foo(@a x: string) {}
}
console.dir(
getType<Foo>()
.getMethods()
.map(p => p.getParameters().map(p => p.type.getDecorators())),
)
Returns empty, I think getDecorators should be on the parameter itself and not the type?
You are accessing decorators of the type, ie. you are accessing decorators of the string type, which has no decorators.
There are no parameter decorators yet.
Implemented for the v1. Not in the current version.