MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / isInChromiumDirectory

Function isInChromiumDirectory

scripts/devtools_paths.js:45–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 * @returns {{isInChromium: boolean, chromiumDirectory: string}}
44 */
45export 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 *

Callers 6

run_start.mjsFile · 0.90
findBrowserBinaryFunction · 0.90
startFunction · 0.90
rootPathFunction · 0.85
devToolsThirdPartyPathFunction · 0.85

Calls 6

splitMethod · 0.80
substringMethod · 0.80
indexOfMethod · 0.80
getMethod · 0.65
setMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected