AlphaProtoConstantAsVal converts a v1alpha1.Constant protobuf to a CEL-native ref.Val.
(c *exprpb.Constant)
| 667 | |
| 668 | // AlphaProtoConstantAsVal converts a v1alpha1.Constant protobuf to a CEL-native ref.Val. |
| 669 | func AlphaProtoConstantAsVal(c *exprpb.Constant) (ref.Val, error) { |
| 670 | if c == nil { |
| 671 | return nil, nil |
| 672 | } |
| 673 | canonical := &celpb.Constant{} |
| 674 | if err := convertProto(c, canonical); err != nil { |
| 675 | return nil, err |
| 676 | } |
| 677 | return ProtoConstantAsVal(canonical) |
| 678 | } |
| 679 | |
| 680 | // ProtoConstantAsVal converts a canonical celpb.Constant protobuf to a CEL-native ref.Val. |
| 681 | func ProtoConstantAsVal(c *celpb.Constant) (ref.Val, error) { |
no test coverage detected