Skip to main content

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.
config_text_is_blank
Whether a config file’s text holds nothing but whitespace and comments: an empty file, to the reader.
expand_env_vars
Replace $ENV:VAR_NAME and $ENV:VAR_NAME:fallback in a string.
merge_into_template
Merge user settings into a JSONC template string.
parse_config_text
A config file’s text as T: JSONC (comments and trailing commas allowed), with or without a byte-order mark. What read_config_file parses, so a caller can check bytes it holds the same way.
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.