@tscircuit/core 0.0.1296 → 0.0.1297
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 +9 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2234,6 +2234,10 @@ function pairs(arr) {
|
|
|
2234
2234
|
return result;
|
|
2235
2235
|
}
|
|
2236
2236
|
|
|
2237
|
+
// lib/utils/gnd-power-net-regex.ts
|
|
2238
|
+
var GROUND_NET_REGEX = /^(GND|AGND|DGND|PGND|VSS)/i;
|
|
2239
|
+
var POWER_NET_REGEX = /^V(?!SS)|^\d+(?:[_.]\d+)?[Vv]/i;
|
|
2240
|
+
|
|
2237
2241
|
// lib/components/primitive-components/Net.ts
|
|
2238
2242
|
import { autoroute } from "@tscircuit/infgrid-ijump-astar";
|
|
2239
2243
|
var Net = class extends PrimitiveComponent2 {
|
|
@@ -2251,8 +2255,8 @@ var Net = class extends PrimitiveComponent2 {
|
|
|
2251
2255
|
doInitialSourceRender() {
|
|
2252
2256
|
const { db } = this.root;
|
|
2253
2257
|
const { _parsedProps: props } = this;
|
|
2254
|
-
const isGround = props.isGroundNet ?? props.name
|
|
2255
|
-
const isPositiveVoltageSource = props.isPowerNet ?? props.name
|
|
2258
|
+
const isGround = props.isGroundNet ?? GROUND_NET_REGEX.test(props.name);
|
|
2259
|
+
const isPositiveVoltageSource = props.isPowerNet ?? POWER_NET_REGEX.test(props.name);
|
|
2256
2260
|
const net = db.source_net.insert({
|
|
2257
2261
|
name: props.name,
|
|
2258
2262
|
member_source_group_ids: [],
|
|
@@ -21426,13 +21430,13 @@ var Group5 = class extends NormalComponent3 {
|
|
|
21426
21430
|
for (const nl of subtree.schematic_net_label.list()) {
|
|
21427
21431
|
const net = subtree.source_net.get(nl.source_net_id);
|
|
21428
21432
|
const text = nl.text || net?.name || "";
|
|
21429
|
-
if (nl.anchor_side === "top" &&
|
|
21433
|
+
if (nl.anchor_side === "top" && GROUND_NET_REGEX.test(text)) {
|
|
21430
21434
|
subtree.schematic_net_label.update(nl.schematic_net_label_id, {
|
|
21431
21435
|
symbol_name: "rail_down"
|
|
21432
21436
|
});
|
|
21433
21437
|
continue;
|
|
21434
21438
|
}
|
|
21435
|
-
if (nl.anchor_side === "bottom" &&
|
|
21439
|
+
if (nl.anchor_side === "bottom" && POWER_NET_REGEX.test(text)) {
|
|
21436
21440
|
subtree.schematic_net_label.update(nl.schematic_net_label_id, {
|
|
21437
21441
|
symbol_name: "rail_up"
|
|
21438
21442
|
});
|
|
@@ -22426,7 +22430,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
22426
22430
|
var package_default = {
|
|
22427
22431
|
name: "@tscircuit/core",
|
|
22428
22432
|
type: "module",
|
|
22429
|
-
version: "0.0.
|
|
22433
|
+
version: "0.0.1296",
|
|
22430
22434
|
types: "dist/index.d.ts",
|
|
22431
22435
|
main: "dist/index.js",
|
|
22432
22436
|
module: "dist/index.js",
|