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

Function toAbsoluteImportPath

compiler/companion/src/utils/ImportPathResolver.ts:6–13  ·  view source on GitHub ↗
(dirname: string, toPath: string)

Source from the content-addressed store, hash-verified

4import { FilePath } from '../project/FileManager';
5
6function toAbsoluteImportPath(dirname: string, toPath: string): string {
7 if (toPath.startsWith('.') || toPath.startsWith('/')) {
8 return _path.resolve(dirname, toPath);
9 } else {
10 // Absolute import path
11 return _path.join('/', toPath);
12 }
13}
14
15export class ImportPathResolver {
16 private resolvedPaths = new Map<string, string>();

Callers 2

resolveImportPathMethod · 0.85

Calls 3

startsWithMethod · 0.80
resolveMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected