Socket
Socket
Sign inDemoInstall

caller

Package Overview
Dependencies
0
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.1.0

CHANGELOG.md

10

index.js
'use strict';
var assert = require('assert');

@@ -11,3 +12,3 @@

module.exports = function (depth) {
var pst, stack, file, frame;
var pst, stack, file, frame, startIdx;

@@ -21,4 +22,9 @@ pst = Error.prepareStackTrace;

stack = (new Error()).stack;
// Handle case where error object is wrapped by say babel. Try to find current file's index first.
startIdx = 0;
while(startIdx < stack.length && stack[startIdx].getFileName() !== __filename) startIdx++;
assert(startIdx < stack.length, 'Unexpected: unable to find caller/index.js in the stack');
depth = !depth || isNaN(depth) ? 1 : (depth > stack.length - 2 ? stack.length - 2 : depth);
stack = stack.slice(depth + 1);
stack = stack.slice(startIdx + depth + 1);

@@ -25,0 +31,0 @@ do {

2

package.json
{
"name": "caller",
"version": "1.0.1",
"version": "1.1.0",
"description": "@substack's caller.js as a module",

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc