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

Function firstArgument

src/resolution/frameworks/drupal.ts:522–524  ·  view source on GitHub ↗

The first string an attribute's arguments open with, by position or as `name:`.

(args: string, name: string)

Source from the content-addressed store, hash-verified

520
521/** The first string an attribute's arguments open with, by position or as `name:`. */
522function firstArgument(args: string, name: string): string | null {
523 return new RegExp(`^\\s*(?:${name}\\s*:\\s*)?['"]([^'"]+)['"]`).exec(args)?.[1] ?? null;
524}
525
526/** `#[Hook('x')]` on a method, or on a class, where it names the method or means `__invoke`. */
527function oopHookReferences(filePath: string, content: string, declarations: readonly AttributedDeclaration[]): UnresolvedRef[] {

Callers 2

oopHookReferencesFunction · 0.85
pluginDefinitionsFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected