MCPcopy
hub / github.com/BishopFox/jsluice / AsMap

Method AsMap

objects.go:24–34  ·  view source on GitHub ↗

AsMap returns a Go map version of the object

()

Source from the content-addressed store, hash-verified

22
23// AsMap returns a Go map version of the object
24func (o Object) AsMap() map[string]string {
25 out := make(map[string]string, 0)
26 if !o.HasValidNode() {
27 return out
28 }
29
30 for _, k := range o.GetKeys() {
31 out[k] = o.GetString(k, "")
32 }
33 return out
34}
35
36// HasValidNode returns true if the underlying node is
37// a valid JavaScript object

Callers

nothing calls this directly

Calls 3

HasValidNodeMethod · 0.95
GetKeysMethod · 0.95
GetStringMethod · 0.95

Tested by

no test coverage detected