(module: WireMapModule, island = false)
| 119 | * text will not fit the box that was sized for it. |
| 120 | */ |
| 121 | export function moduleMetaLabel(module: WireMapModule, island = false): string { |
| 122 | if (island) return 'nothing depends on this'; |
| 123 | const symbols = `${module.symbols} symbol${module.symbols === 1 ? '' : 's'}`; |
| 124 | const files = `${module.files} file${module.files === 1 ? '' : 's'}`; |
| 125 | // How big a change here is, said in the same breath as how big the module is. |
| 126 | // Two boxes of 20 files are not the same box when one of them is imported by |
| 127 | // ninety files and the other by two, and until this line the picture had no |
| 128 | // channel that said so — width tracked the length of the PATH. |
| 129 | // `?.` because `GraphAdapter` is a public seam: a host that assembles this |
| 130 | // payload itself and has not caught up to the field must lose the bar, not |
| 131 | // the screen. Every other read of `dependents` goes through this one. |
| 132 | const reach = module.dependents?.files ?? 0; |
| 133 | const depend = reach > 0 ? ` · ${reach} depend on it` : ''; |
| 134 | return `${symbols} · ${files}${depend}`; |
| 135 | } |
| 136 | |
| 137 | /** One port on a box's edge: the link it belongs to, and which end of it this is. */ |
| 138 | export interface PortRef { |
no outgoing calls
no test coverage detected