Files
openclaw/apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayPayloadDecoding.swift
Peter Steinberger e01d1e85f3 ci(swift): enforce shared OpenClawKit dead-code coverage (#105770)
* ci(swift): enforce shared kit dead-code coverage

* chore(i18n): sync native source inventory

* ci(swift): install pinned iOS scan tools
2026-07-12 17:35:47 -07:00

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)
}
}