Lists returns a cel.EnvOption to configure extended functions for list manipulation. As a general note, all indices are zero-based. # Distinct Introduced in version: 2 (cost support in version 3) Returns the distinct elements of a list. .distinct() -> Examples: [1, 2, 2, 3
(options ...ListsOption)
| 153 | // ].sortBy(e, e.score).map(e, e.name) |
| 154 | // == ["bar", "foo", "baz"] |
| 155 | func Lists(options ...ListsOption) cel.EnvOption { |
| 156 | l := &listsLib{version: math.MaxUint32, maxRangeSize: defaultMaxRangeSize} |
| 157 | for _, o := range options { |
| 158 | l = o(l) |
| 159 | } |
| 160 | return cel.Lib(l) |
| 161 | } |
| 162 | |
| 163 | const defaultMaxRangeSize = 1_000_000 |
| 164 |