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

@furystack/inject

Package Overview
Dependencies
Maintainers
1
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@furystack/inject - npm Package Compare versions

Comparing version 4.0.74 to 4.0.75

6

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./injectable"), exports);
tslib_1.__exportStar(require("./injector"), exports);
tslib_1.__exportStar(require("./types"), exports);
(0, tslib_1.__exportStar)(require("./injectable"), exports);
(0, tslib_1.__exportStar)(require("./injector"), exports);
(0, tslib_1.__exportStar)(require("./types"), exports);
//# sourceMappingURL=index.js.map

@@ -10,4 +10,4 @@ "use strict";

};
Alma = tslib_1.__decorate([
injectable_1.Injectable()
Alma = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)()
], Alma);

@@ -28,5 +28,5 @@ const a = new Alma();

};
Alma2 = tslib_1.__decorate([
injectable_1.Injectable(),
tslib_1.__metadata("design:paramtypes", [Service])
Alma2 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)(),
(0, tslib_1.__metadata)("design:paramtypes", [Service])
], Alma2);

@@ -33,0 +33,0 @@ const a = new Alma2(null);

@@ -25,5 +25,5 @@ "use strict";

};
InstanceClass = tslib_1.__decorate([
injectable_1.Injectable(),
tslib_1.__metadata("design:paramtypes", [InstanceClass])
InstanceClass = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)(),
(0, tslib_1.__metadata)("design:paramtypes", [InstanceClass])
], InstanceClass);

@@ -36,4 +36,4 @@ expect(() => i.getInstance(InstanceClass)).toThrow();

};
InstanceClass = tslib_1.__decorate([
injectable_1.Injectable({ lifetime: 'scoped' })
InstanceClass = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)({ lifetime: 'scoped' })
], InstanceClass);

@@ -45,3 +45,3 @@ const instance = new InstanceClass();

it('Should throw an error when setting an Injector instance', () => {
utils_1.using(new injector_1.Injector(), (i) => {
(0, utils_1.using)(new injector_1.Injector(), (i) => {
expect(() => i.setExplicitInstance(new injector_1.Injector())).toThrowError('Cannot set an injector instance as injectable');

@@ -55,4 +55,4 @@ });

};
InstanceClass = tslib_1.__decorate([
injectable_1.Injectable({ lifetime: 'singleton' })
InstanceClass = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)({ lifetime: 'singleton' })
], InstanceClass);

@@ -70,4 +70,4 @@ const instance = new InstanceClass();

};
InstanceClass = tslib_1.__decorate([
injectable_1.Injectable({ lifetime: 'singleton' })
InstanceClass = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)({ lifetime: 'singleton' })
], InstanceClass);

@@ -83,9 +83,9 @@ expect(i.getInstance(InstanceClass)).toBeInstanceOf(InstanceClass);

};
Injected1 = tslib_1.__decorate([
injectable_1.Injectable()
Injected1 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)()
], Injected1);
let Injected2 = class Injected2 {
};
Injected2 = tslib_1.__decorate([
injectable_1.Injectable()
Injected2 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)()
], Injected2);

@@ -99,5 +99,5 @@ let InstanceClass = class InstanceClass {

};
InstanceClass = tslib_1.__decorate([
injectable_1.Injectable(),
tslib_1.__metadata("design:paramtypes", [Injected1, Injected2])
InstanceClass = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)(),
(0, tslib_1.__metadata)("design:paramtypes", [Injected1, Injected2])
], InstanceClass);

@@ -112,4 +112,4 @@ expect(i.getInstance(InstanceClass)).toBeInstanceOf(InstanceClass);

};
Injected1 = tslib_1.__decorate([
injectable_1.Injectable()
Injected1 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)()
], Injected1);

@@ -121,5 +121,5 @@ let Injected2 = class Injected2 {

};
Injected2 = tslib_1.__decorate([
injectable_1.Injectable(),
tslib_1.__metadata("design:paramtypes", [Injected1])
Injected2 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)(),
(0, tslib_1.__metadata)("design:paramtypes", [Injected1])
], Injected2);

@@ -132,5 +132,5 @@ let InstanceClass = class InstanceClass {

};
InstanceClass = tslib_1.__decorate([
injectable_1.Injectable(),
tslib_1.__metadata("design:paramtypes", [Injected2])
InstanceClass = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)(),
(0, tslib_1.__metadata)("design:paramtypes", [Injected2])
], InstanceClass);

@@ -141,3 +141,3 @@ expect(i.getInstance(InstanceClass)).toBeInstanceOf(InstanceClass);

it('Should be disposed', async () => {
await utils_1.usingAsync(new injector_1.Injector(), async () => {
await (0, utils_1.usingAsync)(new injector_1.Injector(), async () => {
/** */

@@ -154,3 +154,3 @@ });

}
utils_1.usingAsync(new injector_1.Injector(), async (i) => {
(0, utils_1.usingAsync)(new injector_1.Injector(), async (i) => {
i.setExplicitInstance(new TestDisposable());

@@ -161,3 +161,3 @@ i.setExplicitInstance(new TestInstance());

it('Remove should remove an entity from the cached singletons list', () => {
utils_1.using(new injector_1.Injector(), (i) => {
(0, utils_1.using)(new injector_1.Injector(), (i) => {
i.setExplicitInstance({}, Object);

@@ -170,3 +170,3 @@ i.remove(Object);

it('Requesting an Injector instance should return self', () => {
utils_1.using(new injector_1.Injector(), (i) => {
(0, utils_1.using)(new injector_1.Injector(), (i) => {
expect(i.getInstance(injector_1.Injector)).toBe(i);

@@ -178,3 +178,3 @@ });

}
utils_1.using(new injector_1.Injector(), (i) => {
(0, utils_1.using)(new injector_1.Injector(), (i) => {
expect(() => i.getInstance(UndecoratedTestClass, [injector_1.Injector])).toThrowError(`No metadata found for 'UndecoratedTestClass'. Dependencies: Injector. Be sure that it's decorated with '@Injectable()' or added explicitly with SetInstance()`);

@@ -186,4 +186,4 @@ });

};
Trs1 = tslib_1.__decorate([
injectable_1.Injectable({ lifetime: 'transient' })
Trs1 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)({ lifetime: 'transient' })
], Trs1);

@@ -195,7 +195,7 @@ let St1 = class St1 {

};
St1 = tslib_1.__decorate([
injectable_1.Injectable({ lifetime: 'singleton' }),
tslib_1.__metadata("design:paramtypes", [Trs1])
St1 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)({ lifetime: 'singleton' }),
(0, tslib_1.__metadata)("design:paramtypes", [Trs1])
], St1);
utils_1.using(new injector_1.Injector(), (i) => {
(0, utils_1.using)(new injector_1.Injector(), (i) => {
expect(() => i.getInstance(St1)).toThrowError(`Injector error: Singleton type 'St1' depends on non-singleton injectables: Trs1:transient`);

@@ -207,4 +207,4 @@ });

};
Sc1 = tslib_1.__decorate([
injectable_1.Injectable({ lifetime: 'scoped' })
Sc1 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)({ lifetime: 'scoped' })
], Sc1);

@@ -216,7 +216,7 @@ let St2 = class St2 {

};
St2 = tslib_1.__decorate([
injectable_1.Injectable({ lifetime: 'singleton' }),
tslib_1.__metadata("design:paramtypes", [Sc1])
St2 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)({ lifetime: 'singleton' }),
(0, tslib_1.__metadata)("design:paramtypes", [Sc1])
], St2);
utils_1.using(new injector_1.Injector(), (i) => {
(0, utils_1.using)(new injector_1.Injector(), (i) => {
expect(() => i.getInstance(St2)).toThrowError(`Injector error: Singleton type 'St2' depends on non-singleton injectables: Sc1:scoped`);

@@ -228,4 +228,4 @@ });

};
Tr2 = tslib_1.__decorate([
injectable_1.Injectable({ lifetime: 'transient' })
Tr2 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)({ lifetime: 'transient' })
], Tr2);

@@ -237,7 +237,7 @@ let Sc2 = class Sc2 {

};
Sc2 = tslib_1.__decorate([
injectable_1.Injectable({ lifetime: 'scoped' }),
tslib_1.__metadata("design:paramtypes", [Tr2])
Sc2 = (0, tslib_1.__decorate)([
(0, injectable_1.Injectable)({ lifetime: 'scoped' }),
(0, tslib_1.__metadata)("design:paramtypes", [Tr2])
], Sc2);
utils_1.using(new injector_1.Injector(), (i) => {
(0, utils_1.using)(new injector_1.Injector(), (i) => {
expect(() => i.getInstance(Sc2)).toThrowError(`Injector error: Scoped type 'Sc2' depends on transient injectables: Tr2:transient`);

@@ -244,0 +244,0 @@ });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./constructable"), exports);
(0, tslib_1.__exportStar)(require("./constructable"), exports);
//# sourceMappingURL=index.js.map
{
"name": "@furystack/inject",
"version": "4.0.74",
"version": "4.0.75",
"description": "Core FuryStack package",

@@ -29,10 +29,10 @@ "main": "dist/index.js",

"dependencies": {
"@furystack/utils": "^1.2.44",
"@furystack/utils": "^1.2.45",
"tslib": "^2.3.1"
},
"devDependencies": {
"@types/jest": "^27.0.1"
"@types/jest": "^27.0.2"
},
"typings": "./dist/index.d.ts",
"gitHead": "87ae118b3b7bb2eb04e539320749d0e35a0ae7e6"
"gitHead": "963fefda256700fba2f230538653573e4fb7b64d"
}

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