Skip to content

Commit

Permalink
Document length for numbers and bools (#2625)
Browse files Browse the repository at this point in the history
This was added in ae7a042 but not explicitly documented.
  • Loading branch information
alexjurkiewicz authored Jun 21, 2023
1 parent 9a59042 commit dd5ce98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions docs/content/manual/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -814,16 +814,20 @@ sections:
codepoints it contains (which will be the same as its
JSON-encoded length in bytes if it's pure ASCII).
- The length of a **number** is its absolute value.
- The length of an **array** is the number of elements.
- The length of an **object** is the number of key-value pairs.
- The length of **null** is zero.
- It is an error to use `length` on a **boolean**.
examples:
- program: '.[] | length'
input: '[[1,2], "string", {"a":2}, null]'
output: [2, 6, 1, 0]
input: '[[1,2], "string", {"a":2}, null, -5]'
output: [2, 6, 1, 0, 5]


- title: "`utf8bytelength`"
Expand Down
8 changes: 6 additions & 2 deletions docs/content/manual/v1.6/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -736,16 +736,20 @@ sections:
codepoints it contains (which will be the same as its
JSON-encoded length in bytes if it's pure ASCII).
- The length of a **number** is its absolute value.
- The length of an **array** is the number of elements.
- The length of an **object** is the number of key-value pairs.
- The length of **null** is zero.
- It is an error to use `length` on a **boolean**.
examples:
- program: '.[] | length'
input: '[[1,2], "string", {"a":2}, null]'
output: [2, 6, 1, 0]
input: '[[1,2], "string", {"a":2}, null, -5]'
output: [2, 6, 1, 0, 5]


- title: "`utf8bytelength`"
Expand Down

0 comments on commit dd5ce98

Please sign in to comment.