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

ioc-service-container

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ioc-service-container - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

Changelog.md

2

dist/decorators.d.ts

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

export declare const inject: (target: any, key: string) => void;
export declare const inject: (target: Object, propertyKey: string) => void;
import ServiceContainer from './ServiceContainer';
export const inject = (target, key) => {
export const inject = (target, propertyKey) => {
// todo further improvements set key as string not via name
// https://dev.to/danywalls/using-property-decorators-in-typescript-with-a-real-example-44e
const getter = () => {
return ServiceContainer.get(key.toLocaleLowerCase());
return ServiceContainer.get(propertyKey.toLowerCase());
};
// @ts-ignore
if (delete this[key]) {
Object.defineProperty(target, key, {
get: getter,
set: undefined,
enumerable: true,
configurable: true
});
}
const setter = () => {
throw new Error(`Injected property [${propertyKey}] can't be reset`);
};
Object.defineProperty(target, propertyKey, {
get: getter,
set: setter
});
};
{
"name": "ioc-service-container",
"version": "0.1.2",
"version": "0.1.3",
"description": "Lightweight ioc service container",

@@ -21,6 +21,11 @@ "main": "dist/index.js",

},
"files": [
"dist/*",
"README.md",
"Changelog.md"
],
"repository": {
"type": "git",
"url": "git@gitlab.com:smscr/ja-container.git"
"url": "https://github.com/mrcwbr/ioc-service-container"
}
}

@@ -8,2 +8,7 @@ # ioc-service-container

## Get started
Install the dependency with `npm install ioc-service-container
`
## Background

@@ -10,0 +15,0 @@

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