You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

get-caller-file

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-caller-file - npm Package Compare versions

Comparing version

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.*"
}
}