Socket
Socket
Sign inDemoInstall

clean-stack

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.1.0

19

index.js
'use strict';
module.exports = stack => stack.replace(/\s+at.*\((?:(?:internal\/)?\w+\.js:\d+:\d+|native)\)|\s+at.*(?:node|internal\/\w+)\.js:\d+:\d+/g, '');
const extractPathRegex = /\s+at.*(?:\(|\s)(.*)\)?/;
const pathRegex = /^(?:(?:(?:node|(?:internal\/|.*node_modules\/babel-polyfill\/.*)?\w+)\.js:\d+:\d+)|native)/;
module.exports = stack => {
return stack.replace(/\\/g, '/')
.split('\n')
.filter(x => {
const pathMatches = x.match(extractPathRegex);
if (pathMatches === null || !pathMatches[1]) {
return true;
}
return !pathRegex.test(pathMatches[1]);
})
.filter(x => x.trim() !== '')
.join('\n');
};

2

package.json
{
"name": "clean-stack",
"version": "1.0.0",
"version": "1.1.0",
"description": "Clean up error stack traces",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc