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

Function tryWithExt

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

Source from the content-addressed store, hash-verified

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

Callers 1

resolveAliasedImportFunction · 0.85

Calls 1

fileExistsMethod · 0.80

Tested by

no test coverage detected