MCPcopy
hub / github.com/SleepingBag945/dddd / ToStringMap

Function ToStringMap

lib/nuclei/pkg/types/interfaces.go:151–165  ·  view source on GitHub ↗

ToStringMap casts an interface to a map[string]interface{} type.

(i interface{})

Source from the content-addressed store, hash-verified

149
150// ToStringMap casts an interface to a map[string]interface{} type.
151func ToStringMap(i interface{}) map[string]interface{} {
152 var m = map[string]interface{}{}
153
154 switch v := i.(type) {
155 case map[interface{}]interface{}:
156 for k, val := range v {
157 m[ToString(k)] = val
158 }
159 return m
160 case map[string]interface{}:
161 return v
162 default:
163 return nil
164 }
165}

Callers

nothing calls this directly

Calls 1

ToStringFunction · 0.70

Tested by

no test coverage detected