Socket
Socket
Sign inDemoInstall

awilix

Package Overview
Dependencies
23
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.0.0 to 8.0.1

75

lib/awilix.browser.js

@@ -49,3 +49,3 @@ /******************************************************************************

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -927,18 +927,21 @@ if (y = 0, t) op = [op[0] & 2, t.value];

return function iterateRegistrationsAndLocals() {
var _a, _b, _i, prop, _c, _d, _e, prop;
return __generator(this, function (_f) {
switch (_f.label) {
var _a, _b, _c, _i, prop, _d, _e, _f, _g, prop;
return __generator(this, function (_h) {
switch (_h.label) {
case 0:
_a = [];
for (_b in container.cradle)
_a.push(_b);
_a = container.cradle;
_b = [];
for (_c in _a)
_b.push(_c);
_i = 0;
_f.label = 1;
_h.label = 1;
case 1:
if (!(_i < _a.length)) return [3 /*break*/, 4];
prop = _a[_i];
if (!(_i < _b.length)) return [3 /*break*/, 4];
_c = _b[_i];
if (!(_c in _a)) return [3 /*break*/, 3];
prop = _c;
return [4 /*yield*/, prop];
case 2:
_f.sent();
_f.label = 3;
_h.sent();
_h.label = 3;
case 3:

@@ -948,16 +951,19 @@ _i++;

case 4:
_c = [];
for (_d in locals)
_c.push(_d);
_e = 0;
_f.label = 5;
_d = locals;
_e = [];
for (_f in _d)
_e.push(_f);
_g = 0;
_h.label = 5;
case 5:
if (!(_e < _c.length)) return [3 /*break*/, 8];
prop = _c[_e];
if (!(_g < _e.length)) return [3 /*break*/, 8];
_f = _e[_g];
if (!(_f in _d)) return [3 /*break*/, 7];
prop = _f;
return [4 /*yield*/, prop];
case 6:
_f.sent();
_f.label = 7;
_h.sent();
_h.label = 7;
case 7:
_e++;
_g++;
return [3 /*break*/, 5];

@@ -1216,19 +1222,22 @@ case 8: return [2 /*return*/];

function cradleIterator() {
var registrations, _a, _b, _i, registrationName;
return __generator(this, function (_c) {
switch (_c.label) {
var registrations, _a, _b, _c, _i, registrationName;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
registrations = rollUpRegistrations();
_a = [];
for (_b in registrations)
_a.push(_b);
_a = registrations;
_b = [];
for (_c in _a)
_b.push(_c);
_i = 0;
_c.label = 1;
_d.label = 1;
case 1:
if (!(_i < _a.length)) return [3 /*break*/, 4];
registrationName = _a[_i];
if (!(_i < _b.length)) return [3 /*break*/, 4];
_c = _b[_i];
if (!(_c in _a)) return [3 /*break*/, 3];
registrationName = _c;
return [4 /*yield*/, registrationName];
case 2:
_c.sent();
_c.label = 3;
_d.sent();
_d.label = 3;
case 3:

@@ -1235,0 +1244,0 @@ _i++;

@@ -55,3 +55,3 @@ (function (global, factory) {

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -933,18 +933,21 @@ if (y = 0, t) op = [op[0] & 2, t.value];

return function iterateRegistrationsAndLocals() {
var _a, _b, _i, prop, _c, _d, _e, prop;
return __generator(this, function (_f) {
switch (_f.label) {
var _a, _b, _c, _i, prop, _d, _e, _f, _g, prop;
return __generator(this, function (_h) {
switch (_h.label) {
case 0:
_a = [];
for (_b in container.cradle)
_a.push(_b);
_a = container.cradle;
_b = [];
for (_c in _a)
_b.push(_c);
_i = 0;
_f.label = 1;
_h.label = 1;
case 1:
if (!(_i < _a.length)) return [3 /*break*/, 4];
prop = _a[_i];
if (!(_i < _b.length)) return [3 /*break*/, 4];
_c = _b[_i];
if (!(_c in _a)) return [3 /*break*/, 3];
prop = _c;
return [4 /*yield*/, prop];
case 2:
_f.sent();
_f.label = 3;
_h.sent();
_h.label = 3;
case 3:

@@ -954,16 +957,19 @@ _i++;

case 4:
_c = [];
for (_d in locals)
_c.push(_d);
_e = 0;
_f.label = 5;
_d = locals;
_e = [];
for (_f in _d)
_e.push(_f);
_g = 0;
_h.label = 5;
case 5:
if (!(_e < _c.length)) return [3 /*break*/, 8];
prop = _c[_e];
if (!(_g < _e.length)) return [3 /*break*/, 8];
_f = _e[_g];
if (!(_f in _d)) return [3 /*break*/, 7];
prop = _f;
return [4 /*yield*/, prop];
case 6:
_f.sent();
_f.label = 7;
_h.sent();
_h.label = 7;
case 7:
_e++;
_g++;
return [3 /*break*/, 5];

@@ -1222,19 +1228,22 @@ case 8: return [2 /*return*/];

function cradleIterator() {
var registrations, _a, _b, _i, registrationName;
return __generator(this, function (_c) {
switch (_c.label) {
var registrations, _a, _b, _c, _i, registrationName;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
registrations = rollUpRegistrations();
_a = [];
for (_b in registrations)
_a.push(_b);
_a = registrations;
_b = [];
for (_c in _a)
_b.push(_c);
_i = 0;
_c.label = 1;
_d.label = 1;
case 1:
if (!(_i < _a.length)) return [3 /*break*/, 4];
registrationName = _a[_i];
if (!(_i < _b.length)) return [3 /*break*/, 4];
_c = _b[_i];
if (!(_c in _a)) return [3 /*break*/, 3];
registrationName = _c;
return [4 /*yield*/, registrationName];
case 2:
_c.sent();
_c.label = 3;
_d.sent();
_d.label = 3;
case 3:

@@ -1241,0 +1250,0 @@ _i++;

@@ -140,3 +140,3 @@ import { GlobWithOptions } from './list-modules';

*/
export declare type NameAndRegistrationPair<T> = {
export type NameAndRegistrationPair<T> = {
[U in keyof T]?: Resolver<T[U]>;

@@ -147,7 +147,7 @@ };

*/
export declare type FunctionReturning<T> = (...args: Array<any>) => T;
export type FunctionReturning<T> = (...args: Array<any>) => T;
/**
* A class or function returning T.
*/
export declare type ClassOrFunctionReturning<T> = FunctionReturning<T> | Constructor<T>;
export type ClassOrFunctionReturning<T> = FunctionReturning<T> | Constructor<T>;
/**

@@ -163,3 +163,3 @@ * The options for the createContainer function.

*/
export declare type RegistrationHash = Record<string | symbol | number, Resolver<any>>;
export type RegistrationHash = Record<string | symbol | number, Resolver<any>>;
/**

@@ -166,0 +166,0 @@ * Resolution stack.

/**
* Token type.
*/
export declare type TokenType = 'ident' | '(' | ')' | ',' | '=' | '*' | 'function' | 'class' | 'EOF';
export type TokenType = 'ident' | '(' | ')' | ',' | '=' | '*' | 'function' | 'class' | 'EOF';
/**

@@ -6,0 +6,0 @@ * Lexer Token.

/**
* Injection mode type.
*/
export declare type InjectionModeType = 'PROXY' | 'CLASSIC';
export type InjectionModeType = 'PROXY' | 'CLASSIC';
/**

@@ -6,0 +6,0 @@ * Resolution modes.

/**
* Lifetime type.
*/
export declare type LifetimeType = 'SINGLETON' | 'TRANSIENT' | 'SCOPED';
export type LifetimeType = 'SINGLETON' | 'TRANSIENT' | 'SCOPED';
/**

@@ -6,0 +6,0 @@ * Lifetime types.

@@ -25,3 +25,3 @@ import * as glob from 'fast-glob';

*/
export declare type GlobWithOptions = [string] | [string, BuildResolverOptions<any> | LifetimeType];
export type GlobWithOptions = [string] | [string, BuildResolverOptions<any> | LifetimeType];
/**

@@ -28,0 +28,0 @@ * Returns a list of {name, path} pairs,

@@ -25,3 +25,3 @@ import { ModuleDescriptor, GlobWithOptions, listModules } from './list-modules';

*/
export declare type BuiltInNameFormatters = 'camelCase';
export type BuiltInNameFormatters = 'camelCase';
/**

@@ -35,3 +35,3 @@ * Takes in the filename of the module being loaded as well as the module descriptor,

*/
export declare type NameFormatter = (name: string, descriptor: LoadedModuleDescriptor) => string;
export type NameFormatter = (name: string, descriptor: LoadedModuleDescriptor) => string;
/**

@@ -38,0 +38,0 @@ * Dependencies for `loadModules`

@@ -16,3 +16,3 @@ import { LifetimeType } from './lifetime';

*/
export declare type InjectorFunction = <T extends object>(container: AwilixContainer<T>) => object;
export type InjectorFunction = <T extends object>(container: AwilixContainer<T>) => object;
/**

@@ -54,3 +54,3 @@ * A resolver object returned by asClass(), asFunction() or asValue().

*/
export declare type Disposer<T> = (value: T) => any | Promise<any>;
export type Disposer<T> = (value: T) => any | Promise<any>;
/**

@@ -95,3 +95,3 @@ * The options when registering a class, function or value.

*/
export declare type Constructor<T> = {
export type Constructor<T> = {
new (...args: any[]): T;

@@ -98,0 +98,0 @@ };

{
"name": "awilix",
"version": "8.0.0",
"version": "8.0.1",
"description": "Extremely powerful dependency injection container.",

@@ -21,3 +21,2 @@ "main": "lib/awilix.js",

"cover": "npm run test -- --coverage",
"coveralls": "npm run cover && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"publish:pre": "npm run lint && npm run build && npm run cover",

@@ -54,17 +53,16 @@ "publish:post": "npm publish && git push --follow-tags",

"devDependencies": {
"@babel/core": "^7.19.3",
"@babel/plugin-transform-runtime": "^7.19.1",
"@babel/preset-env": "^7.19.4",
"@babel/runtime": "^7.19.4",
"@types/jest": "^29.1.2",
"@types/node": "^18.8.5",
"babel-jest": "^29.2.0",
"coveralls": "^3.1.1",
"husky": "^8.0.1",
"@babel/core": "^7.21.4",
"@babel/plugin-transform-runtime": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"@babel/runtime": "^7.21.0",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"babel-jest": "^29.5.0",
"husky": "^8.0.3",
"istanbul": "^0.4.5",
"jest": "^29.2.0",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"rollup": "^3.1.0",
"jest": "^29.5.0",
"lint-staged": "^13.2.0",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"rollup": "^3.20.2",
"rollup-plugin-commonjs": "^10.1.0",

@@ -76,8 +74,8 @@ "rollup-plugin-copy": "^3.4.0",

"smid": "^0.1.1",
"ts-jest": "^29.0.3",
"tslib": "^2.4.0",
"ts-jest": "^29.1.0",
"tslib": "^2.5.0",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-config-standard": "^9.0.0",
"typescript": "^4.8.4"
"typescript": "^5.0.3"
},

@@ -84,0 +82,0 @@ "dependencies": {

# Awilix
[![Join the chat at https://gitter.im/awilix/Lobby](https://badges.gitter.im/awilix/Lobby.svg)](https://gitter.im/awilix/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![npm](https://img.shields.io/npm/v/awilix.svg?maxAge=1000)](https://www.npmjs.com/package/awilix)
[![dependency Status](https://img.shields.io/david/jeffijoe/awilix.svg?maxAge=1000)](https://david-dm.org/jeffijoe/awilix)
[![devDependency Status](https://img.shields.io/david/dev/jeffijoe/awilix.svg?maxAge=1000)](https://david-dm.org/jeffijoe/awilix)
[![Build Status](https://img.shields.io/travis/jeffijoe/awilix.svg?maxAge=1000)](https://travis-ci.org/jeffijoe/awilix)
[![CI](https://github.com/jeffijoe/awilix/actions/workflows/ci.yml/badge.svg)](https://github.com/jeffijoe/awilix/actions/workflows/ci.yml)
[![Coveralls](https://img.shields.io/coveralls/jeffijoe/awilix.svg?maxAge=1000)](https://coveralls.io/github/jeffijoe/awilix)

@@ -549,3 +546,3 @@ [![npm](https://img.shields.io/npm/dt/awilix.svg?maxAge=1000)](https://www.npmjs.com/package/awilix)

// instead of guessing. If omitted, will inspect the
// module to determinw what to register as.
// module to determine what to register as.
register: awilix.asClass

@@ -552,0 +549,0 @@ }

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc