Comparing version 1.2.0 to 1.2.1
@@ -11,3 +11,3 @@ import { Scope } from './scope'; | ||
middlewares: Middleware[]; | ||
constructor(name?: string, parent?: Mesh | undefined); | ||
constructor(name?: string, parent?: Mesh | undefined, scope?: Scope); | ||
service<T>(impl: ServiceConstructor<T>): this; | ||
@@ -14,0 +14,0 @@ service<T>(key: AbstractClass<T> | string, impl: ServiceConstructor<T>): this; |
@@ -9,3 +9,3 @@ "use strict"; | ||
class Mesh { | ||
constructor(name = 'default', parent = undefined) { | ||
constructor(name = 'default', parent = undefined, scope) { | ||
this.name = name; | ||
@@ -16,3 +16,3 @@ this.parent = parent; | ||
this.middlewares = []; | ||
this.currentScope = new scope_1.Scope(name); | ||
this.currentScope = scope !== null && scope !== void 0 ? scope : new scope_1.Scope(name); | ||
this.currentScope.constant('Mesh', this); | ||
@@ -70,4 +70,3 @@ } | ||
const newScope = new scope_1.Scope(scopeName, childScope !== null && childScope !== void 0 ? childScope : []); | ||
const mesh = new Mesh(scopeId, this); | ||
mesh.currentScope = newScope; | ||
const mesh = new Mesh(scopeId, this, newScope); | ||
return mesh; | ||
@@ -74,0 +73,0 @@ } |
{ | ||
"name": "mesh-ioc", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Mesh: Powerful and Lightweight IoC Library", | ||
@@ -5,0 +5,0 @@ "main": "out/main/index.js", |
27547
18
376