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

Method NewMap

cel/macro.go:424–430  ·  view source on GitHub ↗

NewMap creates a CreateStruct instruction for a map where the map is comprised of the optional set of key, value entries.

(entries ...*exprpb.Expr_CreateStruct_Entry)

Source from the content-addressed store, hash-verified

422// NewMap creates a CreateStruct instruction for a map where the map is comprised of the
423// optional set of key, value entries.
424func (ah *adaptingHelper) NewMap(entries ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr {
425 adaptedEntries := make([]ast.EntryExpr, len(entries))
426 for i, e := range entries {
427 adaptedEntries[i] = mustAdaptToEntryExpr(e)
428 }
429 return mustAdaptToProto(ah.modernHelper.NewMap(adaptedEntries...))
430}
431
432// NewMapEntry creates a Map Entry for the key, value pair.
433func (ah *adaptingHelper) NewMapEntry(key *exprpb.Expr, val *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry {

Callers

nothing calls this directly

Calls 3

mustAdaptToEntryExprFunction · 0.85
mustAdaptToProtoFunction · 0.85
NewMapMethod · 0.65

Tested by

no test coverage detected