3 releases

0.1.3 Jun 13, 2024
0.1.2 May 21, 2024
0.1.1 May 16, 2024

#4 in #li

Download history 144/week @ 2024-05-12 171/week @ 2024-05-19 4/week @ 2024-05-26 138/week @ 2024-06-09 28/week @ 2024-06-16

178 downloads per month
Used in 2 crates (via i18n_js)

Apache-2.0

15KB
301 lines

bjs

use aok::{Result, OK};
use static_init::constructor;

#[constructor(0)]
extern "C" fn init() {
  loginit::init()
}

#[test]
fn test() -> Result<()> {
  // let root = std::env!("CARGO_MANIFEST_DIR");
  //
  // let root = format!("{root}/tests");
  // let ctx = &mut bjs::ctx(&root, &root);
  // let mut map1 = HashMap::new();
  // map1.insert("key1".to_string(), "value1".to_string());
  // map1.insert("key2".to_string(), "value2".to_string());
  //
  // let mut map2 = HashMap::new();
  // map2.insert("key3".to_string(), "value3".to_string());
  // map2.insert("key4".to_string(), "value4".to_string());
  //
  // let arg = [
  //   bjs::li_hashmap_to_jsvalue(ctx, &[map1, map2]),
  //   bjs::li_str_to_jsvalue(ctx, &["x", "b"]),
  // ];
  //
  // match bjs::default(ctx, format!("{root}/test.js"), &arg) {
  //   Ok(r) => {
  //     // dbg!(bjs::VecOrStr::parse(r, ctx));
  //     let r = bjs::obj2map(r).unwrap();
  //     dbg!(r);
  //     // dbg!(&r);
  //     // if let Some(file) = r.remove("file") {
  //     //   dbg!(bjs::li_str(ctx, file));
  //     // }
  //   }
  //   Err(err) => {
  //     info!("{}", err);
  //   }
  // }
  OK
}

Dependencies

~17–24MB
~356K SLoC