@parcel/diagnostic 2.0.1 → 2.2.1

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
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.anyToDiagnostic = anyToDiagnostic;
7
+ exports.default = void 0;
8
+ exports.encodeJSONKeyComponent = encodeJSONKeyComponent;
7
9
  exports.errorToDiagnostic = errorToDiagnostic;
10
+ exports.escapeMarkdown = escapeMarkdown;
8
11
  exports.generateJSONCodeHighlights = generateJSONCodeHighlights;
9
12
  exports.getJSONSourceLocation = getJSONSourceLocation;
10
- exports.encodeJSONKeyComponent = encodeJSONKeyComponent;
11
- exports.escapeMarkdown = escapeMarkdown;
12
13
  exports.md = md;
13
- exports.default = void 0;
14
14
 
15
15
  function _assert() {
16
16
  const data = _interopRequireDefault(require("assert"));
@@ -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.1",
3
+ "version": "2.2.1",
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": "28b47e6bdca7de2a06b7cc39a4a0b1df89f3fe15"
30
+ "gitHead": "74fcc3fbe80cea993bff10e158df3d0f701973c7"
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
  ];