@aesop-fables/containr
Advanced tools
Comparing version 0.5.3 to 0.6.1
@@ -97,3 +97,3 @@ "use strict"; | ||
singleton(key, value) { | ||
return this.push(key, new Dependencies_1.ValueFactoryDependency(key, value), Scopes_1.Scopes.Singleton); | ||
return this.push(key, new Dependencies_1.SingletonDependency(key, value), Scopes_1.Scopes.Singleton); | ||
} | ||
@@ -100,0 +100,0 @@ /** |
@@ -15,2 +15,9 @@ import { IServiceContainer, ValueFactoryDelegate } from './IServiceContainer'; | ||
} | ||
export declare class SingletonDependency<T> implements IDependency<T> { | ||
readonly key: string; | ||
private readonly value; | ||
constructor(key: string, value: T); | ||
resolveValue(): T; | ||
clone(): IDependency<T>; | ||
} | ||
export declare class ArrayDependency<T> implements IDependency<T[]> { | ||
@@ -17,0 +24,0 @@ readonly key: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ContainerDependency = exports.UnknownDependency = exports.ArrayDependency = exports.ValueFactoryDependency = void 0; | ||
exports.ContainerDependency = exports.UnknownDependency = exports.ArrayDependency = exports.SingletonDependency = exports.ValueFactoryDependency = void 0; | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
@@ -33,2 +33,15 @@ const Constants_1 = require("./Constants"); | ||
exports.ValueFactoryDependency = ValueFactoryDependency; | ||
class SingletonDependency { | ||
constructor(key, value) { | ||
this.key = key; | ||
this.value = value; | ||
} | ||
resolveValue() { | ||
return this.value; | ||
} | ||
clone() { | ||
return this; | ||
} | ||
} | ||
exports.SingletonDependency = SingletonDependency; | ||
class ArrayDependency { | ||
@@ -35,0 +48,0 @@ constructor(key, values = []) { |
{ | ||
"name": "@aesop-fables/containr", | ||
"version": "0.5.3", | ||
"version": "0.6.1", | ||
"description": "Inversion of Control container for Typescript", | ||
@@ -23,3 +23,3 @@ "type": "commonjs", | ||
"preversion": "npm run lint", | ||
"version": "0.5.3", | ||
"version": "0.6.1", | ||
"postversion": "git push && git push --tags" | ||
@@ -26,0 +26,0 @@ }, |
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
64476
1405