koatty_container
Advanced tools
Comparing version 1.4.3 to 1.4.4
@@ -5,2 +5,4 @@ # Changelog | ||
### [1.4.4](https://github.com/koatty/koatty_container/compare/v1.4.3...v1.4.4) (2021-07-07) | ||
### [1.4.3](https://github.com/koatty/koatty_container/compare/v1.4.2...v1.4.3) (2021-06-29) | ||
@@ -7,0 +9,0 @@ |
@@ -98,3 +98,3 @@ "use strict"; | ||
function injectAutowired(target, instance, container, isLazy = false) { | ||
var _a, _b; | ||
var _a; | ||
const metaData = Util_1.RecursiveGetMetadata(IContainer_1.TAGGED_PROP, target); | ||
@@ -104,3 +104,3 @@ // tslint:disable-next-line: forin | ||
let dep; | ||
const { type, identifier, delay, args } = (_a = metaData[metaKey]) !== null && _a !== void 0 ? _a : { type: "", identifier: "", delay: false, args: [] }; | ||
const { type, identifier, delay, args } = metaData[metaKey] || { type: "", identifier: "", delay: false, args: [] }; | ||
if (type && identifier) { | ||
@@ -119,3 +119,3 @@ if (!delay || isLazy) { | ||
else { | ||
throw new Error(`Component ${(_b = metaData[metaKey].identifier) !== null && _b !== void 0 ? _b : ""} not found. It's autowired in class ${target.name}`); | ||
throw new Error(`Component ${(_a = metaData[metaKey].identifier) !== null && _a !== void 0 ? _a : ""} not found. It's autowired in class ${target.name}`); | ||
} | ||
@@ -122,0 +122,0 @@ } |
@@ -44,4 +44,3 @@ "use strict"; | ||
static getInstance() { | ||
var _a; | ||
return (_a = this.instance) !== null && _a !== void 0 ? _a : (this.instance = new Container()); | ||
return this.instance || (this.instance = new Container()); | ||
} | ||
@@ -48,0 +47,0 @@ /** |
@@ -8,3 +8,3 @@ "use strict"; | ||
* @LastEditors: Please set LastEditors | ||
* @LastEditTime: 2021-06-28 18:13:56 | ||
* @LastEditTime: 2021-07-07 18:04:11 | ||
* @License: BSD (3-Clause) | ||
@@ -34,5 +34,5 @@ * @Copyright (c) - <richenlin(at)gmail.com> | ||
// } | ||
// identifier = identifier ?? helper.camelCase(propertyKey, { pascalCase: true }); | ||
key = key !== null && key !== void 0 ? key : propertyKey; | ||
Container_1.IOCContainer.savePropertyData(IContainer_1.TAGGED_ARGS, `${key !== null && key !== void 0 ? key : ""}|${type !== null && type !== void 0 ? type : "config"}`, target, propertyKey); | ||
// identifier = identifier || helper.camelCase(propertyKey, { pascalCase: true }); | ||
key = key || propertyKey; | ||
Container_1.IOCContainer.savePropertyData(IContainer_1.TAGGED_ARGS, `${key !== null && key !== void 0 ? key : ""}|${type || "config"}`, target, propertyKey); | ||
}; | ||
@@ -39,0 +39,0 @@ } |
{ | ||
"name": "koatty_container", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"description": "IOC Container for Koatty.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1856872
1750