MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / moduleNameFromPath

Function moduleNameFromPath

src/resolution/frameworks/drupal.ts:84–87  ·  view source on GitHub ↗

* Derive the Drupal module name from a file path. * e.g. `web/modules/custom/my_module/my_module.module` → `my_module`

(filePath: string)

Source from the content-addressed store, hash-verified

82 * e.g. `web/modules/custom/my_module/my_module.module` → `my_module`
83 */
84function moduleNameFromPath(filePath: string): string | null {
85 const match = filePath.match(/\/([^/]+)\.[^./]+$/);
86 return match ? match[1]! : null;
87}
88
89// ---------------------------------------------------------------------------
90// Route extraction helpers

Callers 1

extractDrupalHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected