(step: WireStep)
| 247 | |
| 248 | /** The first line of a step's box. Boundary crossings carry an arrow for which way the code goes. */ |
| 249 | export function stepLabel(step: WireStep): string { |
| 250 | switch (step.kind) { |
| 251 | case 'bridge': |
| 252 | return `⇢ ${step.label}`; |
| 253 | case 'event': { |
| 254 | const events = step.events ?? (step.event ? [step.event] : []); |
| 255 | if (events.length === 0) return `⇠ ${step.label}`; |
| 256 | return events.length === 1 ? `⇠ ${events[0]}` : `⇠ ${events[0]} +${events.length - 1}`; |
| 257 | } |
| 258 | default: |
| 259 | return step.label; |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | /** The second line: what the step is, then where it is. */ |
| 264 | export function stepSub(step: WireStep, project: ProjectKind = 'app'): string { |
no outgoing calls
no test coverage detected