fix: make last(empty) yield no output values (#3179)

This commit is contained in:
itchyny authored and GitHub committed 2024-11-13 20:35:50 +09:00
1 parent 3c5707f7fb
commit a7b22539a4
6 files changed
+46 -4

No files matched your search

+4 -1
View File
@@ -3069,9 +3069,12 @@ sections:
Note that `nth(n; expr)` doesn't support negative values of `n`.
examples:
- program: '[first(range(.)), last(range(.)), nth(./2; range(.))]'
- program: '[first(range(.)), last(range(.)), nth(5; range(.))]'
input: '10'
output: ['[0,9,5]']
- program: '[first(empty), last(empty), nth(5; empty)]'
input: 'null'
output: ['[]']
- title: "`first`, `last`, `nth(n)`"
body: |