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_NAMEand$ENV:VAR_NAME:fallbackin a string. - extract_
commented_ 🔒setting_ key - Extract the settings key from a commented-out template line.
Matches lines like:
// "some:key": value,ReturnsSome("some:key")orNone. - 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.jsonas a rawserde_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