Implemented the "init(at: )" initialiser, the "pathString" computed property, and the "appendingPath(_: )" function for the URL+Extensions extension in the library target.

This commit is contained in:
2025-01-12 21:25:51 +01:00
parent 3a447b4f71
commit a1ad391baa
5 changed files with 114 additions and 38 deletions
+1 -17
View File
@@ -54,25 +54,9 @@ public struct FileService: FileServicing {
throw FileServiceError.urlNotFileURL
}
let filePath = getPath(for: url)
let filePath = url.pathString
return fileManager.fileExists(atPath: filePath)
}
}
// MARK: - Helpers
private extension FileService {
// MARK: Functions
func getPath(for url: URL) -> String {
if #available(macOS 13.0, *) {
return url.path()
} else {
return url.path
}
}
}