MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / basename

Function basename

apps/kimi-web/src/lib/pathBasename.ts:4–7  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

2
3/** basename of an absolute path (last non-empty segment), defaulting to the path. */
4export function basename(path: string): string {
5 const parts = path.split('/').filter(Boolean);
6 return parts.length > 0 ? parts[parts.length - 1]! : path;
7}

Callers 15

getFileSuggestionsMethod · 0.90
scoreEntryMethod · 0.90
mergeWorkspacesFunction · 0.90
writeMigrationErrorsLogFunction · 0.85
pathForMethod · 0.85
isSensitiveFileFunction · 0.85
collectEntriesFunction · 0.85
onEntryFunction · 0.85
encodeWorkDirKeyFunction · 0.85
readSessionIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected