@bufbuild/cel
Version:
A CEL evaluator for ECMAScript
16 lines (15 loc) • 806 B
TypeScript
import { type CelValue } from "./type.js";
/**
* Checks for equality of two CEL values. It follows the following rules:
*
* - Numeric values (`int`, `uint`, and `double`) are compared across types.
* - `NaN` does not equal `NaN`.
* - Other scalar values (`bool`, `string`, `bytes`, and `type`) are only equal if type and value are identical.
* - `google.protobuf.Any` is unpacked before comparison.
* - Lists are equal if lengths match and each element matches the corresponding element in the other one.
* - Maps are equal if both of them have the same set of keys and corresponding values.
* - If the types don't match it returns false.
*
* Ref: https://github.com/google/cel-spec/blob/v0.24.0/doc/langdef.md#equality
*/
export declare function equals(lhs: CelValue, rhs: CelValue): boolean;