@tscircuit/cli 0.1.1200 → 0.1.1202

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.
@@ -11514,16 +11514,17 @@ function analyzeCircuitJson(circuitJson) {
11514
11514
  if (!item || typeof item !== "object")
11515
11515
  continue;
11516
11516
  const t = item.type;
11517
- if (typeof t === "string") {
11518
- if (t.endsWith("_error"))
11519
- errors.push(item);
11520
- else if (t.endsWith("_warning"))
11521
- warnings.push(item);
11522
- }
11523
- if ("error_type" in item)
11517
+ const hasErrorType = typeof item.error_type === "string";
11518
+ const hasWarningType = typeof item.warning_type === "string";
11519
+ const isTypedError = typeof t === "string" && t.endsWith("_error");
11520
+ const isTypedWarning = typeof t === "string" && t.endsWith("_warning");
11521
+ if (hasErrorType || isTypedError) {
11524
11522
  errors.push(item);
11525
- if ("warning_type" in item)
11523
+ continue;
11524
+ }
11525
+ if (hasWarningType || isTypedWarning) {
11526
11526
  warnings.push(item);
11527
+ }
11527
11528
  }
11528
11529
  return { errors, warnings };
11529
11530
  }