zen-engine 0.55.0

Business rules engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use anyhow::Context;
use rquickjs::loader::Bundle;
use rquickjs::{embed, Runtime};

static JS_BUNDLE: Bundle = embed! {
    "dayjs": "js/v1/dayjs.js",
    "big": "js/v1/big.js",
    "internals": "js/v1/internals.js"
};

pub(crate) fn create_runtime() -> anyhow::Result<Runtime> {
    let runtime = Runtime::new().context("Failed to create runtime")?;
    runtime.set_loader(JS_BUNDLE, JS_BUNDLE);

    Ok(runtime)
}