Module loader

Module loader 

Source
Expand description

Config file loading, parsing, template merging, and environment expansion.

Functions§

build_default_config
Build the initial default configuration with embedded default assets.
expand_env_vars
Replace $ENV:VAR_NAME and $ENV:VAR_NAME:fallback in a string.
extract_commented_setting_key 🔒
Extract the settings key from a commented-out template line. Matches lines like: // "some:key": value, Returns Some("some:key") or None.
merge_into_template
Merge user settings into a JSONC template string.
parse_jsonc_to_map
Parse a JSONC string (with // comments and trailing commas) into a flat JSON map.
read_config_file
Read a JSON config file, returning default on missing/error.
read_settings_raw_jsonc
Read settings.json as a raw serde_json::Value::Object, stripping JSONC comments and trailing commas. Returns an empty object if the file doesn’t exist or can’t be parsed.
strip_trailing_commas 🔒