MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / tryWithExt

Function tryWithExt

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

Source from the content-addressed store, hash-verified

271): string | null {
272 const extensions = EXTENSION_RESOLUTION[language] || [];
273 const tryWithExt = (basePath: string): string | null => {
274 for (const ext of extensions) {
275 const candidate = basePath + ext;
276 if (context.fileExists(candidate)) return candidate;
277 }
278 if (context.fileExists(basePath)) return basePath;
279 return null;
280 };
281
282 // 1. Project tsconfig/jsconfig paths.
283 const aliasMap = context.getProjectAliases?.();

Callers 1

resolveAliasedImportFunction · 0.85

Calls 1

fileExistsMethod · 0.80

Tested by

no test coverage detected