MCPcopy
hub / github.com/wavetermdev/waveterm / GetStringMap

Method GetStringMap

pkg/waveobj/metamap.go:55–73  ·  view source on GitHub ↗
(key string, useDeleteSentinel bool)

Source from the content-addressed store, hash-verified

53}
54
55func (m MetaMapType) GetStringMap(key string, useDeleteSentinel bool) map[string]string {
56 mval := m.GetMap(key)
57 if len(mval) == 0 {
58 return nil
59 }
60 rtn := make(map[string]string, len(mval))
61 for k, v := range mval {
62 if v == nil {
63 if useDeleteSentinel {
64 rtn[k] = MetaMap_DeleteSentinel
65 }
66 continue
67 }
68 if s, ok := v.(string); ok {
69 rtn[k] = s
70 }
71 }
72 return rtn
73}
74
75func (m MetaMapType) GetBool(key string, def bool) bool {
76 if v, ok := m[key]; ok {

Callers 1

resolveEnvMapFunction · 0.80

Calls 1

GetMapMethod · 0.95

Tested by

no test coverage detected