CEL-Rust WASM-bindgen Demo

This demo uses wasm-bindgen to provide a JavaScript API for CEL evaluation using cel-rust.

WASM module not loaded yet...

Examples (click to try):

Basic String Operations

Expression: 'Hello ' + name + '!' Context: {"name": "World"}

Math Operations

Expression: (price * double(quantity)) * (1.0 + tax) Context: {"price": 10.50, "quantity": 3, "tax": 0.08}

List Operations

Expression: string(scores.filter(s, s > 90).size()) + ' high scores' Context: {"scores": [85, 92, 78, 96, 88]}

Conditional Logic

Expression: age >= 18 ? (age >= 65 ? 'senior' : 'adult') : 'minor' Context: {"age": 25}

Map/Object Access

Expression: user.profile.country == 'US' && user.profile.verified Context: {"user": {"profile": {"country": "US", "verified": true}}}

Time and Date Operations

Expression: some_date < now - old ? 'old' : 'recent' Context: {"some_date": "2023-10-01T12:00:00Z", "now": "2023-10-03T12:00:00Z", "old": "24h"}