* Derive the Drupal module name from a file path. * e.g. `web/modules/custom/my_module/my_module.module` → `my_module`
(filePath: string)
| 82 | * e.g. `web/modules/custom/my_module/my_module.module` → `my_module` |
| 83 | */ |
| 84 | function moduleNameFromPath(filePath: string): string | null { |
| 85 | const match = filePath.match(/\/([^/]+)\.[^./]+$/); |
| 86 | return match ? match[1]! : null; |
| 87 | } |
| 88 | |
| 89 | // --------------------------------------------------------------------------- |
| 90 | // Route extraction helpers |
no outgoing calls
no test coverage detected