smipper 2.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -101,6 +101,9 @@ function processFrame(functionName, url, line, column)
101
101
  let newUrl, newLine, newColumn;
102
102
  if (verbose)
103
103
  console.error("calling loadUri", url);
104
+ if (!url.includes("://") && url[0] !== "/" && fs.existsSync(url)) {
105
+ url = `file://${process.cwd()}/${url}`;
106
+ }
104
107
  return loadUri(url).then((smap) => {
105
108
  if (verbose)
106
109
  console.error("got map", url, Object.keys(smap));
@@ -122,7 +125,7 @@ function processFrame(functionName, url, line, column)
122
125
  newColumn = pos.column;
123
126
  }).catch((err) => {
124
127
  if (verbose)
125
- console.error("didn't get map", url);
128
+ console.error("didn't get map", url, err);
126
129
  // console.error(err);
127
130
  }).finally(() => {
128
131
  if (json) {
@@ -172,7 +175,7 @@ if (json) {
172
175
  Promise.all(parsed.map((frame) => {
173
176
  if (verbose)
174
177
  console.error("got frame frame", frame);
175
- return processFrame(frame.functionName || "", frame.sourceURL, frame.line, frame.column);
178
+ return processFrame(frame.functionName || "", frame.sourceURL || "", frame.line, frame.column);
176
179
  })).then((results) => {
177
180
  results.forEach((frame, index) => {
178
181
  frame.index = index;
@@ -186,7 +189,7 @@ if (json) {
186
189
  } else {
187
190
  Promise.all(stack.split("\n").filter(x => x).map(x => {
188
191
  x = x.trim();
189
- let match = / *at ?([^ ]*) (.*):([0-9]+):([0-9]+)/.exec(x);
192
+ let match = / *at *([^ ]*).* \(?([^ ]+):([0-9]+):([0-9]+)/.exec(x);
190
193
  if (!match) {
191
194
  match = /([^ ]+@)?(.*):([0-9]+):([0-9]+)/.exec(x);
192
195
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smipper",
3
- "version": "2.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {