@parcel/diagnostic 2.0.1 → 2.1.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 +1 -1
- package/package.json +2 -2
- package/src/diagnostic.js +4 -1
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
|
|
3
|
+
"version": "2.1.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": "
|
|
30
|
+
"gitHead": "5a80fbe4af8797d0aab248a66f5254f42f00e83e"
|
|
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:
|
|
180
|
+
stack:
|
|
181
|
+
codeFrames == null
|
|
182
|
+
? error.highlightedCodeFrame ?? error.codeFrame ?? error.stack
|
|
183
|
+
: undefined,
|
|
181
184
|
codeFrames,
|
|
182
185
|
},
|
|
183
186
|
];
|