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.3.0 to 2.3.1

41

lib/errorex.js

@@ -52,17 +52,3 @@ /* errorex

getStack(options) {
if (options) {
const a1 = this.stack.split(/\n/);
const result = [];
for (let line of a1) {
const m = line.match(/[^(]\(([^:(]*)/);
if (m && path.isAbsolute(m[1]) &&
!m[1].includes(path.sep + 'node_modules')) {
if (options.relativeTo)
line = line.replace(m[1], path.relative(options.relativeTo, m[1]));
result.push(line);
}
}
return result.join('\n');
}
return this.stack;
return ErrorEx.getStack(this, options);
}

@@ -109,2 +95,3 @@

*
* @param {Error} err
* @param {Object} [options]

@@ -115,2 +102,26 @@ * @param {boolean} [options.noInternalFiles=false]

*/
static getStack(err, options) {
if (!options)
return err.stack;
const a1 = err.stack.split(/\n/);
const result = [];
for (let line of a1) {
const m = line.match(/[^(]\(([^:(]*)/) || line.match(/at \(?([^:(]*)/);
if (m && path.isAbsolute(m[1]) &&
!m[1].includes(path.sep + 'node_modules')) {
if (options.relativeTo)
line = line.replace(m[1], path.relative(options.relativeTo, m[1]));
result.push(line);
}
}
return result.join('\n');
}
/**
*
* @param {Object} [options]
* @param {boolean} [options.noInternalFiles=false]
* @param {string} [options.relativeTo]
* @return {Array|*}
*/
static getCallStack(options) {

@@ -117,0 +128,0 @@ const frames = (new ErrorEx()).getStackFrames(options);

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

@@ -24,6 +24,6 @@ "contributors": [

"babel-eslint": "^10.0.1",
"eslint": "^5.12.1",
"eslint-config-google": "^0.11.0",
"mocha": "^5.2.0",
"nyc": "^13.1.0"
"eslint": "^5.16.0",
"eslint-config-google": "^0.12.0",
"mocha": "^6.1.4",
"nyc": "^14.0.0"
},

@@ -30,0 +30,0 @@ "engines": {

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