Socket
Socket
Sign inDemoInstall

get-caller-file

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

6

index.js

@@ -8,3 +8,3 @@ 'use strict';

module.exports = function getCallerFile() {
module.exports = function getCallerFile(_position) {
var oldPrepareStackTrace = Error.prepareStackTrace;

@@ -15,6 +15,8 @@ Error.prepareStackTrace = function(err, stack) { return stack; };

var position = _position ? _position : 2;
// stack[0] holds this file
// stack[1] holds where this function was called
// stack[2] holds the file we're interested in
return stack[2] ? stack[2].getFileName() : undefined;
return stack[position] ? stack[position].getFileName() : undefined;
};
{
"name": "get-caller-file",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc