Comparing version 0.6.0 to 0.6.1
@@ -28,2 +28,17 @@ import { ServiceMetadata } from "./types/ServiceMetadata"; | ||
/** | ||
* Checks if the service with given name or type is registered service container. | ||
* Optionally, parameters can be passed in case if instance is initialized in the container for the first time. | ||
*/ | ||
static has<T>(type: ObjectType<T>): boolean; | ||
/** | ||
* Checks if the service with given name or type is registered service container. | ||
* Optionally, parameters can be passed in case if instance is initialized in the container for the first time. | ||
*/ | ||
static has<T>(id: string): boolean; | ||
/** | ||
* Checks if the service with given name or type is registered service container. | ||
* Optionally, parameters can be passed in case if instance is initialized in the container for the first time. | ||
*/ | ||
static has<T>(id: Token<T>): boolean; | ||
/** | ||
* Retrieves the service with given name or type from the service container. | ||
@@ -30,0 +45,0 @@ * Optionally, parameters can be passed in case if instance is initialized in the container for the first time. |
@@ -27,2 +27,9 @@ "use strict"; | ||
/** | ||
* Checks if the service with given name or type is registered service container. | ||
* Optionally, parameters can be passed in case if instance is initialized in the container for the first time. | ||
*/ | ||
Container.has = function (identifier) { | ||
return this.globalInstance.has(identifier); | ||
}; | ||
/** | ||
* Retrieves the service with given name or type from the service container. | ||
@@ -29,0 +36,0 @@ * Optionally, parameters can be passed in case if instance is initialized in the container for the first time. |
@@ -20,2 +20,17 @@ import { ServiceMetadata } from "./types/ServiceMetadata"; | ||
/** | ||
* Checks if the service with given name or type is registered service container. | ||
* Optionally, parameters can be passed in case if instance is initialized in the container for the first time. | ||
*/ | ||
has<T>(type: ObjectType<T>): boolean; | ||
/** | ||
* Checks if the service with given name or type is registered service container. | ||
* Optionally, parameters can be passed in case if instance is initialized in the container for the first time. | ||
*/ | ||
has<T>(id: string): boolean; | ||
/** | ||
* Checks if the service with given name or type is registered service container. | ||
* Optionally, parameters can be passed in case if instance is initialized in the container for the first time. | ||
*/ | ||
has<T>(id: Token<T>): boolean; | ||
/** | ||
* Retrieves the service with given name or type from the service container. | ||
@@ -22,0 +37,0 @@ * Optionally, parameters can be passed in case if instance is initialized in the container for the first time. |
@@ -26,2 +26,9 @@ "use strict"; | ||
/** | ||
* Checks if the service with given name or type is registered service container. | ||
* Optionally, parameters can be passed in case if instance is initialized in the container for the first time. | ||
*/ | ||
ContainerInstance.prototype.has = function (identifier) { | ||
return !!this.findService(identifier); | ||
}; | ||
/** | ||
* Retrieves the service with given name or type from the service container. | ||
@@ -28,0 +35,0 @@ * Optionally, parameters can be passed in case if instance is initialized in the container for the first time. |
{ | ||
"name": "typedi", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Dependency injection for TypeScript", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
# TypeDI | ||
[![Build Status](https://travis-ci.org/pleerock/typedi.svg?branch=master)](https://travis-ci.org/pleerock/typedi) | ||
[![Build Status](https://travis-ci.org/typestack/typedi.svg?branch=master)](https://travis-ci.org/typestack/typedi) | ||
[![npm version](https://badge.fury.io/js/typedi.svg)](https://badge.fury.io/js/typedi) | ||
[![Dependency Status](https://david-dm.org/pleerock/typedi.svg)](https://david-dm.org/pleerock/typedi) | ||
[![Join the chat at https://gitter.im/pleerock/typedi](https://badges.gitter.im/pleerock/typedi.svg)](https://gitter.im/pleerock/typedi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Dependency Status](https://david-dm.org/typestack/typedi.svg)](https://david-dm.org/typestack/typedi) | ||
[![Join the chat at https://gitter.im/typestack/typedi](https://badges.gitter.im/typestack/typedi.svg)](https://gitter.im/typestack/typedi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
@@ -8,0 +8,0 @@ TypeDI is a [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) tool for TypeScript. |
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
96245
968