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

@spinajs/reflection

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

@spinajs/reflection - npm Package Compare versions

Comparing version 1.2.211 to 2.0.12

52

lib/index.js

@@ -166,30 +166,34 @@ "use strict";

.flatMap((d) => glob.sync(path.join(d, filter)))
.map((f) => {
.flatMap((f) => {
logger.trace(`Loading file ${f}`);
const name = path.parse(f).name;
const nameToResolve = typeMatcher ? typeMatcher(name) : name;
/* eslint-disable */
const type = require(f)[`${nameToResolve}`];
if (!type) {
throw new ReflectionException(`cannot find class ${nameToResolve} in file ${f}`);
}
if (resolve) {
if (type.prototype instanceof di_1.AsyncModule) {
promised = true;
return di_1.DI.resolve(type).then((instance) => {
return {
file: f,
instance,
name: nameToResolve,
type,
};
});
const fTypes = require(f);
const types = [];
for (const key of Object.keys(fTypes)) {
const nameToResolve = typeMatcher ? typeMatcher(path.parse(f).name, key) : key;
const type = fTypes[`${nameToResolve}`];
if (resolve) {
if (type.prototype instanceof di_1.AsyncModule) {
promised = true;
return di_1.DI.resolve(type).then((instance) => {
return {
file: f,
instance,
name: nameToResolve,
type,
};
});
}
}
types.push({
file: f,
instance: resolve ? di_1.DI.resolve(type) : null,
name: nameToResolve,
type,
});
}
return {
file: f,
instance: resolve ? di_1.DI.resolve(type) : null,
name: nameToResolve,
type,
};
if (types.length === 0) {
throw new ReflectionException(`cannot find any exported class in file ${f}`);
}
return types;
});

@@ -196,0 +200,0 @@ return promised && resolve ? Promise.all(result) : result;

{
"name": "@spinajs/reflection",
"version": "1.2.211",
"version": "2.0.12",
"description": "SpinaJS reflection helpers",

@@ -32,10 +32,14 @@ "main": "lib/index.js",

"dependencies": {
"@spinajs/configuration": "^1.2.211",
"@spinajs/di": "^1.2.211",
"@spinajs/exceptions": "^1.2.127",
"@spinajs/log": "^1.2.211",
"@spinajs/configuration": "^2.0.12",
"@spinajs/di": "^2.0.12",
"@spinajs/exceptions": "^2.0.12",
"@spinajs/log": "^2.0.12",
"lodash": "^4.17.21",
"typescript": "^4.7.4",
"typescript-mix": "^3.1.3"
},
"gitHead": "70d07e9437552855ac6c986465929a31ee49f5c3"
"devDependencies": {
"@types/node": "^18.0.4"
},
"gitHead": "d7910d799995df6fa9eb8174d4a9b65c81db8352"
}

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