(str: string)
| 3 | * Returns null if the string is not a recognized function call. |
| 4 | */ |
| 5 | export 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 | } |
no outgoing calls
no test coverage detected