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

@travetto/di

Package Overview
Dependencies
Maintainers
1
Versions
313
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/di - npm Package Compare versions

Comparing version 0.0.18 to 0.0.19

2

package.json

@@ -24,3 +24,3 @@ {

},
"version": "0.0.18"
"version": "0.0.19"
}

@@ -48,7 +48,7 @@ import { Injectable, Inject, InjectableFactory } from '../src';

export const CUSTOM_SERVICE_INHERIT = Symbol('Custom');
export const CUSTOM_DATABSE = Symbol('CUSTOM DB');
export const CUSTOM_DATABASE = Symbol('CUSTOM DB');
export const CUSTOM_EMPTY = Symbol('Custom EMPTY');
class TestConfig {
@InjectableFactory({ qualifier: CUSTOM_EMPTY, class: DbConfig })
@InjectableFactory(CUSTOM_EMPTY)
static getNewDb(): DbConfig<any, any> {

@@ -74,3 +74,3 @@ const out = new DbConfig();

@InjectableFactory(CUSTOM_DATABSE)
@InjectableFactory(CUSTOM_DATABASE)
static getCustomDB(config: DbConfig<any, any>, @Inject(CUSTOM_EMPTY) empty: Empty): Database {

@@ -77,0 +77,0 @@ console.log('Custom EMPTY 2', empty);

import { DependencyRegistry } from '../src/service';
import { ServiceInherit, SERVICE_INHERIT_2, CUSTOM_SERVICE_INHERIT, CUSTOM_DATABSE, Database, CUSTOM_EMPTY } from './deps';
import { ServiceInherit, SERVICE_INHERIT_2, CUSTOM_SERVICE_INHERIT, CUSTOM_DATABASE, Database, CUSTOM_EMPTY } from './deps';
import { Suite, Test, BeforeEach } from '@travetto/test';

@@ -84,5 +84,5 @@ import * as assert from 'assert';

assert(inst.age === 12);
assert(inst.age === 11);
assert(inst.db.dbConfig === undefined);
// assert(inst.db.dbConfig === undefined);

@@ -99,3 +99,3 @@ assert(inst.db.dbConfig);

const inst = await DependencyRegistry.getInstance(Database, CUSTOM_DATABSE);
const inst = await DependencyRegistry.getInstance(Database, CUSTOM_DATABASE);

@@ -102,0 +102,0 @@ assert(inst);

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