mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-16 23:31:38 +00:00
* ci(swift): enforce shared kit dead-code coverage * chore(i18n): sync native source inventory * ci(swift): install pinned iOS scan tools
13 lines
326 B
Swift
13 lines
326 B
Swift
import Foundation
|
|
import OpenClawProtocol
|
|
|
|
public enum GatewayPayloadDecoding {
|
|
public 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)
|
|
}
|
|
}
|