MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / js_obj

Function js_obj

packages/native/src/config.rs:197–213  ·  view source on GitHub ↗
(obj: &JsObject, primary: &str, alias: &str)

Source from the content-addressed store, hash-verified

195}
196
197fn js_obj(obj: &JsObject, primary: &str, alias: &str) -> ParseResult<Option<JsObject>> {
198 for name in [primary, alias] {
199 let v = match obj.get_named_property::<JsUnknown>(name) {
200 Ok(v) => v,
201 Err(_) => continue,
202 };
203 match v.get_type().map_err(|_| ())? {
204 ValueType::Undefined => continue,
205 ValueType::Object => {
206 let o = v.coerce_to_object().map_err(|_| ())?;
207 return Ok(Some(o));
208 }
209 _ => return Err(()),
210 }
211 }
212 Ok(None)
213}
214
215fn apply_limits(dst: &mut ffi::zr_limits_t, obj: &JsObject) -> ParseResult<()> {
216 if let Some(v) = js_u32(obj, "arenaMaxTotalBytes", "arena_max_total_bytes")? {

Callers 4

apply_create_cfg_strictFunction · 0.85
apply_runtime_cfg_strictFunction · 0.85
apply_create_cfgFunction · 0.85
apply_runtime_cfgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected