Skip to content

Commit 7396dec

Browse files
Merge pull request #37 from SwiftPackageIndex/update-maxByteSize
Update max byte size
2 parents f3bb6e1 + d77a9dd commit 7396dec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/SPIManifest/Manifest.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public struct Manifest: Codable, Equatable {
135135

136136
extension Manifest {
137137
public static let fileName = ".spi.yml"
138-
public static let maxByteSize = 1_000
138+
public static let maxByteSize = 1_500
139139

140140
public static func load(in directory: String = ".", maxByteSize: Int = Self.maxByteSize) -> Self? {
141141
let path = directory.hasSuffix("/")
@@ -154,6 +154,11 @@ extension Manifest {
154154
throw ManifestError.noData
155155
}
156156

157+
return try load(data: data)
158+
}
159+
160+
@discardableResult
161+
public static func load(data: Data, maxByteSize: Int = maxByteSize) throws -> Self {
157162
guard data.count <= maxByteSize else {
158163
throw ManifestError.fileTooLarge(size: data.count)
159164
}

0 commit comments

Comments
 (0)