Socket
Socket
Sign inDemoInstall

callsite-record

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callsite-record - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1

33

lib/index.js

@@ -19,2 +19,11 @@ var fs = require('fs');

// Utils
function parseStack (error) {
try {
return stackParser.parse(error);
}
catch (err) {
return null;
}
}
function getFrameTypeName (frame) {

@@ -253,18 +262,20 @@ // NOTE: this throws in node 10 for non-methods

CallsiteRecord.fromError = function (error, isCallsiteFrame) {
var stackFrames = stackParser.parse(error);
var stackFrames = parseStack(error);
if (typeof isCallsiteFrame === 'function') {
while (stackFrames.length) {
if (!isCallsiteFrame(stackFrames[0]))
if (stackFrames) {
if (typeof isCallsiteFrame === 'function') {
while (stackFrames.length) {
if (isCallsiteFrame(stackFrames[0]))
break;
stackFrames.shift();
else
break;
}
}
}
if (stackFrames.length) {
var filename = stackFrames[0].getFileName();
var lineNum = stackFrames[0].getLineNumber() - 1;
if (stackFrames.length) {
var filename = stackFrames[0].getFileName();
var lineNum = stackFrames[0].getLineNumber() - 1;
return new CallsiteRecord(filename, lineNum, 0, stackFrames);
return filename && !isNaN(lineNum) ? new CallsiteRecord(filename, lineNum, 0, stackFrames) : null;
}
}

@@ -271,0 +282,0 @@

{
"name": "callsite-record",
"version": "3.2.0",
"version": "3.2.1",
"description": "Create fancy log entries for errors and function call sites.",

@@ -10,3 +10,5 @@ "main": "lib/index.js",

"scripts": {
"test": "eslint lib test && mocha"
"test": "eslint lib test && mocha",
"publish-please": "publish-please",
"prepublish": "publish-please guard"
},

@@ -34,3 +36,4 @@ "repository": {

"eslint": "^1.10.3",
"mocha": "^2.4.5"
"mocha": "^2.4.5",
"publish-please": "^2.2.0"
},

@@ -37,0 +40,0 @@ "dependencies": {

@@ -0,0 +0,0 @@ # callsite-record

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