Without decorators the metadata is lost - but why?
const Baz = () : ClassDecorator => {
return target => {}
}
class Bar {}
@Baz()
class Foo {
constructor(bar: Bar) {}
}
console.log(Reflect.getMetadata('design:paramtypes', Foo));
This returns [Function: Bar]
, which is fine. But without the @Baz
decorator (which does literally nothing) it returns undefined
. Why?