Skip to content

Optional

Optional points to a value if non-empty.

new Optional(inner?): Optional

Val

Optional

aggregateSize(sizer): number

aggregateSize implements AggregateSizeVisitor. An empty optional contributes nothing.

AggregateSizer

number


convertToNative(typeDesc?): unknown

ConvertToNative converts the Value to a native TypeScript value according to the provided type description, or throws if the conversion is not feasible.

unknown

unknown

Val.convertToNative


convertToType(typeValue): Val

ConvertToType supports type conversions between CEL value types supported by the expression language.

RefType

Val

Val.convertToType


equal(other): Val

Equal determines whether the values contained by two optional values are equal.

Val

Val

Val.equal


getValue(): Val

GetValue returns the wrapped value contained in the optional.

Val


hasValue(): boolean

HasValue returns true if the optional has a value.

boolean


toString(): string

String returns the string representation of the optional.

string


type(): RefType

Type returns the TypeValue of the value.

RefType

Val.type


value(): unknown

Value returns the underlying Value() of the wrapped value, if present.

unknown

Val.value