Skip to content

Commit

Permalink
Split up load to improve testability from spi-server
Browse files Browse the repository at this point in the history
  • Loading branch information
finestructure committed Jan 26, 2024
1 parent 3e51904 commit d77a9dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/SPIManifest/Manifest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ extension Manifest {
throw ManifestError.noData
}

return try load(data: data)
}

@discardableResult
public static func load(data: Data, maxByteSize: Int = maxByteSize) throws -> Self {
guard data.count <= maxByteSize else {
throw ManifestError.fileTooLarge(size: data.count)
}
Expand Down

0 comments on commit d77a9dd

Please sign in to comment.