|
@@ -11,6 +11,18 @@ import (
|
|
|
// Map type
|
|
|
type Map map[string]interface{}
|
|
|
|
|
|
+func IsMap(val any) (res Map, check bool) {
|
|
|
+ switch tv := val.(type) {
|
|
|
+ case map[string]any:
|
|
|
+ res, check = Map(tv), true
|
|
|
+ case Map:
|
|
|
+ res, check = tv, true
|
|
|
+ default:
|
|
|
+ res = nil
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
// New init Map object
|
|
|
func NewMap() Map {
|
|
|
return make(Map)
|