Skip to main content

ensure_mut_array_field

Function ensure_mut_array_field 

Source
pub fn ensure_mut_array_field(root: &mut Map<String, Value>, key: &str) -> bool
Expand description

Adds an array field to an object if it is absent.

§Parameters

§Returns

Returns true when the condition checked by crate::runtime::json_commands::ensure_mut_array_field holds and false otherwise.

§Examples

ⓘ
let _result = pharos_native::runtime::json_commands::ensure_mut_array_field(std::path::Path::new("."), "key");