This commit is contained in:
2025-09-27 06:57:12 +04:00
parent 4662ce3c02
commit de1ac8e010
16 changed files with 595 additions and 33 deletions

View File

@@ -30,6 +30,15 @@ pub fn decode_u32(data string) !u32 {
return u32(parsed_uint)
}
pub fn decode_string(data string) !string {
// Try JSON decode first (for proper JSON strings)
// if result := json2.decode[string](data) {
// return result
// }
// If that fails, return an error
return data
}
pub fn decode_bool(data string) !bool {
return json2.decode[bool](data) or { return error('Failed to decode bool: ${data}') }
}