summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Jurkiewicz <alex@jurkiewi.cz>2023-06-21 19:21:39 +1000
committerGitHub <noreply@github.com>2023-06-21 18:21:39 +0900
commitdd5ce98caf669bb44db5e526624c1a796325d45e (patch)
tree11a2ed184b69e76749c7f3173b3abf44b79969c5
parent9a590427db237d0aed5efe7eeaf13eb2bb3299d6 (diff)
Document `length` for numbers and bools (#2625)
This was added in ae7a042876130c471dce28a4396abc215192eaa9 but not explicitly documented.
-rw-r--r--docs/content/manual/manual.yml8
-rw-r--r--docs/content/manual/v1.6/manual.yml8
2 files changed, 12 insertions, 4 deletions
diff --git a/docs/content/manual/manual.yml b/docs/content/manual/manual.yml
index 431ebcbc..454c05ce 100644
--- a/docs/content/manual/manual.yml
+++ b/docs/content/manual/manual.yml
@@ -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`"
diff --git a/docs/content/manual/v1.6/manual.yml b/docs/content/manual/v1.6/manual.yml
index 58de6e91..4e75bf5d 100644
--- a/docs/content/manual/v1.6/manual.yml
+++ b/docs/content/manual/v1.6/manual.yml
@@ -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`"