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

@artus/core

Package Overview
Dependencies
Maintainers
8
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@artus/core - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4-alpha.0

lib/configuration/decorator.d.ts

24

lib/exception/utils.js

@@ -6,3 +6,2 @@ "use strict";

const impl_1 = require("./impl");
const is_1 = require("../utils/is");
const matchExceptionFilterClazz = (err, container) => {

@@ -15,19 +14,16 @@ const filterMap = container.get(constant_1.EXCEPTION_FILTER_MAP_INJECT_ID, {

}
// handle ArtusStdError with code simply
let targetFilterClazz = null;
if (err instanceof impl_1.ArtusStdError && filterMap.has(err.code)) {
return filterMap.get(err.code);
// handle ArtusStdError with code simply
targetFilterClazz = filterMap.get(err.code);
}
// handle CustomErrorClazz, loop inherit class
let errConstructor = err['constructor'];
while ((0, is_1.isClass)(errConstructor)) { // until parent/self is not class
if (filterMap.has(errConstructor)) {
return filterMap.get(errConstructor);
}
errConstructor = Object.getPrototypeOf(errConstructor); // get parent clazz by prototype
else if (filterMap.has(err['constructor'])) {
// handle CustomErrorClazz
targetFilterClazz = filterMap.get(err['constructor']);
}
// handle default ExceptionFilter
if (filterMap.has(constant_1.EXCEPTION_FILTER_DEFAULT_SYMBOL)) {
return filterMap.get(constant_1.EXCEPTION_FILTER_DEFAULT_SYMBOL);
else if (filterMap.has(constant_1.EXCEPTION_FILTER_DEFAULT_SYMBOL)) {
// handle default ExceptionFilter
targetFilterClazz = filterMap.get(constant_1.EXCEPTION_FILTER_DEFAULT_SYMBOL);
}
return null;
return targetFilterClazz;
};

@@ -34,0 +30,0 @@ exports.matchExceptionFilterClazz = matchExceptionFilterClazz;

@@ -48,12 +48,8 @@ "use strict";

checkDepExisted(pluginMap) {
var _a;
if (!this.metadata.dependencies) {
return;
}
for (let i = 0; i < this.metadata.dependencies.length; i++) {
const { name: pluginName, optional } = this.metadata.dependencies[i];
var _a, _b;
for (const { name: pluginName, optional } of (_a = this.metadata.dependencies) !== null && _a !== void 0 ? _a : []) {
const instance = pluginMap.get(pluginName);
if (!instance || !instance.enable) {
if (optional) {
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.warn(`Plugin ${this.name} need have optional dependency: ${pluginName}.`);
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.warn(`Plugin ${this.name} need have optional dependency: ${pluginName}.`);
}

@@ -64,6 +60,2 @@ else {

}
else {
// Plugin exist and enabled, need calc edge
this.metadata.dependencies[i]._enabled = true;
}
}

@@ -73,3 +65,3 @@ }

var _a, _b, _c;
return (_c = (_b = (_a = this.metadata.dependencies) === null || _a === void 0 ? void 0 : _a.filter(({ optional, _enabled }) => !optional || _enabled)) === null || _b === void 0 ? void 0 : _b.map(({ name: depPluginName }) => [this.name, depPluginName])) !== null && _c !== void 0 ? _c : [];
return (_c = (_b = (_a = this.metadata.dependencies) === null || _a === void 0 ? void 0 : _a.filter(({ optional }) => !optional)) === null || _b === void 0 ? void 0 : _b.map(({ name: depPluginName }) => [this.name, depPluginName])) !== null && _c !== void 0 ? _c : [];
}

@@ -76,0 +68,0 @@ async checkAndLoadMetadata() {

@@ -15,3 +15,2 @@ import { LoggerType } from '../logger';

optional?: boolean;
_enabled?: boolean;
}

@@ -18,0 +17,0 @@ export interface PluginConfigItem {

{
"name": "@artus/core",
"version": "2.0.3",
"version": "2.0.4-alpha.0",
"description": "Core package of Artus",

@@ -5,0 +5,0 @@ "main": "./lib/index.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