Skip to content

Commit 5fe60c2

Browse files
committed
📚 docs: update README.md #4
1 parent 4a1cfae commit 5fe60c2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,3 +897,29 @@ func (ctx Context) Paths(json string) []string
897897
// This function also supports case-insensitive comparisons for String type tokens based on the caseSensitive parameter.
898898
func (ctx Context) Less(token Context, caseSensitive bool) bool
899899
```
900+
901+
#### Array()
902+
903+
The `ctx.Array()` method produces an array of values. If the result corresponds to a non-existent value, it will return an empty array. If the result is not a JSON array, a single-element array containing the result will be returned.
904+
905+
#### Value()
906+
907+
The `ctx.Value()` function retrieves an `interface{}`, requiring a type assertion and is typically one of these Go types:
908+
909+
```go
910+
boolean >> bool
911+
number >> float64, float32, int64, uint64
912+
string >> string
913+
null >> nil
914+
array >> []interface{}
915+
object >> map[string]interface{}
916+
```
917+
918+
#### 64-bit un/integers
919+
920+
The `ctx.Int64()` and `ctx.Uint64()` functions can handle the full 64-bit range, enabling support for large JSON integer values (Refer this link: [Min Safe Integer](https://tc39.es/ecma262/#sec-number.min_safe_integer); [Max Safe Integer](https://tc39.es/ecma262/#sec-number.max_safe_integer)).
921+
922+
```go
923+
ctx.Int64() int64 // -9223372036854775808 to 9223372036854775807
924+
ctx.Uint64() uint64 // 0 to 18446744073709551615
925+
```

0 commit comments

Comments
 (0)