mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-21 18:31:24 +02:00
Add Exists function
This commit is contained in:
parent
5a06f4788b
commit
8331c4b305
@ -133,6 +133,10 @@ func gJsonResultArrayToDecoratedResultArray(results []gjson.Result) []decoratedG
|
|||||||
return decoratedResults
|
return decoratedResults
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *decoratedGJSONResult) Exists(key string) bool {
|
||||||
|
return r.Get(key).Exists()
|
||||||
|
}
|
||||||
|
|
||||||
func (r *decoratedGJSONResult) Array(key string) []decoratedGJSONResult {
|
func (r *decoratedGJSONResult) Array(key string) []decoratedGJSONResult {
|
||||||
if key == "" {
|
if key == "" {
|
||||||
return gJsonResultArrayToDecoratedResultArray(r.Result.Array())
|
return gJsonResultArrayToDecoratedResultArray(r.Result.Array())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user