celscript — TypeScript subset → Google CEL

Define a Context type, then write a TypeScript expression against it. The compiled CEL appears below.

Context (TypeScript)Top-level fields are destructured into scope in the body below
Body — expressionIn scope: user, req, roles — A single expression. For statements (switch, loops, const), wrap them in a zero-arg IIFE: `(() => { … })()`.
No problems detected
Compiled CEL (read-only)
Decision tree (outer branching)
Explanation
an advanced condition ({ const { user, req, roles } = ctx; return user.role === "admin" || (user.age >= 18 && req.method === "GET" && roles.some((r) => r === "reader")); })

Parts of this rule are shown as code because they have no plain-language template yet.