DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/UriComponents/StampMidUri.rs
1//! Insert `$mid: 1` into a `UriComponents` object if it isn't already
2//! tagged. Non-object values pass through unchanged so call sites can
3//! pipe any `serde_json::Value` through without branching first.
4
5use serde_json::{Value, json};
6
7use crate::IPC::UriComponents::MID_URI;
8
9pub fn Fn(Input:Value) -> Value {
10 match Input {
11 Value::Object(mut Map) => {
12 Map.entry("$mid".to_string()).or_insert(json!(MID_URI::VALUE));
13
14 Value::Object(Map)
15 },
16
17 Other => Other,
18 }
19}