feat: update container
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use boa_engine::{Context, JsResult, JsString, JsValue};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
wit_bindgen_rust::export!("../exports.wit");
|
||||
wit_bindgen_rust::import!("../container.wit");
|
||||
|
||||
@@ -31,7 +32,7 @@ fn do_fetch(_: &JsValue, args: &[JsValue], ctx: &mut Context) -> JsResult<JsValu
|
||||
let mut fetch_params_map = Map::new();
|
||||
fetch_params_map.insert("url".to_string(), args[0].to_json(ctx).expect("error"));
|
||||
if args.len() > 1 {
|
||||
fetch_params_map.insert("params".to_string(), args[1].to_json(ctx).expect("error"));
|
||||
fetch_params_map.insert("options".to_string(), args[1].to_json(ctx).expect("error"));
|
||||
}
|
||||
let fetch_params = format!("{}", Value::Object(fetch_params_map));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user