tscircuit/autorouting-dataset-01

This code manages the hardware and electronic components for circuit design and PCB layout, defining components like resistors, capacitors, transistors, connectors, and footprints, and providing tools for component placement, PCB topology, and electrical connections.

Version
1.0.102
License
unset
Stars
4

scripts/random-circuits/formatConnections.ts

/**
 * Formats a connection dictionary into a JSX-friendly string.
 */
export const formatConnections = (
  connections: Record<string, string>,
): string => {
  const entries = Object.entries(connections)
  if (entries.length === 0) return "{}"
  const lines = entries
    .map(([pin, net]) => `        ${pin}: "${net}",`)
    .join("\n")
  return `{
${lines}
      }`
}