From 360c8e10747104b3709d793f39012758628fce79 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Fri, 17 Nov 2023 10:09:45 +0100 Subject: [PATCH] Fixing typos --- SYNTAX.md | 8 ++++---- gjson.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SYNTAX.md b/SYNTAX.md index 6721d7f..a3f0fac 100644 --- a/SYNTAX.md +++ b/SYNTAX.md @@ -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" diff --git a/gjson.go b/gjson.go index 7949825..000b799 100644 --- a/gjson.go +++ b/gjson.go @@ -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) @@ -2189,8 +2189,8 @@ func unescape(json string) string { return string(str) } -// Less return true if a token is less than another token. -// The caseSensitive paramater is used when the tokens are Strings. +// Less returns true if a token is less than another token. +// The caseSensitive parameter is used when the tokens are Strings. // The order when comparing two different type is: // // Null < False < Number < String < True < JSON