MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / mapPath

Function mapPath

packages/tooling/src/vite.plugin.emit-dts.ts:46–54  ·  view source on GitHub ↗
(filePath: string, input: string)

Source from the content-addressed store, hash-verified

44 };
45
46 const mapPath = (filePath: string, input: string): string | undefined => {
47 for (const [k, v] of Object.entries(mapping!)) {
48 if (input.startsWith(k) && !isExternal(input)) {
49 const absoluteFile = path.resolve(v, input.substring(k.length));
50 return `./${path.relative(path.dirname(filePath), absoluteFile).replaceAll('\\', '/')}`;
51 }
52 }
53 return undefined;
54 };
55
56 return (source: ts.SourceFile | ts.Bundle) => {
57 const sourceFilePath = ts.isSourceFile(source) ? source.fileName : source.sourceFiles[0].fileName;

Callers 1

visitorFunction · 0.85

Calls 3

isExternalFunction · 0.85
entriesMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected