Removed the unnecessary "fullPath" computed property from the Resource model in the library target.

This commit is contained in:
2025-09-30 15:30:28 +02:00
parent 6b3cc44a15
commit 790433f1a7
4 changed files with 9 additions and 57 deletions
@@ -31,8 +31,6 @@ extension String {
static let forwardSlash = "%@/"
/// A format pattern used to generate relative paths for index files.
static let index = "%@/%@/index.html"
/// A format pattern used to generate relative paths for resources.
static let resource = "/%@/%@"
/// A format pattern used to generate relative paths that starts with the `/` string.
static let root = "/%@"
}
@@ -37,7 +37,7 @@ extension String {
return nil
}
return matches.output.1
return matches.output.1 ?? .empty
}
}
@@ -11,7 +11,7 @@
// ===----------------------------------------------------------------------===
/// A model that encapsulates the information related to a resource in a given `DocC` documentation archive.
struct Resource {
struct Resource: Equatable {
// MARK: Properties
@@ -38,18 +38,13 @@ struct Resource {
// MARK: Computed
/// A relative URI path to a documentation archive the resource belongs to.
lazy var archivePath: String = {
var archivePath: String {
.init(format: .Format.Path.archive, archiveName)
}()
}
/// A reference name for the documentation archive the resource belongs to.
lazy var archiveReference: String = {
var archiveReference: String {
archiveName.lowercased()
}()
/// A relative URI path to the resource in its documentation archive.
lazy var fullPath: String = {
.init(format: .Format.Path.archive, archiveName, relativePath)
}()
}
}