@parcel/diagnostic 2.0.0 → 2.2.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.
package/lib/diagnostic.js CHANGED
@@ -112,7 +112,7 @@ function errorToDiagnostic(error, defaultValues) {
112
112
  origin: (_defaultValues$origin2 = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.origin) !== null && _defaultValues$origin2 !== void 0 ? _defaultValues$origin2 : 'Error',
113
113
  message: escapeMarkdown(error.message),
114
114
  name: error.name,
115
- stack: (_ref4 = (_error$highlightedCod = error.highlightedCodeFrame) !== null && _error$highlightedCod !== void 0 ? _error$highlightedCod : error.codeFrame) !== null && _ref4 !== void 0 ? _ref4 : error.stack,
115
+ stack: codeFrames == null ? (_ref4 = (_error$highlightedCod = error.highlightedCodeFrame) !== null && _error$highlightedCod !== void 0 ? _error$highlightedCod : error.codeFrame) !== null && _ref4 !== void 0 ? _ref4 : error.stack : undefined,
116
116
  codeFrames
117
117
  }];
118
118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/diagnostic",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -27,5 +27,5 @@
27
27
  "json-source-map": "^0.6.1",
28
28
  "nullthrows": "^1.1.1"
29
29
  },
30
- "gitHead": "84da50ae6943bff9741e2fc76d2f4968074cbbd6"
30
+ "gitHead": "4745cd3023f8d5a5adcf9e565d5b82d1418dc262"
31
31
  }
package/src/diagnostic.js CHANGED
@@ -177,7 +177,10 @@ export function errorToDiagnostic(
177
177
  origin: defaultValues?.origin ?? 'Error',
178
178
  message: escapeMarkdown(error.message),
179
179
  name: error.name,
180
- stack: error.highlightedCodeFrame ?? error.codeFrame ?? error.stack,
180
+ stack:
181
+ codeFrames == null
182
+ ? error.highlightedCodeFrame ?? error.codeFrame ?? error.stack
183
+ : undefined,
181
184
  codeFrames,
182
185
  },
183
186
  ];
@@ -313,22 +316,22 @@ export function md(
313
316
  return result.join('') + strings[strings.length - 1];
314
317
  }
315
318
 
316
- md.bold = function(s: TemplateInput): TemplateInput {
319
+ md.bold = function (s: TemplateInput): TemplateInput {
317
320
  // $FlowFixMe[invalid-computed-prop]
318
321
  return {[mdVerbatim]: '**' + escapeMarkdown(`${s}`) + '**'};
319
322
  };
320
323
 
321
- md.italic = function(s: TemplateInput): TemplateInput {
324
+ md.italic = function (s: TemplateInput): TemplateInput {
322
325
  // $FlowFixMe[invalid-computed-prop]
323
326
  return {[mdVerbatim]: '_' + escapeMarkdown(`${s}`) + '_'};
324
327
  };
325
328
 
326
- md.underline = function(s: TemplateInput): TemplateInput {
329
+ md.underline = function (s: TemplateInput): TemplateInput {
327
330
  // $FlowFixMe[invalid-computed-prop]
328
331
  return {[mdVerbatim]: '__' + escapeMarkdown(`${s}`) + '__'};
329
332
  };
330
333
 
331
- md.strikethrough = function(s: TemplateInput): TemplateInput {
334
+ md.strikethrough = function (s: TemplateInput): TemplateInput {
332
335
  // $FlowFixMe[invalid-computed-prop]
333
336
  return {[mdVerbatim]: '~~' + escapeMarkdown(`${s}`) + '~~'};
334
337
  };