koatty_container
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -107,3 +107,3 @@ "use strict"; | ||
// inject value | ||
Value_1.injectValue(target, target.prototype, this, app.config); | ||
Value_1.injectValue(target, target.prototype, this); | ||
// inject AOP | ||
@@ -110,0 +110,0 @@ AOP_1.injectAOP(target, target.prototype, this); |
@@ -28,2 +28,2 @@ import { Container } from "./Container"; | ||
*/ | ||
export declare function injectValue(target: any, instance: any, container: Container, bindingFunc: (key: string, type: string) => any): void; | ||
export declare function injectValue(target: any, instance: any, container: Container): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.injectValue = exports.Config = exports.Value = void 0; | ||
const tslib_1 = require("tslib"); | ||
/* | ||
* @Author: richen | ||
* @Date: 2020-12-18 10:37:03 | ||
* @LastEditors: linyyyang<linyyyang@tencent.com> | ||
* @LastEditTime: 2020-12-18 15:35:12 | ||
* @License: BSD (3-Clause) | ||
* @Copyright (c) - <richenlin(at)gmail.com> | ||
*/ | ||
const helper = tslib_1.__importStar(require("koatty_lib")); | ||
const koatty_logger_1 = require("koatty_logger"); | ||
@@ -58,3 +48,3 @@ const Container_1 = require("./Container"); | ||
*/ | ||
function injectValue(target, instance, container, bindingFunc) { | ||
function injectValue(target, instance, container) { | ||
// const componentType = IOCContainer.getType(target); | ||
@@ -64,7 +54,7 @@ // if (componentType === "MIDDLEWARE") { | ||
// } | ||
if (!helper.isFunction(bindingFunc)) { | ||
throw Error("The bindingFunc must be a function."); | ||
const app = container.getApp(); | ||
if (!app) { | ||
return; | ||
} | ||
const metaData = Util_1.RecursiveGetMetadata(IContainer_1.TAGGED_ARGS, target); | ||
const app = container.getApp(); | ||
// tslint:disable-next-line: forin | ||
@@ -80,3 +70,3 @@ for (const metaKey in metaData) { | ||
writable: true, | ||
value: bindingFunc(propKey, type) | ||
value: app.config(propKey, type) | ||
}); | ||
@@ -83,0 +73,0 @@ } |
{ | ||
"name": "koatty_container", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
75358
1544