@parcel/diagnostic 2.0.0-dev.1632 → 2.0.0-dev.1680

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
@@ -55,7 +55,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
55
55
  /** Normalize the given value into a diagnostic. */
56
56
  function anyToDiagnostic(input) {
57
57
  if (Array.isArray(input)) {
58
- return input;
58
+ return input.flatMap(e => anyToDiagnostic(e));
59
59
  } else if (input instanceof ThrowableDiagnostic) {
60
60
  return input.diagnostics;
61
61
  } else if (input instanceof Error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/diagnostic",
3
- "version": "2.0.0-dev.1632+339350eb3",
3
+ "version": "2.0.0-dev.1680+3edb0d741",
4
4
  "description": "Types and utilities for printing source-code located errors, warning and information messages.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -28,5 +28,5 @@
28
28
  "@mischnic/json-sourcemap": "^0.1.0",
29
29
  "nullthrows": "^1.1.1"
30
30
  },
31
- "gitHead": "339350eb31fd33849cb1efe5fd7ad2cb096319f0"
31
+ "gitHead": "3edb0d7419831e49cfa7ea8c52b4f7127a16ae52"
32
32
  }
package/src/diagnostic.js CHANGED
@@ -114,7 +114,7 @@ export type Diagnostifiable =
114
114
  /** Normalize the given value into a diagnostic. */
115
115
  export function anyToDiagnostic(input: Diagnostifiable): Array<Diagnostic> {
116
116
  if (Array.isArray(input)) {
117
- return input;
117
+ return input.flatMap(e => anyToDiagnostic(e));
118
118
  } else if (input instanceof ThrowableDiagnostic) {
119
119
  return input.diagnostics;
120
120
  } else if (input instanceof Error) {