* Parses a file path string to extract the file path and function name. * Handles Windows drive letters (e.g., C:\path\to\file.js:functionName). * @param filePath - The file path string, potentially including a function name. * @returns A tuple containing the file path and function name (if prese
(filePath: string)
| 53 | * @returns A tuple containing the file path and function name (if present). |
| 54 | */ |
| 55 | function parseFilePathAndFunctionName(filePath: string): [string, string | undefined] { |
| 56 | const lastColonIndex = filePath.lastIndexOf(':'); |
| 57 | // Check if colon is part of Windows drive letter (position 1) or not present |
| 58 | if (lastColonIndex > 1) { |
| 59 | return [filePath.slice(0, lastColonIndex), filePath.slice(lastColonIndex + 1)]; |
| 60 | } |
| 61 | return [filePath, undefined]; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Retrieves a JavaScript transform function from a file. |
no outgoing calls
no test coverage detected
searching dependent graphs…