()
| 43 | * @returns {{isInChromium: boolean, chromiumDirectory: string}} |
| 44 | */ |
| 45 | export function isInChromiumDirectory() { |
| 46 | const cached = _lookUpCaches.get('chromium'); |
| 47 | if (cached) { |
| 48 | return cached; |
| 49 | } |
| 50 | |
| 51 | const normalizedPath = PATH_TO_EXECUTED_FILE.split(path.sep).join('/'); |
| 52 | const devtoolsPath = 'third_party/devtools-frontend/src'; |
| 53 | const isInChromium = normalizedPath.includes(devtoolsPath); |
| 54 | const potentialChromiumDir = PATH_TO_EXECUTED_FILE.substring( |
| 55 | 0, |
| 56 | normalizedPath.indexOf(devtoolsPath), |
| 57 | ); |
| 58 | const result = {isInChromium, chromiumDirectory: potentialChromiumDir}; |
| 59 | _lookUpCaches.set('chromium', result); |
| 60 | return result; |
| 61 | } |
| 62 | /** |
| 63 | * Returns the path to the root of the devtools-frontend repository. |
| 64 | * |
no test coverage detected