MCPcopy
hub / github.com/continuedev/continue / getLastNPathParts

Function getLastNPathParts

core/util/uri.ts:178–183  ·  view source on GitHub ↗
(filepath: string, n: number)

Source from the content-addressed store, hash-verified

176// Only used when working with system paths and relative paths
177// Since doesn't account for URI segements before workspace
178export function getLastNPathParts(filepath: string, n: number): string {
179 if (n <= 0) {
180 return "";
181 }
182 return filepath.split(/[\\/]/).slice(-n).join("/");
183}
184
185export function getUriDescription(uri: string, dirUriCandidates: string[]) {
186 const { relativePathOrBasename, foundInDir } = findUriInDirs(

Callers 10

getRuleSourceDisplayNameFunction · 0.90
getAllMethod · 0.90
parsePromptFileFunction · 0.90
uri.test.tsFile · 0.90
FileInfoFunction · 0.90
FindAndReplaceDisplayFunction · 0.90
streamEditMethod · 0.90
formatMessageWithFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected