summaryrefslogtreecommitdiff
path: root/vendor/github.com/google/cel-go/ext/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/cel-go/ext/README.md')
-rw-r--r--vendor/github.com/google/cel-go/ext/README.md34
1 files changed, 32 insertions, 2 deletions
diff --git a/vendor/github.com/google/cel-go/ext/README.md b/vendor/github.com/google/cel-go/ext/README.md
index 07e544d..4620204 100644
--- a/vendor/github.com/google/cel-go/ext/README.md
+++ b/vendor/github.com/google/cel-go/ext/README.md
@@ -11,7 +11,7 @@ in expressions.
### Cel.Bind
Binds a simple identifier to an initialization expression which may be used
-in a subsequenct result expression. Bindings may also be nested within each
+in a subsequent result expression. Bindings may also be nested within each
other.
cel.bind(<varName>, <initExpr>, <resultExpr>)
@@ -29,7 +29,7 @@ Local bindings are not guaranteed to be evaluated before use.
## Encoders
-Encoding utilies for marshalling data into standardized representations.
+Encoding utilities for marshalling data into standardized representations.
### Base64.Decode
@@ -500,6 +500,36 @@ Examples:
].sortBy(e, e.score).map(e, e.name)
== ["bar", "foo", "baz"]
+### Last
+
+**Introduced in the OptionalTypes library version 2**
+
+Returns an optional with the last value from the list or `optional.None` if the
+list is empty.
+
+ <list(T)>.last() -> <Optional(T)>
+
+Examples:
+
+ [1, 2, 3].last().value() == 3
+ [].last().orValue('test') == 'test'
+
+This is syntactic sugar for list[list.size()-1].
+
+### First
+
+**Introduced in the OptionalTypes library version 2**
+
+Returns an optional with the first value from the list or `optional.None` if the
+list is empty.
+
+ <list(T)>.first() -> <Optional(T)>
+
+Examples:
+
+ [1, 2, 3].first().value() == 1
+ [].first().orValue('test') == 'test'
+
## Sets
Sets provides set relationship tests.