Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions gjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,16 @@ func (t Result) IsBool() bool {
return t.Type == True || t.Type == False
}

// IsNumber returns true if the result value is a JSON number.
func (t Result) IsNumber() bool {
return t.Type == Number
}

// IsString returns true if the result value is a JSON string.
func (t Result) IsString() bool {
return t.Type == String
}

// ForEach iterates through values.
// 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
Expand Down