InversifyJS
InversifyJS copied to clipboard
_postConstruct ignores MetadataReader
_postConstruct in src/resolution/instantiation.ts uses Reflect.getMetadata directly instead of using the MetadataReader.
I tried building a MetadataReader using static properties and compiling without reflect-metadata, but I get:
src/resolution/instantiation.ts:37:17 - error TS2339: Property 'hasMetadata' does not exist on type 'typeof Reflect'.
37 if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {
~~~~~~~~~~~
src/resolution/instantiation.ts:38:40 - error TS2339: Property 'getMetadata' does not exist on type 'typeof Reflect'.
38 const data: Metadata = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);