chore(deps): bump github.com/tidwall/gjson from 1.17.1 to 1.17.3
Bumps [github.com/tidwall/gjson](https://github.com/tidwall/gjson) from 1.17.1 to 1.17.3. - [Commits](https://github.com/tidwall/gjson/compare/v1.17.1...v1.17.3) --- updated-dependencies: - dependency-name: github.com/tidwall/gjson dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
Ralf Haferkamp
parent
6f7f3d0706
commit
ba7e67f73b
+5
-3
@@ -1,7 +1,9 @@
|
||||
<p align="center">
|
||||
<img
|
||||
src="logo.png"
|
||||
width="240" height="78" border="0" alt="GJSON">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="/.github/images/logo-dark.png">
|
||||
<source media="(prefers-color-scheme: light)" srcset="/.github/images/logo-light.png">
|
||||
<img src="/.github/images/logo-light.png" width="240" alt="GJSON" >
|
||||
</picture>
|
||||
<br>
|
||||
<a href="https://godoc.org/github.com/tidwall/gjson"><img src="https://img.shields.io/badge/api-reference-blue.svg?style=flat-square" alt="GoDoc"></a>
|
||||
<a href="https://tidwall.com/gjson-play"><img src="https://img.shields.io/badge/%F0%9F%8F%90-playground-9900cc.svg?style=flat-square" alt="GJSON Playground"></a>
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
# GJSON Path Syntax
|
||||
|
||||
A GJSON Path is a text string syntax that describes a search pattern for quickly retreiving values from a JSON payload.
|
||||
A GJSON Path is a text string syntax that describes a search pattern for quickly retrieving values from a JSON payload.
|
||||
|
||||
This document is designed to explain the structure of a GJSON Path through examples.
|
||||
|
||||
@@ -15,12 +15,12 @@ This document is designed to explain the structure of a GJSON Path through examp
|
||||
- [Multipaths](#multipaths)
|
||||
- [Literals](#literals)
|
||||
|
||||
The definitive implemenation is [github.com/tidwall/gjson](https://github.com/tidwall/gjson).
|
||||
The definitive implementation is [github.com/tidwall/gjson](https://github.com/tidwall/gjson).
|
||||
Use the [GJSON Playground](https://gjson.dev) to experiment with the syntax online.
|
||||
|
||||
## Path structure
|
||||
|
||||
A GJSON Path is intended to be easily expressed as a series of components seperated by a `.` character.
|
||||
A GJSON Path is intended to be easily expressed as a series of components separated by a `.` character.
|
||||
|
||||
Along with `.` character, there are a few more that have special meaning, including `|`, `#`, `@`, `\`, `*`, `!`, and `?`.
|
||||
|
||||
@@ -46,7 +46,7 @@ The following GJSON Paths evaluate to the accompanying values.
|
||||
|
||||
### Basic
|
||||
|
||||
In many cases you'll just want to retreive values by object name or array index.
|
||||
In many cases you'll just want to retrieve values by object name or array index.
|
||||
|
||||
```go
|
||||
name.last "Anderson"
|
||||
|
||||
+15
-4
@@ -1252,7 +1252,7 @@ func parseObject(c *parseContext, i int, path string) (int, bool) {
|
||||
}
|
||||
|
||||
// matchLimit will limit the complexity of the match operation to avoid ReDos
|
||||
// attacks from arbritary inputs.
|
||||
// attacks from arbitrary inputs.
|
||||
// See the github.com/tidwall/match.MatchLimit function for more information.
|
||||
func matchLimit(str, pattern string) bool {
|
||||
matched, _ := match.MatchLimit(str, pattern, 10000)
|
||||
@@ -1917,6 +1917,16 @@ func appendHex16(dst []byte, x uint16) []byte {
|
||||
)
|
||||
}
|
||||
|
||||
// DisableEscapeHTML will disable the automatic escaping of certain
|
||||
// "problamatic" HTML characters when encoding to JSON.
|
||||
// These character include '>', '<' and '&', which get escaped to \u003e,
|
||||
// \u0026, and \u003c respectively.
|
||||
//
|
||||
// This is a global flag and will affect all further gjson operations.
|
||||
// Ideally, if used, it should be set one time before other gjson functions
|
||||
// are called.
|
||||
var DisableEscapeHTML = false
|
||||
|
||||
// AppendJSONString is a convenience function that converts the provided string
|
||||
// to a valid JSON string and appends it to dst.
|
||||
func AppendJSONString(dst []byte, s string) []byte {
|
||||
@@ -1940,7 +1950,8 @@ func AppendJSONString(dst []byte, s string) []byte {
|
||||
dst = append(dst, 'u')
|
||||
dst = appendHex16(dst, uint16(s[i]))
|
||||
}
|
||||
} else if s[i] == '>' || s[i] == '<' || s[i] == '&' {
|
||||
} else if !DisableEscapeHTML &&
|
||||
(s[i] == '>' || s[i] == '<' || s[i] == '&') {
|
||||
dst = append(dst, '\\', 'u')
|
||||
dst = appendHex16(dst, uint16(s[i]))
|
||||
} else if s[i] == '\\' {
|
||||
@@ -2194,7 +2205,7 @@ func unescape(json string) string {
|
||||
}
|
||||
|
||||
// Less return true if a token is less than another token.
|
||||
// The caseSensitive paramater is used when the tokens are Strings.
|
||||
// The caseSensitive parameter is used when the tokens are Strings.
|
||||
// The order when comparing two different type is:
|
||||
//
|
||||
// Null < False < Number < String < True < JSON
|
||||
@@ -3353,7 +3364,7 @@ func (t Result) Path(json string) string {
|
||||
goto fail
|
||||
}
|
||||
if !strings.HasPrefix(json[t.Index:], t.Raw) {
|
||||
// Result is not at the JSON index as exepcted.
|
||||
// Result is not at the JSON index as expected.
|
||||
goto fail
|
||||
}
|
||||
for ; i >= 0; i-- {
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user