checkMeta returns a type error if the given meta value is not map-like
(m any)
| 56 | |
| 57 | // checkMeta returns a type error if the given meta value is not map-like |
| 58 | func checkMeta(m any) *TypeError { |
| 59 | if m == nil { |
| 60 | return nil |
| 61 | } |
| 62 | |
| 63 | mt := derefType(reflect.TypeOf(m)) |
| 64 | if mt.Kind() == reflect.Struct || mt.Kind() == reflect.Map { |
| 65 | return nil |
| 66 | } |
| 67 | |
| 68 | return &TypeError{Actual: mt.String(), Expected: []string{"struct", "map"}} |
| 69 | } |
| 70 | |
| 71 | // LinkObject is a links object as defined by https://jsonapi.org/format/1.0/#document-links |
| 72 | type LinkObject struct { |
no test coverage detected