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

Function longestName

src/resolution/workspace-packages.ts:784–790  ·  view source on GitHub ↗
(importPath: string, names: Iterable<string>)

Source from the content-addressed store, hash-verified

782}
783
784function longestName(importPath: string, names: Iterable<string>): string | null {
785 let best: string | null = null;
786 for (const name of names) {
787 if ((importPath === name || importPath.startsWith(name + '/')) && (best === null || name.length > best.length)) best = name;
788 }
789 return best;
790}
791
792/**
793 * The targets a package's manifest declares for `subpath` (`''` or

Callers 2

matchPackageFunction · 0.85
scopedPackageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected