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.1.0 to 3.2.0

15

lib/index.js

@@ -251,5 +251,14 @@ var fs = require('fs');

CallsiteRecord.fromError = function (error) {
CallsiteRecord.fromError = function (error, isCallsiteFrame) {
var stackFrames = stackParser.parse(error);
if (typeof isCallsiteFrame === 'function') {
while (stackFrames.length) {
if (!isCallsiteFrame(stackFrames[0]))
stackFrames.shift();
else
break;
}
}
if (stackFrames.length) {

@@ -266,5 +275,5 @@ var filename = stackFrames[0].getFileName();

// API
module.exports = function createCallsiteRecord (/* err || fnName, typeName */) {
module.exports = function createCallsiteRecord (/* err, isCallsiteFrame || fnName, typeName */) {
if (arguments[0] instanceof Error)
return CallsiteRecord.fromError(arguments[0]);
return CallsiteRecord.fromError(arguments[0], arguments[1]);

@@ -271,0 +280,0 @@ else if (typeof arguments[0] === 'string') {

2

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

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

@@ -61,5 +61,7 @@ # callsite-record

## API
### createCallsiteRecord(error) → CallsiteRecord
### createCallsiteRecord(error, [isCallsiteFrame]) → CallsiteRecord
Creates `CallsiteRecord` for `error`.
You can generate a callsite for any stack frame, not only the topmost one. Use the `isCallsiteFrame` function to select
a frame. This function is called for each frame starting from the top. Return `true` for the desired frame to generate
the callsite.

@@ -66,0 +68,0 @@ *Example:*

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