EncodeJSONKeyStringAscending encodes the JSON key string value with a JSON specific escaped terminator. This allows us to encode keys in the same number of bytes as a string, while at the same time giving us a sentinel to identify JSON keys. The end parameter is used to determine if this is the last
(b []byte, s string, end bool)
| 487 | // while at the same time giving us a sentinel to identify JSON keys. The end parameter is used |
| 488 | // to determine if this is the last key in a a JSON path. If it is we don't add a separator after it. |
| 489 | func EncodeJSONKeyStringAscending(b []byte, s string, end bool) []byte { |
| 490 | str := UnsafeConvertStringToBytes(s) |
| 491 | |
| 492 | if end { |
| 493 | return encodeBytesAscendingWithoutTerminatorOrPrefix(b, str) |
| 494 | } |
| 495 | return encodeBytesAscendingWithTerminator(b, str, escapedJSONObjectKeyTerm) |
| 496 | } |
| 497 | |
| 498 | // EncodeJSONEmptyArray returns a byte array b with a byte to signify an empty JSON array. |
| 499 | func EncodeJSONEmptyArray(b []byte) []byte { |
no test coverage detected