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

spex

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spex - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

14

lib/errors/page.js

@@ -115,4 +115,16 @@ 'use strict';

];
var names = ['BatchError', 'PageError', 'SequenceError'];
var error = this.error instanceof BatchError ? this.error.toString(level + 1) : $npm.u.inspect(this.error);
var error;
if (this.error instanceof Error) {
if (names.indexOf(this.error.name) === -1) {
error = $npm.u.inspect(this.error) + '\n' + $npm.utils.getStack(this.error, level + 1);
} else {
error = this.error.toString(level + 1);
}
} else {
error = $npm.u.inspect(this.error);
}
lines.push(gap1 + 'error: ' + error);

@@ -119,0 +131,0 @@

@@ -95,3 +95,3 @@ 'use strict';

level = level > 0 ? parseInt(level) : 0;
var gap0 = $npm.utils.messageGap(level),

@@ -106,4 +106,18 @@ gap1 = $npm.utils.messageGap(level + 1),

];
var names = ['BatchError', 'PageError', 'SequenceError'];
var error;
if (this.error instanceof Error) {
if (names.indexOf(this.error.name) === -1) {
error = $npm.u.inspect(this.error) + '\n' + $npm.utils.getStack(this.error, level + 1);
} else {
error = this.error.toString(level + 1);
}
} else {
error = $npm.u.inspect(this.error);
}
lines.push(gap1 + 'error: ' + $npm.u.inspect(this.error));
lines.push(gap1 + 'error: ' + error);
lines.push(gap0 + '}');

@@ -110,0 +124,0 @@

@@ -8,2 +8,3 @@ 'use strict';

var exp = {
getStack: stat.getStack,
isPromise: stat.isPromise,

@@ -10,0 +11,0 @@ isReadableStream: stat.isReadableStream,

@@ -37,3 +37,17 @@ 'use strict';

function getStack(error, level) {
// from the call stack, we take only lines starting with the client's
// source code, and only those that contain a full path inside brackets,
// indicating a reference to the client's source code:
var gap = messageGap(level);
return error.stack.split('\n').filter(function (line) {
return line.match(/\(.*(\\+|\/+).*\)/); // contains \ or / inside ()
}).map(function (line) {
return gap + line;
}).join('\n');
}
module.exports = {
getStack: getStack,
isPromise: isPromise,

@@ -40,0 +54,0 @@ isReadableStream: isReadableStream,

2

package.json
{
"name": "spex",
"version": "1.0.3",
"version": "1.0.4",
"description": "Specialized Promise Extensions",

@@ -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