@tscircuit/circuit-json-util 0.0.86 → 0.0.88

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/dist/index.js CHANGED
@@ -2345,10 +2345,40 @@ var computeClearanceBetweenElements = (elm1, elm2) => {
2345
2345
  }
2346
2346
  return minimumGap;
2347
2347
  };
2348
+
2349
+ // lib/categorize-error-or-warning.ts
2350
+ var NETLIST_TYPES = /* @__PURE__ */ new Set(["source_pin_must_be_connected_error"]);
2351
+ var PIN_SPECIFICATION_TYPES = /* @__PURE__ */ new Set([
2352
+ "source_component_pins_underspecified_warning",
2353
+ "source_no_power_pin_defined_warning",
2354
+ "source_no_ground_pin_defined_warning"
2355
+ ]);
2356
+ var PLACEMENT_TYPES = /* @__PURE__ */ new Set([
2357
+ "pcb_placement_error",
2358
+ "pcb_component_outside_board_error",
2359
+ "pcb_footprint_overlap_error",
2360
+ "pcb_connector_not_in_accessible_orientation_warning"
2361
+ ]);
2362
+ var ROUTING_TYPES = /* @__PURE__ */ new Set([
2363
+ "pcb_port_not_connected_error",
2364
+ "pcb_trace_missing_error",
2365
+ "pcb_trace_error",
2366
+ "pcb_via_clearance_error"
2367
+ ]);
2368
+ var categorizeErrorOrWarning = (value) => {
2369
+ const drcType = typeof value === "string" ? value : value.error_type ?? value.warning_type ?? value.type;
2370
+ if (!drcType) return "unknown";
2371
+ if (NETLIST_TYPES.has(drcType)) return "netlist";
2372
+ if (PIN_SPECIFICATION_TYPES.has(drcType)) return "pin_specification";
2373
+ if (PLACEMENT_TYPES.has(drcType)) return "placement";
2374
+ if (ROUTING_TYPES.has(drcType)) return "routing";
2375
+ return "unknown";
2376
+ };
2348
2377
  export {
2349
2378
  applySelector,
2350
2379
  applySelectorAST,
2351
2380
  buildSubtree,
2381
+ categorizeErrorOrWarning,
2352
2382
  cju_default as cju,
2353
2383
  cju_indexed_default as cjuIndexed,
2354
2384
  computeClearanceBetweenElements,