function normalizePath(path) {
  if (!path) {
    return "/";
  }
  if (Array.isArray(path)) {
    const segments2 = path.filter(Boolean);
    return segments2.length > 0 ? `/${segments2.join("/")}` : "/";
  }
  const segments = path.split("/").filter(Boolean);
  return segments.length > 0 ? `/${segments.join("/")}` : "/";
}

export { normalizePath };
