MCPcopy Index your code
hub / github.com/directus/directus / extractFunctionName

Function extractFunctionName

api/src/utils/extract-function-name.ts:5–13  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

3 * Returns null if the string is not a recognized function call.
4 */
5export function extractFunctionName(str: string): string | null {
6 const trimmed = str.trim();
7
8 if (!trimmed.includes('(') || !trimmed.endsWith(')')) {
9 return null;
10 }
11
12 return trimmed.split('(')[0] ?? null;
13}

Callers 11

extractPathsFromQueryFunction · 0.85
getUnaliasedFieldKeyFunction · 0.85
validateAliasFunction · 0.85
validateSortFunction · 0.85
runFunction · 0.85
getDBQueryFunction · 0.85
parseCurrentLevelFunction · 0.85
applySortFunction · 0.85
convertWildcardsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected