10 lines
283 B
Swift
Raw Permalink Normal View History

2026-01-04 14:32:47 +00:00
import ClawdbotKit
import Foundation
enum ChatPayloadDecoding {
static func decode<T: Decodable>(_ payload: AnyCodable, as _: T.Type = T.self) throws -> T {
let data = try JSONEncoder().encode(payload)
return try JSONDecoder().decode(T.self, from: data)
}
}