This demo uses wasm-bindgen to provide a JavaScript API for
CEL evaluation using cel-rust.
Expression: 'Hello ' + name + '!'
Context: {"name": "World"}
Expression: (price * double(quantity)) * (1.0 + tax)
Context: {"price": 10.50, "quantity": 3, "tax": 0.08}
Expression: string(scores.filter(s, s > 90).size()) + ' high
scores'
Context: {"scores": [85, 92, 78, 96, 88]}
Expression: age >= 18 ? (age >= 65 ? 'senior' : 'adult') :
'minor'
Context: {"age": 25}
Expression: user.profile.country == 'US' &&
user.profile.verified
Context: {"user": {"profile": {"country": "US", "verified":
true}}}
Expression: some_date < now - old ? 'old' : 'recent'
Context: {"some_date": "2023-10-01T12:00:00Z", "now":
"2023-10-03T12:00:00Z", "old": "24h"}