Skip to content

Commit 6eba5e0

Browse files
authored
Documented parameters expected to be integers. (#124)
1 parent 44aa48a commit 6eba5e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jep-014-string-functions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ The `$start` and `$end` parameters are optional and allow restricting the range
3232
- If `$start` is omitted, it defaults to `0` (which is the start of the `$subject` string).
3333
- If `$end` is omitted, it defaults to `length(subject)` (which is past the end of the `$subject` string).
3434

35+
If not omitted, the `$start` or `$end` arguments are expected to be integers. Otherwise, an error MUST be raised.
36+
3537
Contrary to similar functions found in most popular programming languages, the `find_first()` function does not return `-1` if no occurrence of the substring can be found. Instead, it returns `null` for consistency reasons with how JMESPath behaves.
3638

3739
### Examples
@@ -98,6 +100,8 @@ If present, it MUST have length 1, otherwise an error MUST be raised.
98100

99101
If the `$subject` string has length greater than or equal to `$width`, it is returned unmodified.
100102

103+
If `$width` is not an integer, an error MUST be raised.
104+
101105
### Examples
102106

103107
| Given | Expression | Result
@@ -121,6 +125,8 @@ If present, it MUST have length 1, otherwise an error MUST be raised.
121125

122126
If the `$subject` string has length greater than or equal to `$width`, it is returned unmodified.
123127

128+
If `$width` is not an integer, an error MUST be raised.
129+
124130
### Examples
125131

126132
| Given | Expression | Result

0 commit comments

Comments
 (0)