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

@dits/dits

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dits/dits - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

6

lib/di/components.d.ts
import Container from "./container";
import SmartProxy from "./proxy";
export interface Constructor<E> {
export declare type Constructor<E> = {
new (...args: any[]): E;
}
} | (Function & {
prototype: E;
});
export interface ComponentDeclaration<T> {

@@ -7,0 +9,0 @@ instance?: T;

@@ -113,3 +113,4 @@ "use strict";

try {
cd.instance = new cd.type(...cd.dependencies);
const type = cd.type;
cd.instance = new type(...cd.dependencies);
}

@@ -116,0 +117,0 @@ catch (err) {

import { ComponentRegistry, ComponentDeclaration } from "./components";
import { HandlerRegistry } from "../dispatch/handlers";
import { DispatchEvent, EventConstructor, HandlerDeclaration } from "../dispatch/dispatch";
declare type ConstructorOrAbstractConstructor<T> = {
new (...args: any[]): T;
} | (Function & {
prototype: T;
});
export default class Container {

@@ -13,14 +18,6 @@ name: string;

static fromZone(): Container;
get<T, C extends {
new (...args: any[]): T;
}>(key: C): T | undefined;
getOrThrow<T, C extends {
new (...args: any[]): T;
}>(key: C, errMessage?: string): T;
provide<T>(key: {
new (...args: any[]): unknown;
}, instance: T, override?: boolean): this;
declare<T>(key: {
new (...args: any[]): unknown;
}, declaration: ComponentDeclaration<T>, override?: boolean): this;
get<T, C extends ConstructorOrAbstractConstructor<T>>(key: C): T | undefined;
getOrThrow<T, C extends ConstructorOrAbstractConstructor<T>>(key: C, errMessage?: string): T;
provide<T>(key: ConstructorOrAbstractConstructor<T>, instance: T, override?: boolean): this;
declare<T>(key: ConstructorOrAbstractConstructor<T>, declaration: ComponentDeclaration<T>, override?: boolean): this;
handler<E extends DispatchEvent>(event: EventConstructor<E>, declaration: HandlerDeclaration<E>): this;

@@ -30,5 +27,6 @@ reset(parent?: Container | Boolean): void;

private getAncestry;
unwrap(): Map<new (...args: any[]) => unknown, unknown>;
unwrap(): Map<ConstructorOrAbstractConstructor<any>, unknown>;
createChild(name: string): Container;
}
export {};
//# sourceMappingURL=container.d.ts.map

@@ -8,6 +8,2 @@ "use strict";

const log = new tslog_1.Logger({ name: __filename });
// /**
// * Keeps track of classes and their instances
// * TODO: make this zone specific?
// */
class Container {

@@ -14,0 +10,0 @@ name;

{
"name": "@dits/dits",
"version": "0.1.7",
"version": "0.1.8",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "types": "lib/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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