MCPcopy
hub / github.com/spf13/viper / insensitiviseVal

Function insensitiviseVal

util.go:73–87  ·  view source on GitHub ↗
(val any)

Source from the content-addressed store, hash-verified

71}
72
73func insensitiviseVal(val any) any {
74 switch v := val.(type) {
75 case map[any]any:
76 // nested map: cast and recursively insensitivise
77 val = cast.ToStringMap(val)
78 insensitiviseMap(val.(map[string]any))
79 case map[string]any:
80 // nested map: recursively insensitivise
81 insensitiviseMap(v)
82 case []any:
83 // nested array: recursively insensitivise
84 insensitiveArray(v)
85 }
86 return val
87}
88
89func insensitiviseMap(m map[string]any) {
90 for key, val := range m {

Callers 2

insensitiviseMapFunction · 0.85
insensitiveArrayFunction · 0.85

Calls 2

insensitiviseMapFunction · 0.85
insensitiveArrayFunction · 0.85

Tested by

no test coverage detected