@parcel/utils 2.0.0-nightly.1294 → 2.0.0-nightly.1295

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/index.js CHANGED
@@ -33496,7 +33496,10 @@ async function $f02d6a9d30f55938$export$2e2bcd8739ae039(diagnostic, options, ter
33496
33496
  language: codeFrame.language || (filePath != null ? (0, ($parcel$interopDefault($8C1kk$path))).extname(filePath).substr(1) : undefined),
33497
33497
  terminalWidth: terminalWidth
33498
33498
  });
33499
- let location = typeof filePath !== "string" ? "" : `${filePath}:${highlights[0].start.line}:${highlights[0].start.column}`;
33499
+ let location;
33500
+ if (typeof filePath !== "string") location = "";
33501
+ else if (highlights.length === 0) location = filePath;
33502
+ else location = `${filePath}:${highlights[0].start.line}:${highlights[0].start.column}`;
33500
33503
  result.codeframe += location ? (0, ($parcel$interopDefault($8C1kk$chalk))).gray.underline(location) + "\n" : "";
33501
33504
  result.codeframe += formattedCodeFrame;
33502
33505
  if (codeFrame !== codeFrames[codeFrames.length - 1]) result.codeframe += "\n\n";