func swiftType()

in Sources/SwiftBuffet/Utilities.swift [9:24]


func swiftType(from type: String, with swiftPrefix: String) -> String {
    switch type {
    case "double": return "Double"
    case "float": return "Float"
    case "int32", "sint32", "sfixed32": return "Int"
    case "int64", "sint64", "sfixed64": return "Int"
    case "uint32", "fixed32": return "UInt"
    case "uint64", "fixed64": return "UInt"
    case "bool": return "Bool"
    case "string": return "String"
    case "bytes": return "Data"
    case "google.protobuf.Timestamp": return "Date"
    case "google.protobuf.Duration": return "TimeInterval"
    default: return "\(swiftPrefix)\(type)" // Handle nested messages and enums if needed
    }
}