mirror of https://github.com/tidwall/gjson.git
parent
e4fc67c92a
commit
82f549e6ee
5
gjson.go
5
gjson.go
|
@ -214,6 +214,11 @@ func (t Result) IsArray() bool {
|
||||||
return t.Type == JSON && len(t.Raw) > 0 && t.Raw[0] == '['
|
return t.Type == JSON && len(t.Raw) > 0 && t.Raw[0] == '['
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsBool returns true if the result value is a JSON boolean.
|
||||||
|
func (t Result) IsBool() bool {
|
||||||
|
return t.Type == True || t.Type == False
|
||||||
|
}
|
||||||
|
|
||||||
// ForEach iterates through values.
|
// ForEach iterates through values.
|
||||||
// If the result represents a non-existent value, then no values will be
|
// If the result represents a non-existent value, then no values will be
|
||||||
// iterated. If the result is an Object, the iterator will pass the key and
|
// iterated. If the result is an Object, the iterator will pass the key and
|
||||||
|
|
Loading…
Reference in New Issue