* Derive the Drupal module name from a file path. * e.g. `web/modules/custom/my_module/my_module.module` → `my_module`
(filePath: string)
| 71 | * e.g. `web/modules/custom/my_module/my_module.module` → `my_module` |
| 72 | */ |
| 73 | function moduleNameFromPath(filePath: string): string | null { |
| 74 | const match = filePath.match(/\/([^/]+)\.[^./]+$/); |
| 75 | return match ? match[1]! : null; |
| 76 | } |
| 77 | |
| 78 | // --------------------------------------------------------------------------- |
| 79 | // Route extraction helpers |
no outgoing calls
no test coverage detected