Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

439 B
Raw Blame
/**
 * Repository paths arrive from provider APIs and admin config with inconsistent
 * leading/trailing slashes, and `.` for the repository root. Normalizing both
 * sides through this keeps configured paths, tree entry paths, and stored skill
 * paths directly comparable.
 */
export function normalizeRepoPath(value: string): string {
  const trimmed = value.trim().replace(/^\/+|\/+$/g, '');
  return trimmed === '.' ? '' : trimmed;
}