Whether anything in this block draws a box — a fork with one drawn arm is a guard clause, not a point.
(block: WireBlock)
| 228 | |
| 229 | /** Whether anything in this block draws a box — a fork with one drawn arm is a guard clause, not a point. */ |
| 230 | function hasStep(block: WireBlock): boolean { |
| 231 | return block.some((item) => |
| 232 | item.kind === 'step' |
| 233 | ? true |
| 234 | : item.kind === 'fork' |
| 235 | ? item.arms.some((a) => hasStep(a.body)) |
| 236 | : item.kind === 'block' |
| 237 | ? hasStep(item.body) |
| 238 | : false |
| 239 | ); |
| 240 | } |
| 241 | |
| 242 | /** The word on a line out of a decision's point — the same one the tree's arms say. */ |
| 243 | function armWord(fork: Extract<WireItem, { kind: 'fork' }>, arm: WireArm): string { |