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.3 to 2.0.0

14

index.js

@@ -8,9 +8,13 @@ 'use strict';

module.exports = function getCallerFile(_position) {
var oldPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = function(err, stack) { return stack; };
var stack = new Error().stack;
module.exports = function getCallerFile(position = 2) {
if (position >= Error.stackTraceLimit) {
throw new TypeError('getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `' + position + '` and Error.stackTraceLimit was: `' + Error.stackTraceLimit + '`');
}
const oldPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = (err, stack) => stack;
const stack = new Error().stack;
Error.prepareStackTrace = oldPrepareStackTrace;
var position = _position ? _position : 2;

@@ -17,0 +21,0 @@ // stack[0] holds this file

{
"name": "get-caller-file",
"version": "1.0.3",
"version": "2.0.0",
"description": "",

@@ -30,3 +30,6 @@ "main": "index.js",

"mocha": "^5.2.0"
},
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
}
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