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

reactive-di

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactive-di - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

3

dist/core/AnnotationMap.js

@@ -96,3 +96,4 @@ 'use strict';

var annotation /*: Annotation*/ = _extends({}, (raw /*: any*/), {
key: (raw.key || dn) + '_' + this._createId(),
level: raw.level || 0,
strategy: raw.strategy || 'down',
kind: raw.kind,

@@ -99,0 +100,0 @@ displayName: raw.kind + '@' + dn,

@@ -34,3 +34,4 @@ 'use strict';

Provider,
AnnotationMap
AnnotationMap,
InjectorFindStrategy
} from 'reactive-di'*/

@@ -58,11 +59,24 @@

var parents /*: Container[]*/ = this._parentChain = [];
var chain /*: Container[]*/ = this._injectorsChain = [this];
var current /*: ?Container*/ = parent;
while (current) {
parents.push(current);
chain.push(current);
current = current._parent;
}
parents.push(this);
this._revInjectorsChain = [].concat(chain).reverse();
}
DiContainer.prototype._getInjectorStrategy = function _getInjectorStrategy(strategy /*: InjectorFindStrategy*/) {
switch (strategy) {
case 'down':
return this._revInjectorsChain;
case 'up':
return this._injectorsChain;
case 'self':
return [this];
default:
return this._revInjectorsChain;
}
};
DiContainer.prototype._getMiddlewares = function _getMiddlewares(target /*: DependencyKey*/, tags /*: Array<Tag>*/) {

@@ -186,3 +200,3 @@ var middlewares = this._middlewares;

DiContainer.prototype.getProvider = function getProvider(key /*: DependencyKey*/) {
DiContainer.prototype.getProvider = function getProvider(key /*: DependencyKey*/, injectorsChain /*: Container[]*/) {
var provider /*: ?Provider*/ = this._providerCache.get(key);

@@ -195,7 +209,6 @@ if (provider) {

}
var container /*: Container*/ = this;
var annotation /*: ?Annotation*/ = null;
var chain /*: Container[]*/ = this._parentChain;
for (var i = 0, l = chain.length; i < l; i++) {
var annotation /*: ?Annotation*/ = void 0;
var chain /*: Container[]*/ = injectorsChain || this._revInjectorsChain;
for (var i = 0, l = chain.length; i < l && !annotation; i++) {
container = chain[i];

@@ -202,0 +215,0 @@ annotation = container._annotations.get(key);

@@ -23,5 +23,7 @@ /* @flow */

}
declare type InjectorFindStrategy = 'up' | 'down' | 'self'
declare interface RawAnnotation {
kind: any;
level?: number;
strategy?: InjectorFindStrategy;
tags?: Array<Tag>;

@@ -38,2 +40,4 @@ deps?: Array<DepItem>;

displayName: string;
level: number;
strategy: InjectorFindStrategy;
tags: Array<Tag>;

@@ -40,0 +44,0 @@ target: Dependency;

{
"name": "reactive-di",
"version": "1.2.1",
"version": "1.2.2",
"description": "Reactive dependency injection",

@@ -5,0 +5,0 @@ "publishConfig": {

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