Skip to main content

Module strip_values

Module strip_values 

Source
Expand description

Key-only structure extraction for configuration files.

Strips the value side of every key = value line, leaving only the key and delimiter. Comments, blank lines, and section headers (lines without a delimiter, such as [section]) are passed through unchanged.

This is useful for sharing a configuration file’s structure (e.g. for a code review or LLM prompt) without exposing the actual values.

§Example

use sanitize_engine::strip_values_from_text;

let input = "# db settings\nhost = localhost\nport = 5432\n";
let output = strip_values_from_text(input, "=", "#");

assert!(output.contains("host =\n"));
assert!(output.contains("port =\n"));
assert!(!output.contains("localhost"));
assert!(output.contains("# db settings\n"));

Functions§

strip_values_from_text
Strip values from content, preserving keys, comments, and structure.