19 lines
415 B
Swift
19 lines
415 B
Swift
import Foundation
|
|
|
|
class Item: ObservableObject {
|
|
|
|
unowned let content: Content
|
|
|
|
init(content: Content) {
|
|
self.content = content
|
|
}
|
|
|
|
func makeCleanAbsolutePath(_ path: String) -> String {
|
|
"/" + makeCleanRelativePath(path)
|
|
}
|
|
|
|
func makeCleanRelativePath(_ path: String) -> String {
|
|
path.components(separatedBy: "/").filter { !$0.isEmpty }.joined(separator: "/")
|
|
}
|
|
}
|