(_ document: AppBackupDocument)
| 160 | } |
| 161 | |
| 162 | func encode(_ document: AppBackupDocument) throws -> Data { |
| 163 | let encoder = JSONEncoder() |
| 164 | encoder.outputFormatting = [.prettyPrinted, .sortedKeys] |
| 165 | encoder.dateEncodingStrategy = .iso8601 |
| 166 | return try encoder.encode(document) |
| 167 | } |
| 168 | |
| 169 | func decode(_ data: Data) throws -> AppBackupDocument { |
| 170 | let decoder = JSONDecoder() |
no outgoing calls
no test coverage detected