Update macos/Sources/Helpers/Extensions/URL+Extension.swift

Co-authored-by: Lukas <134181853+bo2themax@users.noreply.github.com>
This commit is contained in:
Mitchell Hashimoto
2026-08-27 14:57:59 -07:00
committed by GitHub
parent 2de1596115
commit 07abbd1e7e

View File

@@ -3,10 +3,6 @@ import Foundation
extension URL {
/// The decoded path with trailing separators removed, except for the root path.
var pathWithoutTrailingSlash: String {
var result = path(percentEncoded: false)
while result.count > 1 && result.hasSuffix("/") {
result.removeLast()
}
return result
FilePath(path(percentEncoded: false)).string
}
}