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

@artus/injection

Package Overview
Dependencies
Maintainers
7
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@artus/injection - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

2

lib/error.js

@@ -59,3 +59,3 @@ "use strict";

exports.LazyInjectConstructorError = LazyInjectConstructorError;
class ScopeEscapeError extends (0, base_error_1.createErrorClass)('SingletonInjectExecutionError') {
class ScopeEscapeError extends (0, base_error_1.createErrorClass)('ScopeEscapeError') {
constructor(target, propertyOrIndex, classScope, propScope) {

@@ -62,0 +62,0 @@ super(() => {

@@ -7,3 +7,6 @@ import Container from './container';

constructor(ctx: any, parent: ContainerType);
get<T = unknown>(id: Identifier<T>): T;
get<T = unknown>(id: Identifier<T>, options?: {
noThrow?: boolean;
defaultValue?: any;
}): T;
getCtx(): any;

@@ -10,0 +13,0 @@ getHandler(name: string | symbol): HandlerFunction | undefined;

@@ -16,6 +16,9 @@ "use strict";

}
get(id) {
get(id, options = {}) {
var _a;
const md = (_a = this.getDefinition(id)) !== null && _a !== void 0 ? _a : this.parent.getDefinition(id);
if (!md) {
if (options.noThrow) {
return options.defaultValue;
}
throw new error_1.NotFoundError(id);

@@ -22,0 +25,0 @@ }

@@ -52,3 +52,6 @@ export declare type Constructable<T = unknown> = new (...args: any[]) => T;

export interface ContainerType {
get<T>(id: Identifier<T>): T;
get<T>(id: Identifier<T>, options?: {
noThrow?: boolean;
defaultValue?: any;
}): T;
set(options: Partial<InjectableDefinition>): this;

@@ -55,0 +58,0 @@ getDefinition(id: Identifier): InjectableMetadata | undefined;

{
"name": "@artus/injection",
"version": "0.5.0",
"version": "0.5.1",
"description": "A IoC Implemention for Artus.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

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