The name the handler's method goes by, or its class's when only that is written.
(handler: string)
| 152 | |
| 153 | /** The name the handler's method goes by, or its class's when only that is written. */ |
| 154 | function awaitedName(handler: string): string { |
| 155 | const literal = handler.split('/').filter((segment) => segment && !segment.includes('$')); |
| 156 | const last = literal[literal.length - 1] ?? handler; |
| 157 | return literal.length > 1 ? last : last.charAt(0).toUpperCase() + last.slice(1); |
| 158 | } |
| 159 | |
| 160 | /** `$route['pattern'] = 'controller/method'`, verb-scoped or not, and the default controller at `/`. */ |
| 161 | function explicitRoutes(filePath: string, safe: string): { nodes: Node[]; references: UnresolvedRef[] } { |