12345678910111213141516171819202122 |
- "use strict";
- module.exports = function getCallerFile(position) {
- if (position === void 0) { 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 + '`');
- }
- var oldPrepareStackTrace = Error.prepareStackTrace;
- Error.prepareStackTrace = function (_, stack) { return stack; };
- var stack = new Error().stack;
- Error.prepareStackTrace = oldPrepareStackTrace;
- if (stack !== null && typeof stack === 'object') {
-
-
-
- return stack[position] ? stack[position].getFileName() : undefined;
- }
- };
|