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

#14 in #ctx

Download history 13/week @ 2024-07-30 139/week @ 2024-08-06 240/week @ 2024-08-13 298/week @ 2024-08-20 183/week @ 2024-08-27 133/week @ 2024-09-03 13/week @ 2024-09-10 11/week @ 2024-09-17 18/week @ 2024-09-24 10/week @ 2024-10-01 2/week @ 2024-10-08 14/week @ 2024-10-15 144/week @ 2024-10-22 24/week @ 2024-10-29 13/week @ 2024-11-05

197 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–23MB
~352K SLoC