feat: optimze plugin system

This commit is contained in:
2023-07-19 17:16:50 +08:00
parent 25a8f35f28
commit 3f1de332fd
39 changed files with 6701 additions and 131 deletions

View File

@@ -154,8 +154,9 @@ export const reduceMetadata = (ctx: interfaces.Context): any => {
function initAutowired(container: Container) {
container.bind(ioc.Autowired).toDynamicValue((ctx) => {
var metadata: any = reduceMetadata(ctx)
let key = Object.toString.call(metadata.named)
let key = Object.prototype.toString.call(metadata.named)
if (key === "[object Function]" || key === "[object Symbol]") { return container.get(metadata.named) }
console.warn('container autowired', metadata.named, 'failed. Error: illegal serviceIdentifier type', key)
return undefined
})
}