UNPKG

287 BJavaScriptView Raw
1'use strict';
2
3const internals = {};
4
5
6exports.position = function (err) {
7
8 const match = /\:(\d+)\:(\d+)/.exec(err.stack.split('\n')[1]);
9 if (!match) {
10 return {};
11 }
12
13 return {
14 line: parseInt(match[1], 10),
15 column: parseInt(match[2], 10)
16 };
17};