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

Method GetString

objects.go:115–121  ·  view source on GitHub ↗

GetString returns the property corresponding to the provided key as a string, or the defaultVal if the key is not found.

(key, defaultVal string)

Source from the content-addressed store, hash-verified

113// provided key as a string, or the defaultVal if the
114// key is not found.
115func (o Object) GetString(key, defaultVal string) string {
116 value := o.GetNode(key)
117 if value == nil || value.Type() != "string" {
118 return defaultVal
119 }
120 return value.RawString()
121}
122
123// GetStringI is like GetString, but the key is case-insensitive
124func (o Object) GetStringI(key, defaultVal string) string {

Callers 3

AsMapMethod · 0.95
matchJQueryFunction · 0.80
AllURLMatchersFunction · 0.80

Calls 3

GetNodeMethod · 0.95
RawStringMethod · 0.80
TypeMethod · 0.45

Tested by

no test coverage detected