MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / getFilename

Function getFilename

src/components/referencesPanel/utils.js:14–24  ·  view source on GitHub ↗
(uri)

Source from the content-addressed store, hash-verified

12export { clearHighlightCache, sanitize };
13
14export function getFilename(uri) {
15 if (!uri) return "";
16 try {
17 const decoded = decodeURIComponent(uri);
18 const parts = decoded.split("/").filter(Boolean);
19 return parts.pop() || "";
20 } catch {
21 const parts = uri.split("/").filter(Boolean);
22 return parts.pop() || "";
23 }
24}
25
26export function escapeRegExp(string) {
27 return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");

Callers 1

buildFlatListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected