(path = "")
| 192 | } |
| 193 | |
| 194 | function normalizePath(path = "") { |
| 195 | const absolute = String(path || "").startsWith("/"); |
| 196 | const parts = []; |
| 197 | for (const part of String(path || "").split("/")) { |
| 198 | if (!part || part === ".") continue; |
| 199 | if (part === "..") { |
| 200 | parts.pop(); |
| 201 | continue; |
| 202 | } |
| 203 | parts.push(part); |
| 204 | } |
| 205 | return `${absolute ? "/" : ""}${parts.join("/")}`; |
| 206 | } |
| 207 | |
| 208 | function escapeHtml(value = "") { |
| 209 | return String(value || "") |
no test coverage detected