New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tanbo/di

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanbo/di - npm Package Compare versions

Comparing version 0.0.32 to 0.0.33

0

bundles/core/annotations.d.ts

@@ -0,0 +0,0 @@ import { Injector } from './injector';

@@ -0,0 +0,0 @@ export class Annotations {

@@ -0,0 +0,0 @@ import { Annotations, ClassDecoratorContextCallback, PropertyDecoratorContextCallback } from './annotations';

@@ -0,0 +0,0 @@ import { Annotations } from './annotations';

@@ -0,0 +0,0 @@ export declare class ForwardRef<T = any> {

@@ -0,0 +0,0 @@ export class ForwardRef {

@@ -0,0 +0,0 @@ export interface Injectable {

@@ -0,0 +0,0 @@ import { makeClassDecorator } from './decorators';

@@ -0,0 +0,0 @@ export declare class InjectionToken<T> {

@@ -0,0 +0,0 @@ export class InjectionToken {

@@ -0,0 +0,0 @@ import { Type } from './type';

@@ -0,0 +0,0 @@ export var InjectFlags;

@@ -0,0 +0,0 @@ import { Type } from './type';

@@ -0,0 +0,0 @@ import { makeParamDecorator, makePropertyDecorator } from './decorators';

@@ -0,0 +0,0 @@ import { Injector } from './injector';

@@ -0,0 +0,0 @@ import { makeInjectError } from './utils/_api';

@@ -0,0 +0,0 @@ import { Type } from './type';

export {};

@@ -0,0 +0,0 @@ import { Provider } from './provider';

@@ -0,0 +0,0 @@ import { InjectFlags, Injector } from './injector';

@@ -0,0 +0,0 @@ import { Provider } from './provider';

12

bundles/core/reflective-provider.js

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

import { InjectFlags } from './injector';
import { Inject, Optional, Self, SkipSelf } from './metadata';

@@ -50,2 +51,8 @@ import { getAnnotations } from './decorators';

return function (...args) {
if (provider.provide !== provider.useClass) {
const cachedInstance = injector.get(provider.useClass, null, InjectFlags.Optional);
if (cachedInstance) {
return cachedInstance;
}
}
const instance = new provider.useClass(...args);

@@ -59,3 +66,6 @@ const propMetadataKeys = getAnnotations(provider.useClass).getPropMetadataKeys();

});
cacheFn(provider.useClass, instance);
cacheFn(provider.provide, instance);
if (provider.provide !== provider.useClass) {
cacheFn(provider.provide, instance);
}
return instance;

@@ -62,0 +72,0 @@ };

@@ -0,0 +0,0 @@ export declare const Type: FunctionConstructor;

export const Type = Function;
export * from './inject-error';
export * from './stringify';
export * from './inject-error';
export * from './stringify';
export declare function makeInjectError(name: string): (token: any) => Error;

@@ -0,0 +0,0 @@ import { stringify } from './stringify';

export declare function stringify(token: any): string;

@@ -0,0 +0,0 @@ export function stringify(token) {

@@ -0,0 +0,0 @@ export * from './core/utils/_api';

@@ -0,0 +0,0 @@ export * from './core/utils/_api';

2

package.json
{
"name": "@tanbo/di",
"version": "0.0.32",
"version": "0.0.33",
"description": "A dependency injection Library",

@@ -5,0 +5,0 @@ "main": "./bundles/public-api.js",

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