Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
export function extractFolderBasename(absolutePath: string): string {
if (!absolutePath) return '';
const normalized = absolutePath.replace(/[/\\]+$/g, '');
const lastSlash = Math.max(normalized.lastIndexOf('/'), normalized.lastIndexOf('\\'));
if (lastSlash < 0) return normalized;
return normalized.slice(lastSlash + 1);
}