UNPKG

fumadocs-core

Version:

The library for building a documentation website in Next.js

12 lines (10 loc) 291 B
// src/utils/normalize-url.tsx function normalizeUrl(url) { if (url.startsWith("http://") || url.startsWith("https://")) return url; if (!url.startsWith("/")) url = "/" + url; if (url.length > 1 && url.endsWith("/")) url = url.slice(0, -1); return url; } export { normalizeUrl };