Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typedi

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedi - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

5

decorators/Inject.d.ts

@@ -0,1 +1,2 @@

import { Token } from "../Token";
/**

@@ -9,1 +10,5 @@ * Injects a service into a class property or constructor parameter.

export declare function Inject(serviceName?: string): Function;
/**
* Injects a service into a class property or constructor parameter.
*/
export declare function Inject(token: Token<any>): Function;

15

decorators/Inject.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Container_1 = require("../Container");
var Token_1 = require("../Token");
/**

@@ -15,3 +16,15 @@ * Injects a service into a class property or constructor parameter.

index: index,
value: function () { return Container_1.Container.get(typeof typeOrName === "string" ? typeOrName : typeOrName()); }
value: function () {
var identifier;
if (typeof typeOrName === "string") {
identifier = typeOrName;
}
else if (typeOrName instanceof Token_1.Token) {
identifier = typeOrName;
}
else {
identifier = typeOrName();
}
return Container_1.Container.get(identifier);
}
});

@@ -18,0 +31,0 @@ };

2

package.json
{
"name": "typedi",
"version": "0.5.1",
"version": "0.5.2",
"description": "Dependency injection for TypeScript",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc