injection
Advanced tools
Comparing version 1.7.5 to 1.7.6
1.7.6 / 2019-08-30 | ||
================== | ||
* Same as v1.7.4 version | ||
1.7.4 / 2019-08-22 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -23,3 +23,3 @@ import 'reflect-metadata'; | ||
static getDecoratorClsMethodKey(decoratorNameKey: decoratorKey, methodKey: decoratorKey): string; | ||
listModule(key: any): unknown[]; | ||
listModule(key: any): {}[]; | ||
static getOriginMetadata(metaKey: any, target: any, method?: any): any; | ||
@@ -218,3 +218,3 @@ /** | ||
*/ | ||
export declare function listPreloadModule(): unknown[]; | ||
export declare function listPreloadModule(): {}[]; | ||
/** | ||
@@ -230,3 +230,3 @@ * save module to inner map | ||
*/ | ||
export declare function listModule(decoratorNameKey: decoratorKey): unknown[]; | ||
export declare function listModule(decoratorNameKey: decoratorKey): {}[]; | ||
/** | ||
@@ -233,0 +233,0 @@ * clear all module |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import { IResource } from '../interfaces'; | ||
@@ -3,0 +2,0 @@ export declare class Resource implements IResource { |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
/** | ||
@@ -3,0 +2,0 @@ * 管理对象解析构建 |
@@ -389,8 +389,7 @@ "use strict"; | ||
} | ||
let inst = null; | ||
// let inst = await this.compareAndSetCreating(definition); | ||
// // 如果非 null 表示已经创建成功 | ||
// if (inst) { | ||
// return inst; | ||
// } | ||
let inst = await this.compareAndSetCreating(definition); | ||
// 如果非 null 表示已经创建成功 | ||
if (inst) { | ||
return inst; | ||
} | ||
// 预先初始化依赖 | ||
@@ -420,3 +419,3 @@ if (definition.hasDependsOn()) { | ||
if (!inst) { | ||
// this.removeCreating(definition, false); | ||
this.removeCreating(definition, false); | ||
throw new Error(`${definition.id} config no valid path`); | ||
@@ -444,3 +443,3 @@ } | ||
} | ||
// this.removeCreating(definition, false); | ||
this.removeCreating(definition, false); | ||
throw error; | ||
@@ -461,3 +460,3 @@ } | ||
this.singletonCache.set(definition.id, inst); | ||
// this.removeCreating(definition, true); | ||
this.removeCreating(definition, true); | ||
} | ||
@@ -490,3 +489,2 @@ // for request scope | ||
*/ | ||
// @ts-ignore | ||
async compareAndSetCreating(definition) { | ||
@@ -511,3 +509,2 @@ if (definition.isSingletonScope() && definition.id) { | ||
*/ | ||
// @ts-ignore | ||
removeCreating(definition, success) { | ||
@@ -514,0 +511,0 @@ if (definition.isSingletonScope() && this.creating.has(definition.id)) { |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
export declare type ObjectIdentifier = string; | ||
@@ -3,0 +2,0 @@ export declare type Scope = 'Singleton' | 'Request' | 'Prototype'; |
{ | ||
"name": "injection", | ||
"version": "1.7.5", | ||
"version": "1.7.6", | ||
"description": "A New IoC Container For All Node.js Application", | ||
@@ -5,0 +5,0 @@ "main": "dist/index", |
@@ -462,8 +462,7 @@ /** | ||
let inst = null; | ||
// let inst = await this.compareAndSetCreating(definition); | ||
// // 如果非 null 表示已经创建成功 | ||
// if (inst) { | ||
// return inst; | ||
// } | ||
let inst = await this.compareAndSetCreating(definition); | ||
// 如果非 null 表示已经创建成功 | ||
if (inst) { | ||
return inst; | ||
} | ||
@@ -496,3 +495,3 @@ // 预先初始化依赖 | ||
if (!inst) { | ||
// this.removeCreating(definition, false); | ||
this.removeCreating(definition, false); | ||
throw new Error(`${definition.id} config no valid path`); | ||
@@ -521,3 +520,3 @@ } | ||
} | ||
// this.removeCreating(definition, false); | ||
this.removeCreating(definition, false); | ||
throw error; | ||
@@ -542,3 +541,3 @@ } | ||
this.singletonCache.set(definition.id, inst); | ||
// this.removeCreating(definition, true); | ||
this.removeCreating(definition, true); | ||
} | ||
@@ -576,3 +575,2 @@ | ||
*/ | ||
// @ts-ignore | ||
private async compareAndSetCreating(definition: IObjectDefinition): Promise<any> { | ||
@@ -597,3 +595,2 @@ if (definition.isSingletonScope() && definition.id) { | ||
*/ | ||
// @ts-ignore | ||
private removeCreating(definition: IObjectDefinition, success: boolean): boolean { | ||
@@ -600,0 +597,0 @@ if (definition.isSingletonScope() && this.creating.has(definition.id)) { |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
379647
8161