New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

exceptional

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exceptional - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

24

lib/exceptional.js
(function() {
var blue, dir, error, exists, extractRelevantLines, log, magenta, path, pyellow, read, red, util, _, _ref;
var blue, dir, error, exists, log, magenta, path, pred, printRelevantLines, pyellow, read, red, util, _, _ref;
path = require('path');
util = require('util');
read = require('node_util').sync().read;
_ref = require('termspeak'), red = _ref.red, blue = _ref.blue, pyellow = _ref.pyellow, magenta = _ref.magenta;
_ref = require('termspeak'), red = _ref.red, pred = _ref.pred, blue = _ref.blue, pyellow = _ref.pyellow, magenta = _ref.magenta;
_ = require('underscore');

@@ -16,3 +16,3 @@ _.mixin(require('underscore.string'));

error = function(err) {
var char, line, lineno, name, temp, _i, _len, _ref, _ref2, _ref3, _results;
var $, char, file, line, lineno, results, _i, _len, _ref, _results;
if ((err.name != null) === 'AssertionError') {

@@ -29,15 +29,3 @@ log("Actual: " + (util.inspect(err.actual)));

line = line.toString();
if (line.split('(').length < 2 && line.split('/').length > 1) {
temp = line.split('/');
temp.shift();
temp = '/' + temp.join('/');
_ref2 = temp.split(':'), name = _ref2[0], lineno = _ref2[1], char = _ref2[2];
extractRelevantLines(name, lineno, char);
}
if (line.split('(').length < 2) {
log(red(line));
continue;
}
_ref3 = line.split('(')[1].split(')')[0].split(':'), name = _ref3[0], lineno = _ref3[1], char = _ref3[2];
_results.push(name.split('/').length > 1 ? extractRelevantLines(name, lineno, char) : pyellow(line.split('at ')[1]));
_results.push(_(_(line).strip()).startsWith('at') ? (results = line.match(/at [^\(\/]*[\(]{0,1}(\/[^\:]*)\:(\d*)\:(\d*)/), results ? (($ = results[0], file = results[1], lineno = results[2], char = results[3], $ = results[4], results), printRelevantLines(file, lineno, char)) : pyellow(line)) : pred(line));
}

@@ -51,5 +39,4 @@ return _results;

};
extractRelevantLines = function(name, lineno, char) {
printRelevantLines = function(name, lineno, char) {
var cur_lineno, endLine, file, l, lines, relevantLines, startLine, totalLines, _i, _len, _results;
name = name.replace('.coffee', '.js');
pyellow(name);

@@ -86,2 +73,3 @@ lineno = parseInt(lineno);

};
exports.error = error;
}).call(this);
{
"name": "exceptional",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [

@@ -57,8 +57,7 @@ exceptional

* Re-write all code (it's really ugly right now)
* Figure out a better color scheme
* Write some tests
* Relative paths
* Handle other kinds of special errors like we're handling AssertionError right now
* Figure out how muliple imports/requires will be handled
* Write some tests
* Relative paths
* Make sure it works correctly with bugs in imported modules

Sorry, the diff of this file is not supported yet

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