MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / tryWithExt

Function tryWithExt

src/resolution/import-resolver.ts:448–455  ·  view source on GitHub ↗
(basePath: string)

Source from the content-addressed store, hash-verified

446): string | null {
447 const extensions = EXTENSION_RESOLUTION[language] || [];
448 const tryWithExt = (basePath: string): string | null => {
449 for (const ext of extensions) {
450 const candidate = basePath + ext;
451 if (context.fileExists(candidate)) return candidate;
452 }
453 if (context.fileExists(basePath)) return basePath;
454 return null;
455 };
456
457 // 1. Project tsconfig/jsconfig paths.
458 const aliasMap = context.getProjectAliases?.();

Callers 1

resolveAliasedImportFunction · 0.85

Calls 1

fileExistsMethod · 0.80

Tested by

no test coverage detected