🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

caller

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caller - npm Package Compare versions

Comparing version

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",