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

Function moduleNameFromPath

src/resolution/frameworks/drupal.ts:73–76  ·  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

71 * e.g. `web/modules/custom/my_module/my_module.module` → `my_module`
72 */
73function moduleNameFromPath(filePath: string): string | null {
74 const match = filePath.match(/\/([^/]+)\.[^./]+$/);
75 return match ? match[1]! : null;
76}
77
78// ---------------------------------------------------------------------------
79// Route extraction helpers

Callers 1

extractDrupalHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected