@tscircuit/checks 0.0.176 → 0.0.177
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 +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3920,6 +3920,11 @@ function checkAllPinsInComponentAreUnderspecified(circuitJson) {
|
|
|
3920
3920
|
|
|
3921
3921
|
// lib/check-no-power-pin-defined.ts
|
|
3922
3922
|
import { cju as cju8 } from "@tscircuit/circuit-json-util";
|
|
3923
|
+
|
|
3924
|
+
// lib/util/should-check-chip-power-ground-pins.ts
|
|
3925
|
+
var shouldCheckChipPowerGroundPins = (component, ports) => component.ftype === "simple_chip" && ports.filter((port) => port.do_not_connect !== true).length >= 2;
|
|
3926
|
+
|
|
3927
|
+
// lib/check-no-power-pin-defined.ts
|
|
3923
3928
|
function checkNoPowerPinDefined(circuitJson) {
|
|
3924
3929
|
const warnings = [];
|
|
3925
3930
|
const db = cju8(circuitJson);
|
|
@@ -3933,9 +3938,8 @@ function checkNoPowerPinDefined(circuitJson) {
|
|
|
3933
3938
|
portsByComponent.set(port.source_component_id, existing);
|
|
3934
3939
|
}
|
|
3935
3940
|
for (const component of sourceComponents) {
|
|
3936
|
-
if (component.ftype !== "simple_chip") continue;
|
|
3937
3941
|
const componentPorts = portsByComponent.get(component.source_component_id) ?? [];
|
|
3938
|
-
if (componentPorts
|
|
3942
|
+
if (!shouldCheckChipPowerGroundPins(component, componentPorts)) continue;
|
|
3939
3943
|
const hasRequiredPowerPin = componentPorts.some(
|
|
3940
3944
|
(port) => port.requires_power === true
|
|
3941
3945
|
);
|
|
@@ -3968,9 +3972,8 @@ function checkNoGroundPinDefined(circuitJson) {
|
|
|
3968
3972
|
portsByComponent.set(port.source_component_id, existing);
|
|
3969
3973
|
}
|
|
3970
3974
|
for (const component of sourceComponents) {
|
|
3971
|
-
if (component.ftype !== "simple_chip") continue;
|
|
3972
3975
|
const componentPorts = portsByComponent.get(component.source_component_id) ?? [];
|
|
3973
|
-
if (componentPorts
|
|
3976
|
+
if (!shouldCheckChipPowerGroundPins(component, componentPorts)) continue;
|
|
3974
3977
|
const hasRequiredGroundPin = componentPorts.some(
|
|
3975
3978
|
(port) => port.requires_ground === true
|
|
3976
3979
|
);
|