(t: WireStepTrigger)
| 228 | * `@Process('email')`, `page load · /blog/[slug]`. |
| 229 | */ |
| 230 | export function triggerWords(t: WireStepTrigger): string { |
| 231 | const after = t.after && t.after.length > 0 ? ` · after ${t.after.join(', ')}` : ''; |
| 232 | switch (t.kind) { |
| 233 | case 'prop': |
| 234 | return t.of ? `${t.name} · <${t.of}>` : t.name; |
| 235 | case 'option': |
| 236 | return t.of ? `${t.name} · ${t.of}(…)` : t.name; |
| 237 | case 'request': |
| 238 | return `${t.name} ${t.of ?? ''}`.trim() + after; |
| 239 | case 'decorator': |
| 240 | return `@${t.name}(${t.of ?? ''})` + after; |
| 241 | case 'load': |
| 242 | return `page load · ${t.of ?? t.name}` + after; |
| 243 | default: |
| 244 | return t.of ? `${t.name}(${t.of})` : t.name; |
| 245 | } |
| 246 | } |
| 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 { |
no test coverage detected