MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Sets

Function Sets

ext/sets.go:78–84  ·  view source on GitHub ↗

Sets returns a cel.EnvOption to configure namespaced set relationship functions. There is no set type within CEL, and while one may be introduced in the future, there are cases where a `list` type is known to behave like a set. For such cases, this library provides some basic functionality for dete

(options ...SetsOption)

Source from the content-addressed store, hash-verified

76// sets.intersects([1], [1, 2]) // true
77// sets.intersects([[1], [2, 3]], [[1, 2], [2, 3.0]]) // true
78func Sets(options ...SetsOption) cel.EnvOption {
79 l := &setsLib{}
80 for _, o := range options {
81 l = o(l)
82 }
83 return cel.Lib(l)
84}
85
86// SetsOption declares a functional operator for configuring set extensions.
87type SetsOption func(*setsLib) *setsLib

Callers 4

evaluator.goFile · 0.92
TestSetsVersionFunction · 0.85
testSetsEnvFunction · 0.85

Calls 1

LibFunction · 0.92

Tested by 2

TestSetsVersionFunction · 0.68
testSetsEnvFunction · 0.68