MCPcopy Create free account
hub / github.com/arctic-cli/interface / getFilename

Function getFilename

packages/util/src/path.ts:1–6  ·  view source on GitHub ↗
(path: string | undefined)

Source from the content-addressed store, hash-verified

1export function getFilename(path: string | undefined) {
2 if (!path) return ""
3 const trimmed = path.replace(/[\/]+$/, "")
4 const parts = trimmed.split("/")
5 return parts[parts.length - 1] ?? ""
6}
7
8export function getDirectory(path: string | undefined) {
9 if (!path) return ""

Callers 3

SessionTurnFunction · 0.90
SessionReviewFunction · 0.90
renderFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected