11 releases

0.1.11 Oct 25, 2024
0.1.10 Sep 2, 2024
0.1.8 Aug 24, 2024
0.1.3 Jun 13, 2024
0.1.2 May 21, 2024

#11 in #ctx

Download history 14/week @ 2024-07-14 13/week @ 2024-07-28 121/week @ 2024-08-04 181/week @ 2024-08-11 330/week @ 2024-08-18 66/week @ 2024-08-25 282/week @ 2024-09-01 23/week @ 2024-09-08 12/week @ 2024-09-15 18/week @ 2024-09-22 12/week @ 2024-09-29 15/week @ 2024-10-13 129/week @ 2024-10-20 35/week @ 2024-10-27

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

MulanPSL-2.0

20KB
365 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
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Dependencies

~17–24MB
~360K SLoC