(object JsonObject, key string)
| 29 | type JsonArray = []any |
| 30 | |
| 31 | func GetProperty[T any](object JsonObject, key string) (T, errors.Error) { |
| 32 | property, ok := object[key] |
| 33 | if !ok { |
| 34 | return *new(T), errors.Default.New(fmt.Sprintf("Missing property \"%s\"", key)) |
| 35 | } |
| 36 | return Convert[T](property) |
| 37 | } |
| 38 | |
| 39 | func GetItem[T any](array JsonArray, index int) (T, errors.Error) { |
| 40 | if index < 0 || index >= len(array) { |