🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@bufbuild/cel-spec

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bufbuild/cel-spec

CEL definitions and test data

latest
Source
npmnpm
Version
0.5.0
Version published
Weekly downloads
250K
25.54%
Maintainers
5
Weekly downloads
 
Created
Source

@bufbuild/cel-spec

This package provides CEL definitions and test data from the CEL specification (v0.25.1).

CEL uses Protocol Buffer definitions for parsed expressions. For example, the message cel.expr.ParsedExpr provides an abstract representation of a parsed CEL expression. The message types and schemas can be imported from @bufbuild/cel-spec:

import { ParsedExpr } from "@bufbuild/cel-spec/cel/expr/syntax_pb.js";

CEL's conformance test suite also uses Protocol Buffers to define test cases. All messages from the cel.expr.conformance namespace are exported from this package as well, and the function getConformanceSuite provides conformance test data:

import { getConformanceSuite } from "@bufbuild/cel-spec/testdata/tests.js";
import { getTestRegistry } from "@bufbuild/cel-spec/testdata/registry.js";

In addition to CEL's conformance test data, this package also exports parser tests extracted from cel-go:

import { getParsingSuite, getComprehensionSuite } from "@bufbuild/cel-spec/testdata/tests.js";

Incremental approach

The tests aggregated by this package are useful for incremental testing of a CEL implementation. That is, they provide input expressions along with outputs at multiple points in the lifecycle of a CEL program, not only its final output.

Chiefly, tests provide some or all of the following outputs:

  • The parsed abstract syntax tree (AST) for an input expression
  • The output type that should be statically inferred by a type checker for an expression
  • The final result of compiling and running the expression

It should be noted that only the final result is actually provided by the conformance tests sourced from the CEL specification repo. The incremental outputs are derived from the cel-go implementation, considering it to be positioned as a reference implementation.

Keywords

javascript

FAQs

Package last updated on 06 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts