MCPcopy Create free account
hub / github.com/Snapchat/Valdi / computeSourceMapPathOverrides

Function computeSourceMapPathOverrides

npm_modules/cli/src/commands/projectsync.ts:340–364  ·  view source on GitHub ↗
(
  bazelWorkspaceRoot: string,
  tsConfigDirs: readonly TsConfigDir[],
)

Source from the content-addressed store, hash-verified

338}
339
340function computeSourceMapPathOverrides(
341 bazelWorkspaceRoot: string,
342 tsConfigDirs: readonly TsConfigDir[],
343): { [key: string]: string } {
344 const output: { [key: string]: string } = {};
345
346 for (const tsConfigDir of tsConfigDirs) {
347 for (const matchedTarget of tsConfigDir.matchedTargets) {
348 if (matchedTarget.target.label.name) {
349 const key = `/${matchedTarget.target.label.name}/*`;
350 const relativePath = relativePathTo(bazelWorkspaceRoot, tsConfigDir.dir);
351 const expected = `\${workspaceRoot}/${relativePath}/*`;
352
353 const existing = output[key];
354 if (existing && existing !== expected) {
355 console.error(`Conflicting target name ${matchedTarget.target.label.name}: '${expected}' vs ${existing}`);
356 } else {
357 output[key] = expected;
358 }
359 }
360 }
361 }
362
363 return output;
364}
365
366async function processLaunchJSONFile(
367 launchJsonFilePath: string | undefined,

Callers 1

processLaunchJSONFileFunction · 0.85

Calls 2

relativePathToFunction · 0.90
errorMethod · 0.65

Tested by

no test coverage detected