Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

215 B
Raw Blame
export function sanitizeFolderName(name: string): string {
  return name
    .replace(/[/\\:*?"<>|\0]/g, '-')
    .replace(/\s+/g, ' ')
    .replace(/-+/g, '-')
    .trim()
    .replace(/^[-.\s]+|[-.\s]+$/g, '');
}