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

errorex

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

errorex - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

30

lib/errorex.js

@@ -11,2 +11,3 @@ /* errorex

const path = require('path');
const merge = require('putil-merge');
const StackFrame = require('stackframe');

@@ -29,10 +30,7 @@

if (msg instanceof Error) {
super(msg.message);
for (const key of Object.keys(msg))
if (['name', 'stack'].indexOf(key) < 0)
this[key] = msg[key];
super();
this.set(msg);
this.stack = ErrorEx._mergeStack(msg.stack, this.stack);
} else
super(msg && format(msg, ...args));
this.name = this.constructor === ErrorEx ? 'Error' : this.constructor.name;
}

@@ -42,2 +40,10 @@

*
* @return {string}
*/
get name() {
return this.constructor === ErrorEx ? 'Error' : this.constructor.name;
}
/**
*
* @param {Boolean} [noInternal=false]

@@ -69,3 +75,8 @@ * @return {Array|*}

if (!this._stackFrames)
this._stackFrames = ErrorEx.parseStack(this.getStack(noInternal));
Object.defineProperty(this, '_stackFrames', {
enumerable: false,
writable: true,
configurable: true,
value: ErrorEx.parseStack(this.getStack(noInternal))
});
return this._stackFrames;

@@ -83,5 +94,6 @@ }

if (typeof property === 'object') {
for (const k of Object.keys(property)) {
this[k] = property[k];
}
merge(this, property, {
adjunct: true, descriptor: true,
filter: (_, n) => !['name', 'stack'].includes(n)
});
} else

@@ -88,0 +100,0 @@ this[property] = value;

{
"name": "errorex",
"description": "'Extensible Error Class' implementation and predefined additional error types for javascript",
"version": "2.0.3",
"version": "2.1.0",
"author": "Panates Ltd.",

@@ -19,2 +19,3 @@ "contributors": [

"dependencies": {
"putil-merge": "^3.2.0",
"stackframe": "^1.0.4"

@@ -24,6 +25,6 @@ },

"babel-eslint": "^10.0.1",
"eslint": "^5.6.1",
"eslint": "^5.12.1",
"eslint-config-google": "^0.10.0",
"nyc": "^13.0.1",
"mocha": "^5.2.0"
"mocha": "^5.2.0",
"nyc": "^13.1.0"
},

@@ -42,3 +43,3 @@ "engines": {

"nyc": {
"temp-directory": "./coverage/.nyc_output"
"temp-dir": "./coverage/.nyc_output"
},

@@ -45,0 +46,0 @@ "scripts": {

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