MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / normalizePathLikeLabel

Function normalizePathLikeLabel

src/editor/taskLinkDisplayText.ts:17–23  ·  view source on GitHub ↗
(value: string | undefined)

Source from the content-addressed store, hash-verified

15}
16
17function normalizePathLikeLabel(value: string | undefined): string {
18 if (!value) return "";
19 const decoded = safeDecodeURIComponent(stripMarkdownPathBrackets(value));
20 const withoutSubpath = decoded.split(/[#!^]/)[0] ?? decoded;
21 const withoutLeadingSlash = withoutSubpath.replace(/^\/+/, "");
22 return withoutLeadingSlash.replace(/\.md$/i, "").trim();
23}
24
25function normalizeSubpathLabel(value: string | undefined): string {
26 if (!value) return "";

Callers 2

basenameFunction · 0.85

Calls 2

safeDecodeURIComponentFunction · 0.70

Tested by

no test coverage detected